Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ import cn.reactnative.modules.weibo.WeiboPackage;

```
manifestPlaceholders = [
WB_APPID: "微博的APPID" //在此修改微博APPID
WB_APPID: "微博的APPID" //在此修改微博APPID, like 'wb+APP_KEY'
]
```

Expand Down Expand Up @@ -186,3 +186,14 @@ config : {
imageUrl: 图片地址
}
```

```javascript
// 分享网页
{
type: 'news',
       title: 标题,
       description: 描述,
       imageUrl: 缩略图地址,   //缩略图大小限制32k一下
       webpageUrl: 网页地址
}
```
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
Binary file modified android/libs/arm64-v8a/libweibosdkcore.so
Binary file not shown.
Binary file modified android/libs/armeabi-v7a/libweibosdkcore.so
Binary file not shown.
Binary file modified android/libs/armeabi/libweibosdkcore.so
Binary file not shown.
Binary file modified android/libs/mips/libweibosdkcore.so
Binary file not shown.
Binary file modified android/libs/mips64/libweibosdkcore.so
Binary file not shown.
Binary file not shown.
Binary file modified android/libs/x86/libweibosdkcore.so
Binary file not shown.
Binary file modified android/libs/x86_64/libweibosdkcore.so
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);

}
Expand Down Expand Up @@ -249,18 +250,18 @@ 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)){
type = data.getString(RCTWBShareType);
}

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();
Expand Down Expand Up @@ -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();
Expand Down