Skip to content

Commit 8022952

Browse files
committed
update ios demo fix set tag alias
1 parent 63628c4 commit 8022952

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

ios/PushDemo.xcodeproj/project.pbxproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@
711711
"$(PROJECT_DIR)/JPushReactBridge",
712712
);
713713
OTHER_LDFLAGS = "-ObjC";
714-
PRODUCT_BUNDLE_IDENTIFIER = huminios.jpushTest;
714+
PRODUCT_BUNDLE_IDENTIFIER = com.example.huminios.jpushTest;
715715
PRODUCT_NAME = PushDemo;
716716
};
717717
name = Debug;
@@ -737,7 +737,7 @@
737737
"$(PROJECT_DIR)/JPushReactBridge",
738738
);
739739
OTHER_LDFLAGS = "-ObjC";
740-
PRODUCT_BUNDLE_IDENTIFIER = huminios.jpushTest;
740+
PRODUCT_BUNDLE_IDENTIFIER = com.example.huminios.jpushTest;
741741
PRODUCT_NAME = PushDemo;
742742
};
743743
name = Release;

ios/PushDemo/AppDelegate.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#import <UIKit/UIKit.h>
1111

12-
static NSString *appKey = @"4f7aef34fb361292c566a1cd";
12+
static NSString *appKey = @"a1703c14b186a68a66ef86c1";
1313
static NSString *channel = @"";
1414
static BOOL isProduction = false;
1515

react-native-iOS/set_activity.js

+12-8
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,23 @@ var SetActivity = React.createClass({
2020
},
2121
setTag() {
2222
if (this.state.tag !== undefined) {
23-
JPushModule.setTags([this.state.tag], null, (resultCode) => {
24-
if (resultCode == 0) {
25-
Alert.alert('成功', 'tags 成功',[{text: 'OK'}])
26-
}
23+
JPushModule.setTags([this.state.tag], () => {
24+
// Alert.alert('成功', 'tags 成功',[{text: 'OK'}]);
25+
console.log('success set tag');
26+
}, () => {
27+
// Alert.alert('失败','设置alias 失败',[{text:'fail'}]);
28+
console.log('fail set tag');
2729
});
2830
};
2931
},
3032
setAlias() {
3133
if (this.state.alias !== undefined) {
32-
PushHelper.setTags(null, this.state.alias, (resultCode) => {
33-
if (resultCode == 0) {
34-
Alert.alert('成功', '设置alias 成功',[{text: 'OK'}])
35-
}
34+
JPushModule.setAlias(this.state.alias, () => {
35+
// Alert.alert('成功', '设置alias 成功',[{text: 'OK'}]);
36+
console.log('success set alias');
37+
},() => {
38+
// Alert.alert('失败','设置alias 失败',[{text:'fail'}]);
39+
console.log('fail set alias');
3640
});
3741
};
3842
},

0 commit comments

Comments
 (0)