Push Commander User Login Mission

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!

@Kasey_Luft do you see any error in the toast? If you fail wit user login you should see a toast with message: Error logging in" + fault.getMessage()

I have tried the example with your app and successfully logged in(I have commented part with registration device)

@sergey.kuk You’re right, looks like it was working all along, I think it was my lack of understanding of Android Studio. Learning how to debug and test a bit better seemed to help. It is currently working.

Thanks for taking a look, I appreciate it!