Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not receiving accessToken and RESULT_OK on onActivityResult when using Neura sdk

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");
    }
}
like image 680
John Bristow Avatar asked Dec 19 '25 05:12

John Bristow


1 Answers

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"
} 
like image 187
Dus Avatar answered Dec 20 '25 18:12

Dus



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!