Skip to content

Commit

Permalink
Merge pull request #18 from jpush/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
KenChoi1992 authored Oct 27, 2017
2 parents 8534f21 + 350528e commit 9495f8e
Show file tree
Hide file tree
Showing 21 changed files with 59 additions and 13 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ react-native link
- [Checkout configuration](./docs/AndroidConfig.md)
- [Add JSharePackage, Don't forget the parameters !](./docs/JSharePackage.md)
- [Checkout AndroidManifest](./docs/AndroidManifest.md)
- [Add JGShareSDK.xml](./docs/JGShareSDK.md)
- [Add WXEntryActivity](./docs/WXEntryActivity.md)

That's it.
Expand Down
Binary file removed android/libs/jshare-android-1.2.1.jar
Binary file not shown.
Binary file added android/libs/jshare-android-1.3.0.jar
Binary file not shown.
Binary file added android/libs/jshare-facebook-android-1.3.0.jar
Binary file not shown.
Binary file removed android/libs/jshare-qq-android-1.2.1.jar
Binary file not shown.
Binary file added android/libs/jshare-qq-android-1.3.0.jar
Binary file not shown.
Binary file removed android/libs/jshare-sina-android-1.2.1.jar
Binary file not shown.
Binary file added android/libs/jshare-sina-android-1.3.0.jar
Binary file not shown.
Binary file removed android/libs/jshare-wechat-android-1.2.1.jar
Binary file not shown.
Binary file added android/libs/jshare-wechat-android-1.3.0.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public void onComplete(Platform platform, int action, BaseResponseInfo data) {
String openId = ((UserInfo) data).getOpenid(); //openid
String name = ((UserInfo) data).getName(); //昵称
String imageUrl = ((UserInfo) data).getImageUrl(); //头像url
int gender = ((UserInfo) data).getGenter();//性别, 1表示男性;2表示女性
int gender = ((UserInfo) data).getGender();//性别, 1表示男性;2表示女性
//个人信息原始数据,开发者可自行处理
String originData = data.getOriginData();
WritableMap writableMap = Arguments.createMap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public List<NativeModule> createNativeModules(ReactApplicationContext reactConte
});
}

@Override
public List<Class<? extends JavaScriptModule>> createJSModules() {
return Collections.emptyList();
}
Expand Down
34 changes: 34 additions & 0 deletions docs/JGShareSDK.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## 配置 JGShareSDK.xml

无论是使用自动集成还是手动集成方式,都需要配置 JGShareSDK.xml。 主要步骤为:
复制或者新建 JGShareSDK.xml 到工程目录的 asset 目录下。
把 JGShareSDK.xml 中相关的 AppKey、AppSecret 替换成自己在第三方平台创建的应用得到的信息。
根据需要配置各个平台,不需要的平台可以删除。

