本文整理匯總了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) {
}