美文网首页
leancloud (存储,短信验证)

leancloud (存储,短信验证)

作者: 孟维学 | 来源:发表于2016-07-22 12:03 被阅读99次

    #import"ViewController.h"

    #import

    #import

    @interfaceViewController()

    @property(weak,nonatomic)IBOutletUITextField*textfield;

    @end

    @implementationViewController

    - (void)viewDidLoad {

    [superviewDidLoad];

    //保存

    AVObject*post=[AVObjectobjectWithClassName:@"Post"];

    [postsetObject:@"wei"forKey:@"haha"];

    [postsetObject:@"meng"forKey:@"heihei"];

    [postsetObject:@"xue"forKey:@"woyun"];

    [postsave];

    //检索

    AVQuery*query=[AVQueryqueryWithClassName:@"Post"];

    AVObject*post1=[querygetObjectWithId:@"45iit23sx8hr6ev1jyf97yc47j7xjn9kblf4sqsb6uj40tg9"];

    NSString*s1=[post1objectForKey:@"heihei"];

    NSLog(@"%@",s1);

    [postdeleteInBackground];

    }

    //请求验证码

    - (IBAction)sendpassword:(id)sender {

    [AVOSCloud requestSmsCodeWithPhoneNumber:@"13240109524"appName:@"秒"operation:@"注册"timeToLive:10callback:^(BOOLsucceeded, NSError *error) {

    if(succeeded) {

    NSLog(@"成功");

    }

    if(error) {

    NSLog(@"error");

    }

    }];

    }

    //验证验证码

    - (IBAction)sendmessage:(id)sender {

    [AVOSCloud verifySmsCode:self.textfield.text mobilePhoneNumber:@"13240109524"callback:^(BOOLsucceeded, NSError *error) {

    if(succeeded) {

    NSLog(@"验证成功");

    }

    }];

    }

    - (IBAction)message:(id)sender {

    }

    - (void)didReceiveMemoryWarning {

    [superdidReceiveMemoryWarning];

    // Dispose of any resources that can be recreated.

    }

    @end

    相关文章

      网友评论

          本文标题:leancloud (存储,短信验证)

          本文链接:https://www.haomeiwen.com/subject/xldijttx.html