Hello!
I’m having difficulties getting the Push Commander mission that involves logging in a user and using smart text to send out personalized push messages. Found here.
I was able to get the missions before working but upon reviewing the new mission video, it looks like the code has changed from being this:
Backendless.initApp( this, "E1AC02F7-200D-7D96-FF38-C3117302B100", "227DBF9A-1DC8-4C8F-829A-D1A77EFD4473");
List<String> channels = new ArrayList<String>();
channels.add( "default" );
Backendless.Messaging.registerDevice(channels, new AsyncCallback<DeviceRegistrationResult>() {
@Override
public void handleResponse(DeviceRegistrationResult response) {
Toast.makeText( getContext(), "Device registered!",
Toast.LENGTH_LONG).show();
}
@Override
public void handleFault(BackendlessFault fault) {
Toast.makeText( getContext(), "Error registering " + fault.getMessage(),
Toast.LENGTH_LONG).show();
}
});
To this:
Backendless.initApp( this, "E1AC02F7-200D-7D96-FF38-C3117302B100", "227DBF9A-1DC8-4C8F-829A-D1A77EFD4473");
final AsyncCallback<DeviceRegistrationResult> registerDeviceCallback = new
AsyncCallback<DeviceRegistrationResult>() {
@Override
public void handleResponse(DeviceRegistrationResult response) {
Toast.makeText(getContext(), "Device Registered!", Toast.LENGTH_LONG).show();
}
@Override
public void handleFault(BackendlessFault fault) {
Toast.makeText(getContext(), "Error Registering!" + fault.getMessage(), Toast.LENGTH_LONG).show();
}
};
AsyncCallback<BackendlessUser> loginCallback = new AsyncCallback<BackendlessUser>() {
@Override
public void handleResponse(BackendlessUser response) {
List<String> channels = new ArrayList<>();
channels.add( "default" );
Backendless.Messaging.registerDevice(channels, registerDeviceCallback);
}
@Override
public void handleFault(BackendlessFault fault) {
Toast.makeText(getContext(), "Error logging in" + fault.getMessage(), Toast.LENGTH_LONG).show();
}
};
Backendless.UserService.login("kasey@lookbuyrent.ca", "password", loginCallback );
Is there something else I’m missing here? As it’s not registering when I switch to the second code, nor can I find this in the documentation anywhere what the code is supposed to be. I copied this out from the mission video above. Any help would be greatly appreciated. Thanks!