JGShareSDK.xml示例
```
<?xml version="1.0" encoding="utf-8"?>
<DevInfor>
<!-- 如果不需要支持某平台,可缺省该平台的配置-->
<SinaWeibo
AppKey="新浪微博的 AppKey"
AppSecret="新浪微博 AppSecret"
RedirectUrl="微博开放平台填写的授权回调页"/>
<QQ
AppId="QQ 的 AppId"
AppKey="QQ 的 AppKey"/>
<Wechat
AppId="微信的 AppId"
AppSecret="微信的 AppSectet"/>
<Facebook
AppId="facebook 的 appId"
AppName="facebook 后台填写的名称"
/>
</DevInfor>
```
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ buildscript {
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha4'
classpath 'com.android.tools.build:gradle:3.0.0-beta2'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
4 changes: 2 additions & 2 deletions example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Jul 06 15:08:47 CST 2017
#Tue Sep 12 16:45:56 CST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-rc-1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-rc-1-all.zip
10 changes: 10 additions & 0 deletions example/ios/jshare.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,15 @@
name = Frameworks;
sourceTree = "<group>";
};
625969F61F8A0FC300D3EB67 /* Recovered References */ = {
isa = PBXGroup;
children = (
1F258CF97D3D4E2EB8216E98 /* libRCTJShareModule.a */,
E853780E10334DF8A54B2F6A /* libRCTJCoreModule.a */,
);
name = "Recovered References";
sourceTree = "<group>";
};
62CBDE261F274A0D00C1C703 /* Products */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -569,6 +578,7 @@
00E356EF1AD99517003FC87E /* jshareTests */,
83CBBA001A601CBA00E9B192 /* Products */,
62482E6F1F1DFAC2009C9996 /* Frameworks */,
625969F61F8A0FC300D3EB67 /* Recovered References */,
);
indentWidth = 2;
sourceTree = "<group>";
Expand Down
8 changes: 4 additions & 4 deletions ios/RCTJShareModule.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
621D8DB61F7369C400C415A2 /* jshare-ios-1.2.1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 621D8DB41F7369C400C415A2 /* jshare-ios-1.2.1.a */; };
626A78841FA337680074D518 /* jshare-ios-1.3.0.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 626A78831FA337680074D518 /* jshare-ios-1.3.0.a */; };
62CBDDDF1F27397F00C1C703 /* RCTJShareModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 62CBDDDD1F27397F00C1C703 /* RCTJShareModule.m */; };
62CBDDE21F273B9B00C1C703 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 62CBDDE11F273B9B00C1C703 /* UIKit.framework */; };
62CBDDE41F273BA400C1C703 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 62CBDDE31F273BA400C1C703 /* SystemConfiguration.framework */; };
Expand All @@ -33,8 +33,8 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
621D8DB41F7369C400C415A2 /* jshare-ios-1.2.1.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "jshare-ios-1.2.1.a"; sourceTree = "<group>"; };
621D8DB51F7369C400C415A2 /* JSHAREService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSHAREService.h; sourceTree = "<group>"; };
626A78831FA337680074D518 /* jshare-ios-1.3.0.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "jshare-ios-1.3.0.a"; sourceTree = "<group>"; };
62CBDDCE1F27394300C1C703 /* libRCTJShareModule.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTJShareModule.a; sourceTree = BUILT_PRODUCTS_DIR; };
62CBDDDC1F27397F00C1C703 /* RCTJShareModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTJShareModule.h; sourceTree = "<group>"; };
62CBDDDD1F27397F00C1C703 /* RCTJShareModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTJShareModule.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -63,7 +63,7 @@
62CBDDEA1F273BC500C1C703 /* Security.framework in Frameworks */,
62CBDDE81F273BBC00C1C703 /* CoreGraphics.framework in Frameworks */,
62CBDDE61F273BAE00C1C703 /* CoreTelephony.framework in Frameworks */,
621D8DB61F7369C400C415A2 /* jshare-ios-1.2.1.a in Frameworks */,
626A78841FA337680074D518 /* jshare-ios-1.3.0.a in Frameworks */,
62CBDDE41F273BA400C1C703 /* SystemConfiguration.framework in Frameworks */,
62CBDDE21F273B9B00C1C703 /* UIKit.framework in Frameworks */,
);
Expand Down Expand Up @@ -92,7 +92,7 @@
62CBDDD01F27394300C1C703 /* RCTJShareModule */ = {
isa = PBXGroup;
children = (
621D8DB41F7369C400C415A2 /* jshare-ios-1.2.1.a */,
626A78831FA337680074D518 /* jshare-ios-1.3.0.a */,
621D8DB51F7369C400C415A2 /* JSHAREService.h */,
62CBDDDC1F27397F00C1C703 /* RCTJShareModule.h */,
62CBDDDD1F27397F00C1C703 /* RCTJShareModule.m */,
Expand Down
6 changes: 4 additions & 2 deletions ios/RCTJShareModule/RCTJShareModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ - (JSHAREPlatform)getPlatformFromDic:(NSDictionary *)param {
message.platform = platform;
} else {
failCallBack(@[@{@"code":@(1), @"description": @"parame error: platform error"}]);
return;
}

if ([param[@"type"] isEqualToString: @"text"]) {
Expand All @@ -279,8 +280,8 @@ - (JSHAREPlatform)getPlatformFromDic:(NSDictionary *)param {
}

if ([param[@"type"] isEqualToString: @"image"]) {
if (param[@"image"]) {
message.image = [NSData dataWithContentsOfFile:param[@"image"]];
if (param[@"imagePath"]) {
message.image = [NSData dataWithContentsOfFile:param[@"imagePath"]];
}

if (param[@"text"]) {
Expand Down Expand Up @@ -414,6 +415,7 @@ - (JSHAREPlatform)getPlatformFromDic:(NSDictionary *)param {
[JSHAREService share:message handler:^(JSHAREState state, NSError *error) {
if (error) {
failCallBack(@[@{@"code":@(error.code), @"description": [error description]}]);
return;
}
NSString *stateString = [self stateToString:state];
successCallBack(@[@{@"state": stateString}]);
Expand Down
Binary file removed ios/RCTJShareModule/jshare-ios-1.2.1.a
Binary file not shown.
Binary file added ios/RCTJShareModule/jshare-ios-1.3.0.a
Binary file not shown.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "jshare-react-native",
"version": "1.0.5",
"version": "1.1.0",
"description": "JShare SDK for react native",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"peerDependencies": {
"jcore-react-native": ">= 1.1.5"
"jcore-react-native": ">= 1.2.0"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 9495f8e

Please sign in to comment.