facebookarchive / account-kit-samples-for-android

Account kit sample for the android platform
Other
123 stars 96 forks source link

how to get input phone number in custom ui #12

Open KingHeavens opened 6 years ago

zaren678 commented 6 years ago

@zhjing03 Can you elaborate a little more? What are you trying to accomplish and what problem are you running into?

KingHeavens commented 6 years ago

I use configurationBuilder.setUIManager(uiManager) and override getHeaderFragment to custom ui. I want to get EditText’s input text(phone num) on my own fragment(input phone num page) .How can I do?

在 2017年8月18日,上午1:59,John Anderson notifications@github.com 写道:

@zhjing03 https://github.com/zhjing03 Can you elaborate a little more? What are you trying to accomplish and what problem are you running into?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/fbsamples/account-kit-samples-for-android/issues/12#issuecomment-323148573, or mute the thread https://github.com/notifications/unsubscribe-auth/AP2jM_DEt60yosMAZv_7jEpqTMYUJSoUks5sZH-agaJpZM4O54-j.

cnaveen1403 commented 6 years ago

use Response type TOKEN AccountKitConfiguration.AccountKitConfigurationBuilder configurationBuilder = new AccountKitConfiguration.AccountKitConfigurationBuilder( LoginType.PHONE, AccountKitActivity.ResponseType.TOKEN);

and get the phone number from the success block using following code

AccountKit.getCurrentAccount(new AccountKitCallback() { @Override public void onSuccess(final Account account) { // Get Account Kit ID // String accountKitId = account.getId();

            // Get phone number
            PhoneNumber phoneNumber = account.getPhoneNumber();
            String phoneNumberString = phoneNumber.toString();
            Log.e(TAG, "onSuccess: phoneNumberString >>> " + phoneNumberString);
            // Get email

// String email = account.getEmail();

            afterLoginSuccess(phoneNumberString);
        }

        @Override
        public void onError(final AccountKitError error) {
            // Handle Error
            Log.e(TAG, "onError: INSIDE ERROR ");
        }
    });
abeatte commented 6 years ago

Is this still a valid issue?