This topic answers frequently asked questions (FAQs) about using the Phone Number Verification Service for the Android client.
Where can I download the SDK and demo for one-click logon?
Log on to the Phone Number Verification console. On the Overview page, find the API&SDK area on the right and click Download Now. You will be redirected to the API&SDK page. Follow the on-screen instructions to download and decompress the SDK. After decompressing the SDK, you can run it directly.
Does the SDK collect data, such as the device IP address?
The Phone Number Verification Service SDK collects the client's IP information. For more information about data collection, see the Privacy Policy for Phone Number Verification Service.
To ensure privacy compliance, you must obtain user consent to your privacy policy before you initialize the SDK.
Does the Android 13 emulator support only x86_64 and not x86?
The Phone Number Verification Service requires mobile data traffic to function. Therefore, you should not call the Phone Number Verification Service SDK when using an emulator. You can use the following code to detect a virtual machine: implementation 'com.snail:antifake:1.4' EmulatorDetectUtil.isEmulator(context);.
What device CPU architectures does the Phone Number Verification Service support? Are emulators supported?
The Phone Number Verification Service supports the armeabi-v7a, x86, and arm64-v8a CPU architectures. You should check your device architecture. Emulators are not supported because the Phone Number Verification Service requires mobile data traffic to function.
Can I modify the plan name and app name for the Phone Number Verification Service?
No, you cannot modify a plan after it is created. If your information changes or you need to add a new app, you must create a new plan.
For more information, see Phone Number Verification Service.
How do I get the signature of an Android app?
Download and install the Android App Signature Tool on your mobile device. You can use this tool to quickly retrieve the package signature of your Android app. This signature is required for authentication and for creating an authentication plan.
Are there requirements for the mobile data status on the device during the number retrieval process?
Yes, the requirements are as follows:
If only mobile data is enabled on the device, the number retrieval feature works as expected.
If only Wi-Fi is enabled and mobile data is disabled, the number retrieval feature does not work. However, this does not apply if the number has already been successfully retrieved.
If both mobile data and Wi-Fi are enabled, the number retrieval feature works as expected, provided the device can switch to mobile data.
If I already use Short Message Service for new user registration, what changes are needed to integrate the Phone Number Verification Service?
Client
Optimize the user interface (UI). With the Phone Number Verification Service, new users only need to enter their mobile phone number, not a verification code. The UI for new users should only contain a mobile phone number input field. If the network environment does not support number verification, or if the verification fails, you can switch the UI back to the original page that uses text message verification codes.
Integrate the Phone Number Verification Service SDK into your client app.
Server-side
Integrate the Phone Number Verification Service API on your server side.
What should I do if the logon key fails?
Check whether the package name and signature correspond to the logon key.
Why does number verification keep failing on the first attempt, even when the app's network communication is normal?
To identify the cause of the authentication failure, check the following:
You can check the network permission settings.
The SIM card has an overdue payment.
The app has permission to use Wi-Fi but not mobile data.
On Android systems from some Chinese manufacturers, Wi-Fi network permissions are managed separately from mobile data network permissions.
What should I do if an Android app reinforcement error occurs?
You can use a whitelist policy. Encrypt the key using MD5. Use the resulting value as a file name and save the file in the app's assets folder. If the SDK detects this file, it skips the ptrace check.
What does it mean if getting the token times out with error code 600015?
Error code 600015 indicates a timeout caused by a network error. You should check the phone's network environment. To troubleshoot this issue, turn off Wi-Fi and test with 4G mobile data. You can also try restarting the network by toggling airplane mode.
What carriers does one-click logon support?
The Phone Number Verification Service supports SIM cards that have completed identity verification from China's three major carriers: China Mobile, China Telecom, and China Unicom. It does not currently support Internet of Things (IoT) cards or data-only cards.
What does error code 600017 mean for the one-click logon feature?
Error code 600017 usually indicates an incorrect package name, signature, or key. Ensure that the key specified on the plan management page in the Phone Number Verification Service console matches the key in your code.
What should I do if the failure rate is high on the first load?
You can skip calling the pre-retrieval (acceleration) interface. However, a successful pre-retrieval is required to open the authorization page. If you call the getlogintoken interface directly without first calling the pre-retrieval interface, the SDK calls the pre-retrieval interface automatically, which causes a noticeable delay. To open the authorization page quickly, you should call the pre-retrieval interface in advance.
Why can't some devices launch the one-click logon interface on Wi-Fi and 4G?
The Phone Number Verification Service requires mobile data traffic to function. It works in environments with only mobile data or with both mobile data and Wi-Fi. In an environment with both mobile data and Wi-Fi, the one-click logon feature switches from the Wi-Fi channel to the mobile data channel to complete the logon. This process takes some time, and the duration varies depending on the device model. You should also check whether the app has permission to switch network modules.
Why does the logon fail with an "Invalid AccessCode parameter" error?
This error can occur if a token is reused. You should check your business logic for cases where a token is used more than once or after it has expired. The validity periods for authentication tokens are as follows:
China Telecom: 10 minutes, single use.
China Unicom: 60 minutes, single use.
China Mobile: 2 minutes, single use.
Can I customize the UI of the authorization page?
Yes, you can add custom controls. You can add custom controls anywhere on the authorization page except for the one-click logon area, the protocol area, and the mask area.
How do I configure the background color of the logon button?
You cannot change the background color of the logon button on the authorization page. You can only set a background image. To configure the background effect, you can customize an XML file.
Can I use a custom authorization button to get the token?
No. The pre-retrieval mask, logon button, and carrier protocol on the authorization page do not support custom controls. However, other areas do support custom controls.
How do I hide the back button?
You can use the setNavReturnHidden(true) method to hide the back button.
Can I customize the layout of the secondary authorization pop-up window?
The secondary authorization pop-up window is supported only when the authorization page is in full-screen mode.
You can modify a UI element only if the SDK provides an interface to do so. If no interface is provided, the UI element cannot be modified.
What should I do if the logon page displays incorrectly in dark mode?
Upgrade the Phone Number Verification Service SDK to version 2.12.10 or later. To control whether the authorization page follows the system's dark mode, use the mPhoneNumberAuthHelper.setAuthPageUseDayLight(true); method. Set the parameter to true (the default value) to follow the system setting, or set it to false to disable this behavior.
Does the authorization page pop-up window float on top of our activity?
No. The pop-up window mode for the authorization page launches a new activity.
How do I hide the "Switch to other method" component?
You can use the setSwitchAccHidden(true) method to hide the default option for switching to another logon method on the authorization page.
How do I adjust the position of the privacy policy check box on the authorization page? Why isn't the check box and text vertically centered?
The protocol section supports only horizontal centering, not vertical centering. The text is top-aligned. You can set the check box to align its top with the text.