本文整理汇总了Java中com.twilio.accessmanager.AccessManager类的典型用法代码示例。如果您正苦于以下问题:Java AccessManager类的具体用法?Java AccessManager怎么用?Java AccessManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AccessManager类属于com.twilio.accessmanager包,在下文中一共展示了AccessManager类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AccessManager
import com.twilio.accessmanager.AccessManager; //导入依赖的package包/类
public static WritableMap AccessManager(AccessManager accessManager) {
WritableMap map = Arguments.createMap();
map.putString("token", accessManager.getToken());
map.putBoolean("isExpired", accessManager.isTokenExpired());
map.putString("expirationDate", accessManager.getTokenExpirationDate().toString());
return map;
}
示例2: onError
import com.twilio.accessmanager.AccessManager; //导入依赖的package包/类
@Override
public void onError(AccessManager twilioAccessManager, String s) {
WritableMap params = Arguments.createMap();
params.putString("error",s);
reactContext
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
.emit("accessManager:tokenInvalid",params);
}
示例3: onTokenExpired
import com.twilio.accessmanager.AccessManager; //导入依赖的package包/类
@Override
public void onTokenExpired(AccessManager accessManager) {
System.out.println("token expired.");
accessTokenFetcher.fetch(new TaskCompletionListener<String, String>() {
@Override
public void onSuccess(String token) {
ChatClientManager.this.accessManager.updateToken(token);
}
@Override
public void onError(String message) {
System.out.println("Error trying to fetch token: " + message);
}
});
}
示例4: accessManagerWithToken
import com.twilio.accessmanager.AccessManager; //导入依赖的package包/类
@ReactMethod
public void accessManagerWithToken(String token, Promise promise) {
RCTTwilioAccessManager tmp = RCTTwilioAccessManager.getInstance();
tmp.accessManager = new AccessManager(token, this);
promise.resolve(RCTConvert.AccessManager(tmp.accessManager));
}
示例5: updateToken
import com.twilio.accessmanager.AccessManager; //导入依赖的package包/类
@ReactMethod
public void updateToken(String token, Promise promise) {
RCTTwilioAccessManager tmp = RCTTwilioAccessManager.getInstance();
tmp.accessManager.updateToken(token);
promise.resolve(RCTConvert.AccessManager(tmp.accessManager));
}
示例6: onTokenExpired
import com.twilio.accessmanager.AccessManager; //导入依赖的package包/类
@Override
public void onTokenExpired(AccessManager twilioAccessManager) {
reactContext
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
.emit("accessManager:tokenExpired", null);
}
示例7: onTokenWillExpire
import com.twilio.accessmanager.AccessManager; //导入依赖的package包/类
@Override
public void onTokenWillExpire(AccessManager twilioAccessManager) {
reactContext
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
.emit("accessManager:tokenWillExpire", null);
}
示例8: createAccessManager
import com.twilio.accessmanager.AccessManager; //导入依赖的package包/类
private void createAccessManager(String token) {
this.accessManager = new AccessManager(token, this);
accessManager.addTokenUpdateListener(this);
}
示例9: onError
import com.twilio.accessmanager.AccessManager; //导入依赖的package包/类
@Override
public void onError(AccessManager accessManager, String s) {
System.out.println("token error: " + s);
}
示例10: onTokenWillExpire
import com.twilio.accessmanager.AccessManager; //导入依赖的package包/类
@Override
public void onTokenWillExpire(AccessManager accessManager) {
}