diff --git a/README.md b/README.md index 5579894..89251be 100644 --- a/README.md +++ b/README.md @@ -120,7 +120,7 @@ import cn.reactnative.modules.weibo.WeiboPackage; ``` manifestPlaceholders = [ - WB_APPID: "微博的APPID" //在此修改微博APPID + WB_APPID: "微博的APPID" //在此修改微博APPID, like 'wb+APP_KEY' ] ``` @@ -186,3 +186,14 @@ config : { imageUrl: 图片地址 } ``` + +```javascript +// 分享网页 +{ + type: 'news', +        title: 标题, +        description: 描述, +        imageUrl: 缩略图地址,   //缩略图大小限制32k一下 +        webpageUrl: 网页地址 +} +``` diff --git a/android/build.gradle b/android/build.gradle index 0742261..62b5a97 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -22,6 +22,6 @@ android { } dependencies { + compile fileTree(dir: "libs", include: ["*.jar"]) compile 'com.facebook.react:react-native:+' - compile files('libs/weiboSDKCore_3.1.2.jar') } diff --git a/android/libs/arm64-v8a/libweibosdkcore.so b/android/libs/arm64-v8a/libweibosdkcore.so index 55e496d..94a4567 100755 Binary files a/android/libs/arm64-v8a/libweibosdkcore.so and b/android/libs/arm64-v8a/libweibosdkcore.so differ diff --git a/android/libs/armeabi-v7a/libweibosdkcore.so b/android/libs/armeabi-v7a/libweibosdkcore.so index 4f22781..a9495b6 100755 Binary files a/android/libs/armeabi-v7a/libweibosdkcore.so and b/android/libs/armeabi-v7a/libweibosdkcore.so differ diff --git a/android/libs/armeabi/libweibosdkcore.so b/android/libs/armeabi/libweibosdkcore.so index 94192f9..2d8fdf9 100755 Binary files a/android/libs/armeabi/libweibosdkcore.so and b/android/libs/armeabi/libweibosdkcore.so differ diff --git a/android/libs/mips/libweibosdkcore.so b/android/libs/mips/libweibosdkcore.so index 91cf505..8e22226 100755 Binary files a/android/libs/mips/libweibosdkcore.so and b/android/libs/mips/libweibosdkcore.so differ diff --git a/android/libs/mips64/libweibosdkcore.so b/android/libs/mips64/libweibosdkcore.so index 03d2808..d495237 100755 Binary files a/android/libs/mips64/libweibosdkcore.so and b/android/libs/mips64/libweibosdkcore.so differ diff --git a/android/libs/weiboSDKCore_3.1.2.jar b/android/libs/weiboSDKCore_3.1.4.jar similarity index 70% rename from android/libs/weiboSDKCore_3.1.2.jar rename to android/libs/weiboSDKCore_3.1.4.jar index b9e5bb6..b2d7906 100755 Binary files a/android/libs/weiboSDKCore_3.1.2.jar and b/android/libs/weiboSDKCore_3.1.4.jar differ diff --git a/android/libs/x86/libweibosdkcore.so b/android/libs/x86/libweibosdkcore.so index 4134bd5..44f794d 100755 Binary files a/android/libs/x86/libweibosdkcore.so and b/android/libs/x86/libweibosdkcore.so differ diff --git a/android/libs/x86_64/libweibosdkcore.so b/android/libs/x86_64/libweibosdkcore.so index 8d349d5..a8776bb 100755 Binary files a/android/libs/x86_64/libweibosdkcore.so and b/android/libs/x86_64/libweibosdkcore.so differ diff --git a/android/src/main/java/cn/reactnative/modules/weibo/WeiboModule.java b/android/src/main/java/cn/reactnative/modules/weibo/WeiboModule.java index 9f2797e..da8be4d 100644 --- a/android/src/main/java/cn/reactnative/modules/weibo/WeiboModule.java +++ b/android/src/main/java/cn/reactnative/modules/weibo/WeiboModule.java @@ -56,6 +56,7 @@ import com.sina.weibo.sdk.auth.WeiboAuthListener; import com.sina.weibo.sdk.auth.sso.SsoHandler; import com.sina.weibo.sdk.exception.WeiboException; +import com.sina.weibo.sdk.utils.Utility; import java.util.Date; @@ -77,7 +78,7 @@ public WeiboModule(ReactApplicationContext reactContext) { if (!appInfo.metaData.containsKey("WB_APPID")){ throw new Error("meta-data WB_APPID not found in AndroidManifest.xml"); } - this.appId = appInfo.metaData.get("WB_APPID").toString(); + this.appId = appInfo.metaData.getString("WB_APPID"); this.appId = this.appId.substring(2); } @@ -249,11 +250,6 @@ private void _share(ReadableMap data, Bitmap bitmap) { this.registerShare(); WeiboMultiMessage weiboMessage = new WeiboMultiMessage();//初始化微博的分享消息 - TextObject textObject = new TextObject(); - if (data.hasKey(RCTWBShareText)) { - textObject.text = data.getString(RCTWBShareText); - } - weiboMessage.textObject = textObject; String type = RCTWBShareTypeNews; if (data.hasKey(RCTWBShareType)){ @@ -261,6 +257,11 @@ private void _share(ReadableMap data, Bitmap bitmap) { } if (type.equals(RCTWBShareTypeText)) { + TextObject textObject = new TextObject(); + if (data.hasKey(RCTWBShareText)) { + textObject.text = data.getString(RCTWBShareText); + } + weiboMessage.textObject = textObject; } else if (type.equals(RCTWBShareTypeImage)) { ImageObject imageObject = new ImageObject(); @@ -301,7 +302,7 @@ else if (type.equals(RCTWBShareTypeAudio)) { if (bitmap != null) { weiboMessage.mediaObject.setThumbImage(bitmap); } - weiboMessage.mediaObject.identify = new Date().toString(); + weiboMessage.mediaObject.identify = Utility.generateGUID(); } SendMultiMessageToWeiboRequest request = new SendMultiMessageToWeiboRequest();