帮助与文档

> >

1.优化提交用户资料API

在提交验证码的方法回调里我们多增加了一个用户资料的回调,如下图:

D9E92B4D-842A-4F60-A07B-7B2F10907A99

 

0F764F83-8E27-4B1F-B47A-AB52AB4D6A3F

 

调用的时候可以这样实现:

 [SMSSDK commitVerificationCode:self.verifyCodeField.text phoneNumber:_phone zone:_areaCode result:^(SMSSDKUserInfo *userInfo, NSError *error) {

            {
                if (!error)
                {
                    userInfo.nickname = @"David";
                    userInfo.uid = @"010";
                    userInfo.avatar = @"www.mob.com";
                    NSLog(@"验证成功");
                    verifyError = error;
                    NSString* str = [NSString stringWithFormat:NSLocalizedStringFromTableInBundle(@"verifycoderightmsg", @"Localizable", _bundle, nil)];
                    UIAlertView* alert = [[UIAlertView alloc] initWithTitle:NSLocalizedStringFromTableInBundle(@"verifycoderighttitle", @"Localizable", _bundle, nil)
                                                                    message:str
                                                                   delegate:self
                                                          cancelButtonTitle:NSLocalizedStringFromTableInBundle(@"sure", @"Localizable", _bundle, nil)
                                                          otherButtonTitles:nil, nil];
                    [alert show];
                    alert.tag = COMMITCODE_SUCCES_ALERTVIEW_TAG;
                }
                else
                {
                    NSLog(@"验证失败");
                    NSString *messageStr = [NSString stringWithFormat:@"%zidescription",error.code];
                    UIAlertView* alert = [[UIAlertView alloc] initWithTitle:NSLocalizedStringFromTableInBundle(@"verifycodeerrortitle", @"Localizable", _bundle, nil)
                                                                    message:NSLocalizedStringFromTableInBundle(messageStr, @"Localizable", _bundle, nil)
                                                                   delegate:self
                                                          cancelButtonTitle:NSLocalizedStringFromTableInBundle(@"sure", @"Localizable", _bundle, nil)
                                                          otherButtonTitles:nil, nil];
                    [alert show];
                }
            }

        }];

 直接在成功回调里提交用户的资料,当然这个不是必须的,如果不需要获取通讯录好友的话,可以不提交用户资料