iOS client FAQ

更新时间:
复制 MD 格式

This topic answers frequently asked questions about the Phone Number Verification Service iOS client.

Question overview

Service inquiries

Usage inquiries

Errors and exceptions

Where can I find the key for the Phone Number Verification Service?

Log on to the Phone Number Verification Service console. On the Plan Management page, a key is automatically generated after you create a verification plan.

What does the error 'isv.INVALID_APP' mean?

Confirm that the Alibaba Cloud account used to create the plan is the same as the Alibaba Cloud account used for the server-side call.

How do I get the server-side App Code?

Log on to the Phone Number Verification Service console. On the Plan Management page, a plan number is generated after you create a verification plan.

Can I use the Access_Token from H5 for one-click logon?

You cannot use the token returned by the getlogintoken API as an input parameter for the getmobile API because the tokens are not interchangeable.

Are Unity projects supported?

Currently, Alibaba Cloud provides a plugin only for uniapp. For other frameworks, such as Flutter, Swift, and RN, you must develop your own plugin to integrate the service.

Can one app have multiple verification plans?

Yes. Two plans can have the same Bundle ID.

What is the relationship between the acceleration API and the acquisition API?

You do not have to call the pre-fetch API (acceleration API). However, the pre-fetch must succeed for the authorization page to open. If you do not call the pre-fetch API in advance, the software development kit (SDK) automatically calls it when you invoke the getlogintoken API. This causes a noticeable delay before the authorization page appears. If you call the pre-fetch API in advance, the authorization page opens quickly.

Can I change the plan name and app name for Phone Number Verification Service?

A Phone Number Verification scheme ID cannot be modified after it is created. If your information changes or you need to add a new app, you must create a new scheme ID.

For more information, see Phone Number Verification Service.

Can I use virtual numbers?

Virtual numbers are not currently supported.

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 change only the background image.

How do I customize the UI on the authorization page?

You can add custom controls. On the authorization page, you can add custom controls to any area except the one-click logon area, the protocol area, and the mask area. To add a custom UI, use the customViewBlock callback. You must create, initialize, and add the view to its parent view on the main thread.

Can I customize the layout of the secondary authorization pop-up for the Phone Number Verification Service?

The secondary authorization pop-up is supported only when the authorization page is in full-screen mode. You can modify a UI element only if the SDK provides an API for that purpose.

Can I get a token using a custom authorization button?

No. You must use the built-in logon button. The pre-fetch mask, logon button, and carrier protocol sections of the authorization page do not support custom controls. However, other areas do support custom controls.

How do I determine which carrier's privacy protocol link to display?

The carrier protocol is displayed automatically on the authorization page. This is handled automatically. The protocol for the current carrier is shown by default.

Why are the image resources in ATAuthSDK.bundle from the iOS SDK not loading on the page?

To use the default images, you must import the bundle included with the SDK into your project.

NSString *path = [[NSBundle mainBundle] pathForResource:@"ATAuthSDK" ofType:@"bundle"];

NSBundle *bundle = [[NSBundle alloc] initWithPath:path];

How do I adjust the position of the privacy check box on the authorization page? Why is the check box not vertically centered with the privacy text after setting its width and height?

The protocol section supports only horizontal centering, not vertical centering. The text is top-aligned. You should align the top of the check box with the top of the text.

Is it possible to get the phone number before the user clicks the one-click logon button?

No. The one-click logon step cannot be skipped.

Can I perform custom development on the authorization page?

Yes. You can use custom controls to perform custom development.

Why is the failure rate high when the program starts for the first time?

When the program starts for the first time, network authorization issues may occur. If you call the API to open the authorization page directly at startup, a timeout may occur. To ensure the authorization page opens quickly, call the acceleration API first.

Why do I get error code 600015 when getting a token times out?

Check your phone's network connection. Error code 600015 indicates a timeout caused by a network exception. Test the connection using 4G mobile data with Wi-Fi turned off. You can also restart the network by turning airplane mode on and then off.

Why does logon to the Phone Number Verification Service fail with an invalid AccessCode parameter?

This can happen if a token is reused. Check your business logic to determine if a token is being reused or used after it has expired. The time-to-live (TTL) for a token is 10 minutes.

Why does the iOS client receive error 600017 when requesting the Phone Number Verification Service?

Error 600017 is usually caused by an incorrect package name, signature, or key. The key from the Plan Management page in the Phone Number Verification Service console must match the key used in your code.

Why does the one-click logon API return the error 'code:isv.ACCESS_CODE_ILLEGAL'?

This error indicates a token parsing failure. Ensure that you send the complete token obtained from the frontend to the backend for validation.

What should I do if the logon key fails?

Ensure that the Bundle ID and the key correspond correctly.

After upgrading the Phone Number Verification Service iOS SDK to the latest version, why do some API calls still return error 600004?

Problem cause: Starting with iOS 16.4, the CTCarrier feature was deprecated. This makes it impossible to directly obtain the carrier information for the current SIM card, and Apple did not provide an alternative. The latest version of the Phone Number Verification Service SDK uses IPv6 to determine the current carrier and cannot determine the carrier over an IPv4 connection. In certain compatibility scenarios, such as a gateway randomly assigning an IP address or converting an IPv6 address to an IPv4 address, the gateway may assign an IPv4 address. This can cause some API calls to fail and return error code 600004.

According to current carrier data, IPv6 addresses account for approximately 80% of connections. This issue may still occur at a low frequency even after you upgrade the SDK to the latest version.

Solution: The handling of error 600004 is optimized in version 2.12.15 and later of the Phone Number Verification Service SDK. First, ensure that you have upgraded your SDK to the latest version. If you still occasionally receive error 600004 after the update, use one of the following solutions based on your scenario:

  • For API debugging and testing: Toggle airplane mode or restart your phone to reset the network, and then try again.

  • For user and business scenarios: To improve the user experience, we recommend switching to another verification method after the error occurs.