2

I am using Facebook AccountKit for OTP verification and it is working absolutely fine.

Requirement: To set OTP code on OTP verification screen automatically by reading incoming SMS.

Looking for: Is there any way that I can set text to OTP verification screen programmatically?

I didn't find any answer while searching for same whether Facebook gives customization on OTP verification screen as they give same on first screen where user can put country code and mobile number.

4

4 に答える 4

3

FacebookbooleanOTP メッセージの自動読み取り用に2 つ提供します。

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

 // Add these code
 configurationBuilder.setReadPhoneStateEnabled(true);
 configurationBuilder.setReceiveSMS(true);

AndroidManifest.xml次の 2 つのアクセス許可をファイルに追加する必要もあります。

<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />

API >= 23 の場合:上記 の権限が付与されているかどうかを確認します。

アップデート:

@markus が提案したように、SMS 権限の更新を確認してください。

于 2016-12-16T09:22:31.423 に答える