BmobUser Class Reference

Inherits from BmobObject : NSObject
Declared in BmobUser.h

  username

用户名

@property (copy, nonatomic) NSString *username

Declared In

BmobUser.h

  password

密码

@property (copy, nonatomic) NSString *password

Declared In

BmobUser.h

  email

邮箱

@property (copy, nonatomic) NSString *email

Declared In

BmobUser.h

  mobilePhoneNumber

手机号码

@property (copy, nonatomic) NSString *mobilePhoneNumber

Declared In

BmobUser.h

+ query

查询用户表

+ (BmobQuery *)query

Return Value

创建用户表的查询

Declared In

BmobUser.h

– setUserName:

设置用户名
- (void)setUserName:(NSString *)username

Parameters

username

提供的用户名

Declared In

BmobUser.h

+ loginWithUsernameInBackground:password:

用户登陆

+ (void)loginWithUsernameInBackground:(NSString *)username password:(NSString *)password

Parameters

username

用户名

password

密码

Declared In

BmobUser.h

+ loginWithUsernameInBackground:password:block:

登陆后返回用户信息

+ (void)loginWithUsernameInBackground:(NSString *)username password:(NSString *)password block:(BmobUserResultBlock)block

Parameters

username

用户名

password

密码

block

是否成功登陆,若成功登陆返回用户信息

Declared In

BmobUser.h

+ logout

注销登陆账号,删除本地账号
+ (void)logout

Declared In

BmobUser.h

– signUpInBackground

后台注册
- (void)signUpInBackground

Declared In

BmobUser.h

– signUpInBackgroundWithBlock:

后台注册,返回注册结果
- (void)signUpInBackgroundWithBlock:(BmobBooleanResultBlock)block

Parameters

block

返回成功还是失败

Declared In

BmobUser.h

– verifyEmailInBackgroundWithEmailAddress:

邮件认证,在web端应用设置中又开启邮箱验证

- (void)verifyEmailInBackgroundWithEmailAddress:(NSString *)email

Parameters

email

邮箱地址

Declared In

BmobUser.h

+ requestPasswordResetInBackgroundWithEmail:

通过邮件设置密码
+ (void)requestPasswordResetInBackgroundWithEmail:(NSString *)email

Parameters

email

提供的邮件地址

Declared In

BmobUser.h

– userEmailVerified:

得到邮箱验证的结果

- (void)userEmailVerified:(BmobBooleanResultBlock)block

Parameters

block

邮箱验证的结果及其信息

Declared In

BmobUser.h

+ getCurrentObject

得到当前BmobUser
+ (BmobUser *)getCurrentObject

Return Value

返回BmobUser对象

Declared In

BmobUser.h

+ getCurrentUser

得到当前BmobUser
+ (BmobUser *)getCurrentUser

Return Value

返回BmobUser对象

Declared In

BmobUser.h

– updateCurrentUserPasswordWithOldPassword:newPassword:block:

利用旧密码重置新密码

- (void)updateCurrentUserPasswordWithOldPassword:(NSString *)oldPassword newPassword:(NSString *)newPassword block:(BmobBooleanResultBlock)block

Parameters

oldPassword

旧密码

newPassword

新密码

block

回调

Declared In

BmobUser.h

+ signUpInBackgroundWithAuthorDictionary:platform:block:

第三方授权登录后,在Bmob生成一个bmob用户

+ (void)signUpInBackgroundWithAuthorDictionary:(NSDictionary *)infoDictionary platform:(BmobSNSPlatform)platform block:(BmobUserResultBlock)block

Parameters

infoDictionary

授权信息,格式为@{@“access_token”:@“获取的token”,@“uid”:@“授权后获取的id”,@“expirationDate”:@“获取的过期时间(NSDate)”}

platform

新浪微博,或者腾讯qq

block

生成新的用户,跟结果信息

Declared In

BmobUser.h

+ loginInBackgroundWithAuthorDictionary:platform:block:

第三方授权登录后,在Bmob生成一个bmob用户

