Returns the user privacy authorization result (uploadPrivacyPermissionStatus)

 /**
 上传隐私协议授权状态
 @param isAgree 是否同意(用户授权后的结果)
 @param OnResult 执行回调结果,可为nil (注意业务逻辑不要依赖于这个success结果,建议业务逻辑在调用这个接口之后来写)
 */
+ (void)uploadPrivacyPermissionStatus:(BOOL)isAgree
                                                 onResult:(void (^_Nullable)(BOOL success))handler;

sample code

 #import <MOBFoundation/MobSDK+Privacy.h>
[MobSDK uploadPrivacyPermissionStatus:YES onResult:^(BOOL success) {
}];

Request SMS Verification Code (getVerificationCodeByMethod)

 /**
 *  @from                    v3.1.0
 *  @brief                   获取验证码(Get verification code)
 *
 *  @param method            获取验证码的方法(枚举值:SMSGetCodeMethodSMS 文本短信方式 SMSGetCodeMethodVoice 语音验证码)
 *  @param phoneNumber       电话号码(The phone number)
 *  @param zone              区域号,不要加"+"号(Area code)
 *  @param tmpCode           模板id(template id)
 *  @param result            请求结果回调(Results of the request)
 */
+ (void) getVerificationCodeByMethod:(SMSGetCodeMethod)method
                                      phoneNumber:(NSString *)phoneNumber
                                                     zone:(NSString *)zone
                                               template:(NSString *)tmpCode
                                                    result:(SMSGetCodeResultHandler)result;

sample code

 #import <SMS_SDK/SMSSDK.h>
  //template参数不能乱填,没有可以先传""或者nil,SMSGetCodeMethodSMS文本短信方式 SMSGetCodeMethodVoice 语音验证码
  [SMSSDK getVerificationCodeByMethod:SMSGetCodeMethodSMS phoneNumber:@"XXXXXXXXXXX" zone:@"86" template:@"" result:^(NSError *error) {
        if (!error)
        {
            // 请求成功
        }
        else
        {
            // error
        }
    }];

Note:
The template id is added in the SMS template under the SMSSDK product in the background of the official website (you need to apply for an application with a custom SMS signature to add a SMS template)

Submit Verification Code (commitVerificationCode)

 /**
 * @from                    v1.1.1
 * @brief                   提交验证码(Commit the verification code)
 *
 * @param code              验证码(Verification code)
 * @param phoneNumber       电话号码(The phone number)
 * @param zone              区域号,不要加"+"号(Area code)
 * @param result            请求结果回调(Results of the request)
 */
+ (void) commitVerificationCode:(NSString *)code
                            phoneNumber:(NSString *)phoneNumber
                                           zone:(NSString *)zone
                                          result:(SMSCommitCodeResultHandler)result;

sample code

 [SMSSDK commitVerificationCode:@"XXXX" phoneNumber:@"XXXXXXXXXXX" zone:@"86"result:^(NSError *error) {
        if (!error)
        {
            // 验证成功
        }
        else
        {
            // error
        }
    }];

**Note: You must re-customize your signature. The default signature is only used for testing and does not guarantee the arrival rate. Please be sure to apply for a custom signature before going online.

Request Mobile Number Authentication Token

 /**

*  @brief                   请求手机号码认证Token
   *
*  @param handler           请求结果回调(Results of the request)
   */

+ (void) getMobileAuthTokenWith:(SMSSDKMobileAuthTokenResultHandler)handler;

/**

 * @brief 请求本机认证Token结果回调
 * @param model 包含token的具体信息
 * @param error 为空时表示请求成功
   */
   typedef void(^SMSSDKMobileAuthTokenResultHandler)(SMSSDKAuthToken *model, NSError *error);

sample code

 [SMSSDK getMobileAuthTokenWith:^(SMSSDKAuthToken *model, NSError *error) {}

Verify phone number

 /**
*  @brief                   验证手机号
   *
*  @param phoneNum          电话号码(The phone number)
*  @param tokenInfo         SDK返回的SMSSDKAuthToken Model
*  @param completion        请求结果回调(Results of the request)
   */

+ (void) verifyMobileWithPhone:(NSString *)phoneNum
                                         token:(SMSSDKAuthToken *)tokenInfo
                                completion:(SMSSDKMobileVerifyResultHandler)completion;

/**

* @brief 手机号码验证结果回调
* @param isValid 是否验证成功 YES成功 NO失败
* @param error 为空时表示请求成功
  */
  typedef void(^SMSSDKMobileVerifyResultHandler)(BOOL isValid, NSError *error);

sample code

 [SMSSDK verifyMobileWithPhone:@"XXXX"
                                              token:@"XXXX"
                                     completion:^(BOOL isValid, NSError *error) {}

a. The user can obtain the local authentication token, mobToken and operator of the corresponding operator through the getMobileAuthTokenWith method

b. The user can verify whether the input number is the phone number by passing the mobile phone number and the token information obtained in step a to the verifyMobileWithPhone:token:completion: method.


中关村科金
136 声望13 粉丝

北京中关村科金技术有限公司(简称“中关村科金”)是国内领先的对话式AI技术解决方案提供商,成立于2014年,注册资本14亿元,总部位于北京,在上海、重庆、深圳、杭州、成都等地设有分支机构,公司规模近千人,其...