Exemplo n.º 1
0
 /**
  * 授权微信
  *
  * @param context context
  */
 public static void oauthWeChat(Context context) {
   if (!TextUtils.isEmpty(info.getWechatAppId())
       && !TextUtils.isEmpty(info.getWeChatAppSecret())) {
     SocialInfoKeeper.writeSocialInfo(context, info);
     SocialSSOProxy.loginWeChat(context, info);
   }
 }
Exemplo n.º 2
0
 /**
  * 初始化微信,微博,QQ三个平台信息
  *
  * @param weChatId 微信id
  * @param weChatSecret 微信 secret
  * @param weiboKey 微博 id
  * @param weiboRedirectUrl 微博回调地址
  * @param qqId QQ id
  */
 public static void init(
     String weChatId, String weChatSecret, String weiboKey, String weiboRedirectUrl, String qqId) {
   info.setWechatAppId(weChatId);
   info.setWeChatAppSecret(weChatSecret);
   info.setWeiboAppKey(weiboKey);
   info.setWeiboRedirectrUrl(weiboRedirectUrl);
   info.setQqAppId(qqId);
 }
Exemplo n.º 3
0
 /**
  * 初始化QQ
  *
  * @param id app id
  */
 public static void initQQ(String id) {
   info.setQqAppId(id);
 }
Exemplo n.º 4
0
 /**
  * 初始化微博
  *
  * @param key app key
  * @param redirectUrl 服务器回调地址
  * @param scope oauth权限
  */
 public static void initWeibo(String key, String redirectUrl, String scope) {
   info.setWeiboAppKey(key);
   info.setWeiboRedirectrUrl(redirectUrl);
   info.setWeiboScope(scope);
 }
Exemplo n.º 5
0
 /**
  * 初始化微博
  *
  * @param key app key
  */
 public static void initWeibo(String key) {
   info.setWeiboAppKey(key);
 }
Exemplo n.º 6
0
 /**
  * 初始化微信
  *
  * @param id app id
  * @param secret 密钥
  * @param scope oauth权限
  */
 public static void initWeChat(String id, String secret, String scope) {
   info.setWechatAppId(id);
   info.setWeChatAppSecret(secret);
   info.setWeChatScope(scope);
 }
Exemplo n.º 7
0
 /**
  * 判断是否是debug模式
  *
  * @return 是否debug
  */
 public static boolean isDebugModel() {
   return info.isDebugMode();
 }
Exemplo n.º 8
0
 /**
  * QQ授权
  *
  * @param context context
  */
 public static void oauthQQ(Context context) {
   if (!TextUtils.isEmpty(info.getQqAppId())) {
     SocialInfoKeeper.writeSocialInfo(context, info);
     SocialSSOProxy.loginQQ(context, info);
   }
 }
Exemplo n.º 9
0
 /**
  * 设置调试模式
  *
  * @param debug 是否调试模式
  */
 public static void setDebugMode(boolean debug) {
   info.setDebugMode(debug);
 }
Exemplo n.º 10
0
 /**
  * 微博授权
  *
  * @param context context
  */
 public static void oauthWeibo(Context context) {
   if (!TextUtils.isEmpty(info.getWeiboAppKey())) {
     SocialInfoKeeper.writeSocialInfo(context, info);
     SocialSSOProxy.loginWeibo(context, info);
   }
 }
Exemplo n.º 11
0
 /**
  * 初始化QQ
  *
  * @param id app id
  * @param scope oauth权限范围
  */
 public static void initQQ(String id, String scope) {
   info.setQqAppId(id);
   info.setQqScope(scope);
 }