I'm Still working on the ParseUser object and I've now attempted to use Inline code.
If the Java expert guys ever want to wrap the ParseUser for us non-speakers, that would be great. However, in the meantime, the code below is probably wrong but I hope you get the idea of what I'm attempting to achieve.
It's an attempt at a Java subroutine which allows access to the ParseUser object which is an extension of the ParseObject but allows some security connected with creating user accouns
I'm going to use the java object to access the sub but need to return the currentUser object and userID string from the Java routine below (if i've even come close to doing it right)
(The ParseNative jar is an old one that works but I could replace with the current SDK)
Here is the code :
If the Java expert guys ever want to wrap the ParseUser for us non-speakers, that would be great. However, in the meantime, the code below is probably wrong but I hope you get the idea of what I'm attempting to achieve.
It's an attempt at a Java subroutine which allows access to the ParseUser object which is an extension of the ParseObject but allows some security connected with creating user accouns
I'm going to use the java object to access the sub but need to return the currentUser object and userID string from the Java routine below (if i've even come close to doing it right)
(The ParseNative jar is an old one that works but I could replace with the current SDK)
Here is the code :
B4X:
#AdditionalJar: ParseNative
#if JAVA
import com.parse.LogInCallback;
import com.parse.ParseException;
import com.parse.ParseUser;
public void parseLogin (String username,String password) {
ParseUser.logInInBackground(username, password, new LogInCallback() {
public void done(ParseUser user, ParseException e) {
if (user != null) {
ParseUser currentUser = ParseUser.getCurrentUser();
String userID = currentUser.getObjectId().toString();
return currentUser, userID;
// Hooray! The user is logged in. Return the currentUser & objectId back to B4A
} else {
// Signup failed. Return the ParseException to B4A to see what happened.
return e;
}
}
});
}
#End if