I am experimenting with Digits API by Twitter for registering users on my Android application. Currently in my launching activity I display a button(com.digits.sdk.android.DigitsAuthButton) that asks for users to enter their phone number so that a confirmation code could be sent. Once they enter the confirmation code and are authenticated, I receive a user_id in the callback method.
Now, next time if I click on the same button in the launching activity it doesn't display the option to enter the phone number and just returns back the same user_id which was already registered.
I want to replicate this same thing in my Java code without that extra click of the com.digits.sdk.android.DigitsAuthButton button. I had a look at some samples and they use the following statement to verify the same:
if (Digits.getSessionManager().getActiveSession() != null) { ... }
Is this sufficient or should I use sharedPreference to store the returned user_id with the phone number too ?