public class AVOSCloud extends Object
| Modifier and Type | Method and Description |
|---|---|
static int |
getNetworkTimeout()
Returns the network timeout in milliseconds.It's 15 seconds by default.
|
static Date |
getServerDate()
获取服务器端当前时间
|
static void |
getServerDateInBackground(com.avos.avoscloud.callback.AVServerDateCallback callback)
获取服务器端当前时间
|
static void |
initialize(String applicationId,
String clientKey,
String masterKey)
Authenticates this client as belonging to your application.
|
static boolean |
isDebugLogEnabled() |
static void |
requestSMSCode(String phone)
请求发送短信验证码
短信示范为: 您正在{应用名称}中进行短信验证,您的验证码是:{Code},请输入完整验证,有效期为:10分钟
|
static void |
requestSMSCode(String phone,
String templateName,
Map<String,Object> env)
通过短信模板来发送短信验证码
|
static void |
requestSMSCode(String phone,
String name,
String op,
int ttl)
请求发送短信验证码
短信示范为: 您正在{name}中进行{op},您的验证码是:{Code},请输入完整验证,有效期为:{ttl}
|
static void |
requestVoiceCode(String phoneNumber)
请求发送语音验证码,验证码会以电话形式打给目标手机
|
static void |
setDebugLogEnabled(boolean enable) |
static void |
setNetworkTimeout(int timeoutInMills)
Set network timeout in milliseconds.default is 10 seconds.
|
static void |
setShouldUseMasterKey(boolean should) |
static boolean |
showInternalDebugLog() |
static void |
useAVCloudCN() |
static void |
useAVCloudUS() |
static void |
verifyCode(String code,
String mobilePhoneNumber)
验证验证码
|
static void |
verifySMSCode(String code,
String mobilePhoneNumber)
验证验证码
|
public static void setNetworkTimeout(int timeoutInMills)
timeoutInMills - 超时时间public static int getNetworkTimeout()
public static void initialize(String applicationId, String clientKey, String masterKey)
Authenticates this client as belonging to your application. This must be called before your application can use the AVOSCloud library. The recommended way is to put a call to AVOSCloud.initialize in each of your onCreate methods. An example:
applicationId - The application id provided in the AVOSCloud dashboard.clientKey - The client key provided in the AVOSCloud dashboard.masterKey - The master key provided in the AVOSCloud dashboard.public static void useAVCloudUS()
public static void useAVCloudCN()
public static boolean showInternalDebugLog()
public static void setDebugLogEnabled(boolean enable)
public static boolean isDebugLogEnabled()
public static void requestSMSCode(String phone, String name, String op, int ttl) throws com.avos.avoscloud.AVException
phone - 目标手机号码(必选)name - 应用名,值为null 则默认是您的应用名op - 验证码的目标操作,值为null,则默认为“短信验证”ttl - 验证码过期时间,单位分钟。如果是0,则默认为10分钟AVException - 发送短信异常public static void requestSMSCode(String phone, String templateName, Map<String,Object> env) throws com.avos.avoscloud.AVException
phone - 目标手机号码(必选)templateName - 短信模板名称env - 需要注入的变量envAVException - 发送短信异常public static void requestSMSCode(String phone) throws com.avos.avoscloud.AVException
phone - 目标手机号码AVException - 发送短信异常public static void requestVoiceCode(String phoneNumber) throws com.avos.avoscloud.AVException
phoneNumber - 目标手机号AVException - 发送短信异常public static void verifySMSCode(String code, String mobilePhoneNumber) throws com.avos.avoscloud.AVException
code - 验证码mobilePhoneNumber - 手机号码AVException - 发送短信异常public static void verifyCode(String code, String mobilePhoneNumber) throws com.avos.avoscloud.AVException
code - 验证码mobilePhoneNumber - 手机号码AVException - 发送短信异常public static Date getServerDate() throws com.avos.avoscloud.AVException
AVException - 发送短信异常public static void getServerDateInBackground(com.avos.avoscloud.callback.AVServerDateCallback callback)
callback - 获取时间回调public static void setShouldUseMasterKey(boolean should)
Copyright © 2017. All rights reserved.