diff --git a/lib_social/src/main/java/com/android/sdk/social/wechat/WeChatManager.java b/lib_social/src/main/java/com/android/sdk/social/wechat/WeChatManager.java index 76eb831..b29c8f5 100644 --- a/lib_social/src/main/java/com/android/sdk/social/wechat/WeChatManager.java +++ b/lib_social/src/main/java/com/android/sdk/social/wechat/WeChatManager.java @@ -31,7 +31,6 @@ public class WeChatManager { private static String sAppId; private static String sAppSecret; - private static WeChatShareCallback sWeChatShareCallback; /** * @param context 上下文 @@ -302,8 +301,7 @@ public class WeChatManager { // 分享 /////////////////////////////////////////////////////////////////////////// - public boolean share(WeChatShareInfo.ShareContent content, WeChatShareCallback shareCallback) { - sWeChatShareCallback = shareCallback; + public boolean share(WeChatShareInfo.ShareContent content) { try { SendMessageToWX.Req baseReq = WeChatShareInfo.buildReq(content); mWxApi.sendReq(baseReq); @@ -314,46 +312,22 @@ public class WeChatManager { } } - /** - * 微信分享回调 - * - * @param baseResp - */ private static void handleSendMessageResp(BaseResp baseResp) { switch (baseResp.errCode) { case BaseResp.ErrCode.ERR_OK: - if (sWeChatShareCallback != null) { - sWeChatShareCallback.onSuccess(); - } + //todo success break; case BaseResp.ErrCode.ERR_USER_CANCEL: - if (sWeChatShareCallback != null) { - sWeChatShareCallback.onCancel(); - } + //todo canceled break; case BaseResp.ErrCode.ERR_AUTH_DENIED: case BaseResp.ErrCode.ERR_SENT_FAILED: case BaseResp.ErrCode.ERR_UNSUPPORT: case BaseResp.ErrCode.ERR_COMM: case BaseResp.ErrCode.ERR_BAN: - if (sWeChatShareCallback != null) { - sWeChatShareCallback.onFailed(baseResp); - } + //todo error break; } } - public interface WeChatShareCallback { - - void onSuccess(); - - void onCancel(); - - void onFailed(BaseResp baseResp); - } - - public static void destroyShareCallback() { - if (sWeChatShareCallback != null) - sWeChatShareCallback = null; - } } \ No newline at end of file