# Mobile phone number real-time verification component

This capability is designed to help developers initiate mobile phone application to users, andMust be approved by the user, developers can obtain a mobile phone number verified by the platform, and then provide users with corresponding services.

This ability andMobile Phone Number Quick Verification ComponentThe difference is:

  1. Mobile phone number real-time verification module,On each request, the platform verifies the phone number selected by the user in real time.
  2. Mobile phone number quick verification component, the platform will verify the number, butDoes not guarantee real-time verification

Please note:

  1. The interface is currently targeted atNon-individual developers, and completed the certification of the Mini Program open (foreign entities are currently only open in some countries and regions,See the documentation
  2. When this ability is used, the user can choose to bind the number, or add the number independently. With each request, the platform will be based on the underlying capabilities such as SMS provided by China's three major operators.Real-time verification of numbers
  3. Ask developers to judge and choose whether to use according to the needs of business scenarios, and consider adding other security verification methods if necessary.
  4. Developers need to use it reasonably, if the user reports or is found the developer**Unreasonably **Requiring users to provide personal information such as mobile phone number interrupts the normal use process and affects the user's experience.WeChat has the right toWeChat Mini Program Platform Operation and Management SpecificationProcessing of this Mini ProgramCommon violations and specific analysis

# Dxplaination of charges

Starting from August 28, 2023, the mobile phone number real-time verification component will require payment for use. The standard unit price is: each component call success, charge 0.04 yuan. More package prices please see[WeChat Public Platform - Payment Management](https://mp.weixin.qq.com/cgi-bin/loginpage?redirect _url=/wxamp/wxacharge)。

Purchase Operation Guide

Frequently Asked Questions

Please note:

  1. Experience quota: Each Mini Program account will have 1000 experience quota for development, debugging and experience. The 1000 times of experience amount for the official version, the experience version and the development version of the Mini Program share, after the excess, the experience version and the development version of the Mini Program call with the official version of the Mini Program, are charged
  2. Resource Pack Validity: For orders purchased before August 28, 2023, the Resource Pack will take effect on August 28, 2023For orders purchased after 28 August 2023, the Resource Pack will take effect immediately upon successful payment.Each Resource Pack will be calculated according to the expiry date selected at the time of purchase.
  3. Resource Usage Order: By default, it is deducted from the experience amount first, and then deducted from the paid resource package after the deduction is completed.If there are more than one paid resource pack, the most recently expired resource pack will be deducted in chronological order of the resource pack expiration, and so on
  4. Refund Policy: If the purchase is incorrect and you have not officially started using the resource pack, you can apply for a refund within 7 days after the successful payment. The money will be returned from the original payment path within 3-5 working days.If the Resource Pack has already been used (once or more), you cannot request a refund.If no refund application has been initiated more than 7 days after the successful payment, no refund can be applied for.
  5. Exception investigation: If there is any doubt about the amount of calls, refer to theMobile Number Billing Error Troubleshooting GuideAnd run a sweep.

# Free rules

Mini Program that meets one of the following conditions, there is no charge for the use of this ability, as follows:

  1. accountWeChat Certification Body TypeSmall programs for government and non-profit organizations
  2. accountWeChat Certification Body TypeFor the public service unit, and the category is the government affairs people's livelihood small procedure
  3. Small programs for public medical institutions and academic education (schools)

Developers can query the WeChat certification subject type of the mini program in the following two ways:

  1. Get into[WeChat Official Platform](mp.weixin.qq .com )->Click on the Mini Program information ->View basic information ->WeChat Certification Body Type
  2. Get into[WeChat Official Platform](mp.weixin.qq .com )->Click on the top right corner account avatar ->Basic information can be viewed ->WeChat Certification Body Type

# Gathering mode

It aims to provide more efficient landing tools, support bulk procurement of resource packs, can be flexibly allocated to multiple Mini programs to use. Gathering mode[Access Guidelines](https://developers.weixin.qq.com/doc/oplatform /service_market/charge/Guide/intro.html)。

# Query and Charge Node Dxplaination

  • Query node: When the user clicks the button, the resource package quota is queried. If the query amount is insufficient, the developer will receive an error code. e.detail.errno===1400001 At the same time, the user side will receive the platform default half-screen prompt "This function has reached the current Mini Program limit and cannot be used for the time being." If the developer wants to be compatible with the default logic, it can be button In the componentphone-number-no-quota-toast The value of the falseAt this time, the platform will not be prompted on the user side
  • Chargeback Node: The developer gets bindgetphonenumber The event's success When the information is called back, it is deducted.

# Methods of Use

Step 1: The need to place button assembly open-type The value of the getRealtimePhoneNumber, when the user clicks and agrees, through the bindgetrealtimephonenumber Event to get callback information

Step 2: Will bindgetrealtimephonenumber Dynamic Token in Event CallbackCodeTo the developer background, and in the developer background call WeChat background provided by the [phonenumber.getPhoneNumber ](https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/phone number /phonenumber.getPhoneNumber .html) Interface, ConsumptionCodeIn exchange for a phone number. EachCodeIt is valid for 5 minutes and can only be consumed once.

Note:getRealtimePhoneNumber Returned Code and wx.login Returned Code The effect is different, can not be mixed.

Be careful

That capacity.bindgetrealtimephonenumber In the event callback, it returns only the Code, will not return encryptedDataandiv, the developer can only call the[phonenumber.getPhoneNumber ](https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/phone number /phonenumber.getPhoneNumber .html) Interface, Consumption CodeIn exchange for the user's phone number.

# Code Examples

<button open-type="getRealtimePhoneNumber"  bindgetrealtimephonenumber = "getrealtimephonenumber" ></button>
Page({
  getrealtimephonenumber  (e) {
    console.log(e.detail.code)  // Dynamic token
    console.log(e.detail.errMsg) // Callback information (returns on success or failure)
    console.log(e.detail.errno)  // Error code (returned on failure)
  }
})

# Return Parameter Dxplaination

parameter type Introductions Minimum version
Code String Dynamic token. The user's mobile phone number can be exchanged for a dynamic token. Details of how to use [phonenumber.getPhoneNumber ](https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/phone number /phonenumber.getPhoneNumber .html) interface