当前位置: 首页>>代码示例>>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;未经允许,请勿转载。