當前位置: 首頁>>代碼示例>>Java>>正文


Java AccessManager類代碼示例

本文整理匯總了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;
}
 
開發者ID:ccm-innovation,項目名稱:react-native-twilio-chat,代碼行數:10,代碼來源:RCTConvert.java

示例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);
}
 
開發者ID:ccm-innovation,項目名稱:react-native-twilio-chat,代碼行數:9,代碼來源:RCTTwilioAccessManager.java

示例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);
    }
  });
}
 
開發者ID:TwilioDevEd,項目名稱:twiliochat-android,代碼行數:16,代碼來源:ChatClientManager.java

示例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));
}
 
開發者ID:ccm-innovation,項目名稱:react-native-twilio-chat,代碼行數:7,代碼來源:RCTTwilioAccessManager.java

示例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));
}
 
開發者ID:ccm-innovation,項目名稱:react-native-twilio-chat,代碼行數:7,代碼來源:RCTTwilioAccessManager.java

示例6: onTokenExpired

import com.twilio.accessmanager.AccessManager; //導入依賴的package包/類
@Override
public void onTokenExpired(AccessManager twilioAccessManager) {
    reactContext
            .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
            .emit("accessManager:tokenExpired", null);
}
 
開發者ID:ccm-innovation,項目名稱:react-native-twilio-chat,代碼行數:7,代碼來源:RCTTwilioAccessManager.java

示例7: onTokenWillExpire

import com.twilio.accessmanager.AccessManager; //導入依賴的package包/類
@Override
public void onTokenWillExpire(AccessManager twilioAccessManager) {
    reactContext
            .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
            .emit("accessManager:tokenWillExpire", null);
}
 
開發者ID:ccm-innovation,項目名稱:react-native-twilio-chat,代碼行數:7,代碼來源:RCTTwilioAccessManager.java

示例8: createAccessManager

import com.twilio.accessmanager.AccessManager; //導入依賴的package包/類
private void createAccessManager(String token) {
  this.accessManager = new AccessManager(token, this);
  accessManager.addTokenUpdateListener(this);
}
 
開發者ID:TwilioDevEd,項目名稱:twiliochat-android,代碼行數:5,代碼來源:ChatClientManager.java

示例9: onError

import com.twilio.accessmanager.AccessManager; //導入依賴的package包/類
@Override
public void onError(AccessManager accessManager, String s) {
  System.out.println("token error: " + s);
}
 
開發者ID:TwilioDevEd,項目名稱:twiliochat-android,代碼行數:5,代碼來源:ChatClientManager.java

示例10: onTokenWillExpire

import com.twilio.accessmanager.AccessManager; //導入依賴的package包/類
@Override
public void onTokenWillExpire(AccessManager accessManager) {

}
 
開發者ID:TwilioDevEd,項目名稱:twiliochat-android,代碼行數:5,代碼來源:ChatClientManager.java


注:本文中的com.twilio.accessmanager.AccessManager類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。