Loading…

SMS verification code

# Knowledge point review When sending SMS verification codes, usually in order to prevent text message bombing and robots from frequently obtaining SMS verification codes, when entering a mobile phone number to obtain text messages, it is necessary to identify the graphic verification code. Only when the correct graphic verification code is entered, the system will consider that it is not a robot or maliciously obtain the SMS verification code. **Of course, this is not necessary. You can also disable the graphic verification code verification function in the background SMS channel settings** ["Using apifm plug-in for Flutter cloud development - graphical verification code"](https://www.yuque.com/apifm/doc/hg511q) # Function description In many security situations, it is necessary to use the SMS verification code function to ensure that the operator is himself; Generally, apps will use the method of “mobile phone number + SMS verification code” to implement user registration/login; When you forget your password, you usually use “mobile phone number + SMS verification code” to reset your login password; # Preparation 1. Apply for SMS verification code sending channel _To be able to actually send SMS verification codes, you need to open the SMS channel first. There are currently many platforms where you can apply for (free trial) SMS channels; "apifm-wxapi" supports the following SMS operators. You can generally get the number of free trial SMS messages after registering an account: Alibaba Cloud, Tencent Cloud, Shiyuan Technology, Saiyou Cloud Communication, Chuangrui, Yunzhixun, Bami Technology, Shanghai Zhutong_ **If you have special needs, please leave a message and we will add support for new SMS operators for you** #Backend configuration ## Activate and log in to the free developer backend ["Using apifm plug-in for Flutter cloud development - Installation"](https://www.yuque.com/apifm/doc/hggphs) ## Turn on the "SMS Verification Code" module Log in to the "First Step" registration background, left menu --> Factory settings --> Module management Find the "SMS Verification Code" module, click "Enable Module", then F5 to refresh the background interface, you will see the new menu: "SMS Settings" -> "Verification Code Settings"; ## Configure SMS channel Click the "Verification Code Settings" menu above, and click to enter the configuration according to the operator of the SMS channel you applied for; After the correct configuration, you can continue to the next chapter and experience sending text messages; _The left menu "SMS Settings" -> "SMS Records" records in detail the SMS sending records of each time the SMS verification code is obtained, so as to prepare for subsequent inquiries when necessary;_ # apifm usage instructions ## Get verification code (send SMS) ```javascript Apifm.smsValidateCode(String mobile, [String key, String picCode]) ``` The SMS verification code is automatically sent to the corresponding mobile phone number; When the backend is set to enable graphic verification code verification when sending SMS verification codes, the key and picCode parameters must be passed, otherwise there is no need to pass them; key and picCode parameters, please refer to the instructions for using the graphic verification code ## Verify whether the input verification code is correct ```javascript Apifm.smsValidateCodeCheck(String mobile, String code) ``` code is the verification code received on the user’s mobile phone **Reading thousands of books is not as good as traveling thousands of miles! Write your own helloworld and put knowledge in your pocket! ** _Looking forward to you becoming my boss~_