+ (void)loginInBackgroundWithAuthorDictionary:(NSDictionary *)infoDictionary platform:(BmobSNSPlatform)platform block:(BmobUserResultBlock)block

Parameters

infoDictionary

授权信息,格式为@{@“access_token”:@“获取的token”,@“uid”:@“授权后获取的id”,@“expirationDate”:@“获取的过期时间(NSDate)”}

platform

新浪微博,或者腾讯qq

block

生成新的用户,跟结果信息

Declared In

BmobUser.h

– linkedInBackgroundWithAuthorDictionary:platform:block:

登录用户关联第三方账号

- (void)linkedInBackgroundWithAuthorDictionary:(NSDictionary *)infoDictionary platform:(BmobSNSPlatform)platform block:(BmobBooleanResultBlock)block

Parameters

infoDictionary

授权信息,格式为@{@“access_token”:@“获取的token”,@“uid”:@“授权后获取的id”,@“expirationDate”:@“获取的过期时间(NSDate)”}

platform

新浪微博,或者腾讯qq

block

关联结果跟信息

Declared In

BmobUser.h

– cancelLinkedInBackgroundWithPlatform:block:

登录用户取消关联第三方账号

- (void)cancelLinkedInBackgroundWithPlatform:(BmobSNSPlatform)platform block:(BmobBooleanResultBlock)block

Parameters

platform

新浪微博,或者腾讯qq

block

取消关联结果跟信息

Declared In

BmobUser.h

+ signOrLoginInbackgroundWithMobilePhoneNumber:andSMSCode:block:

手机号码加验证码一键注册登录

+ (void)signOrLoginInbackgroundWithMobilePhoneNumber:(NSString *)phoneNumber andSMSCode:(NSString *)smsCode block:(BmobUserResultBlock)block

Parameters

phoneNumber

<#phoneNumber description#>

smsCode

<#smsCode description#>

Declared In

BmobUser.h

+ signOrLoginInbackgroundWithMobilePhoneNumber:SMSCode:andPassword:block:

手机号码加验证码一键注册登录并且设置用户密码

+ (void)signOrLoginInbackgroundWithMobilePhoneNumber:(NSString *)phoneNumber SMSCode:(NSString *)smsCode andPassword:(NSString *)password block:(BmobUserResultBlock)block

Parameters

phoneNumber

手机号

smsCode

验证码

password

用户密码

block

回调

Declared In

BmobUser.h

– signUpOrLoginInbackgroundWithSMSCode:block:

手机号码加验证码一键注册登录,并且可设置用户表的其它信息

- (void)signUpOrLoginInbackgroundWithSMSCode:(NSString *)smsCode block:(BmobBooleanResultBlock)block

Parameters

smsCode

验证码

Declared In

BmobUser.h

+ loginInbackgroundWithAccount:andPassword:block:

账号密码登录,账号可以为用户名、手机号或者邮箱

+ (void)loginInbackgroundWithAccount:(NSString *)account andPassword:(NSString *)password block:(BmobUserResultBlock)block

Parameters

account

<#account description#>

password

<#password description#>

block

<#block description#>

Declared In

BmobUser.h

+ loginInbackgroundWithMobilePhoneNumber:andSMSCode:block:

手机号码加验证码登录

+ (void)loginInbackgroundWithMobilePhoneNumber:(NSString *)phoneNumber andSMSCode:(NSString *)smsCode block:(BmobUserResultBlock)block

Parameters

phoneNumber

<#phoneNumber description#>

smsCode

<#smsCode description#>

Declared In

BmobUser.h

+ resetPasswordInbackgroundWithSMSCode:andNewPassword:block:

利用短信验证码重置帐号密码,只有填写手机号码的用户可用

+ (void)resetPasswordInbackgroundWithSMSCode:(NSString *)SMSCode andNewPassword:(NSString *)newPassword block:(BmobBooleanResultBlock)block

Parameters

block

<#block description#>

smscode

<#smscode description#>

phoneNumber

<#phoneNumber description#>

Declared In

BmobUser.h