Not receiving accessToken and RESULT_OK on onActivityResult when using Neura sdk

100 Views Asked by At

I'm using NeuraSdk in order to detect user events (user arrived home, user left work, etc).

I'm trying to login with their sdk, and even though the login looks successful and i enter the right sms code with the phone, the accessToken isn't received on onActivityResult(...), the resultCode = 0(RESULT_CANCELED) and not 1=(RESULT_OK) as it should be.

Here's my onActivityResult() :

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (resultCode == FragmentActivity.RESULT_OK) {
        Log.i(getClass().getSimpleName(), "Successfully logged in with accessToken : "
                + SDKUtils.extractToken(data));
    } else {
        Log.i(getClass().getSimpleName(), "Failed to login and receive accessToken");
    }
}
1

There are 1 best solutions below

0
On BEST ANSWER

Your package name as listed on the gradle should be corallate with the package name listed on your gradle.

For example, in the neura devsite if i have : app_details

Then check that your gradle has the exact same package name under defaultConfig :

defaultConfig {
    minSdkVersion 14
    targetSdkVersion 22
    applicationId "com.pul.dmg"
}