Skip to content

Commit

Permalink
update ios demo fix set tag alias
Browse files Browse the repository at this point in the history
  • Loading branch information
huangminlinux committed May 30, 2016
1 parent 63628c4 commit 8022952
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
4 changes: 2 additions & 2 deletions ios/PushDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@
"$(PROJECT_DIR)/JPushReactBridge",
);
OTHER_LDFLAGS = "-ObjC";
PRODUCT_BUNDLE_IDENTIFIER = huminios.jpushTest;
PRODUCT_BUNDLE_IDENTIFIER = com.example.huminios.jpushTest;
PRODUCT_NAME = PushDemo;
};
name = Debug;
Expand All @@ -737,7 +737,7 @@
"$(PROJECT_DIR)/JPushReactBridge",
);
OTHER_LDFLAGS = "-ObjC";
PRODUCT_BUNDLE_IDENTIFIER = huminios.jpushTest;
PRODUCT_BUNDLE_IDENTIFIER = com.example.huminios.jpushTest;
PRODUCT_NAME = PushDemo;
};
name = Release;
Expand Down
2 changes: 1 addition & 1 deletion ios/PushDemo/AppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#import <UIKit/UIKit.h>

static NSString *appKey = @"4f7aef34fb361292c566a1cd";
static NSString *appKey = @"a1703c14b186a68a66ef86c1";
static NSString *channel = @"";
static BOOL isProduction = false;

Expand Down
20 changes: 12 additions & 8 deletions react-native-iOS/set_activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,23 @@ var SetActivity = React.createClass({
},
setTag() {
if (this.state.tag !== undefined) {
JPushModule.setTags([this.state.tag], null, (resultCode) => {
if (resultCode == 0) {
Alert.alert('成功', 'tags 成功',[{text: 'OK'}])
}
JPushModule.setTags([this.state.tag], () => {
// Alert.alert('成功', 'tags 成功',[{text: 'OK'}]);
console.log('success set tag');
}, () => {
// Alert.alert('失败','设置alias 失败',[{text:'fail'}]);
console.log('fail set tag');
});
};
},
setAlias() {
if (this.state.alias !== undefined) {
PushHelper.setTags(null, this.state.alias, (resultCode) => {
if (resultCode == 0) {
Alert.alert('成功', '设置alias 成功',[{text: 'OK'}])
}
JPushModule.setAlias(this.state.alias, () => {
// Alert.alert('成功', '设置alias 成功',[{text: 'OK'}]);
console.log('success set alias');
},() => {
// Alert.alert('失败','设置alias 失败',[{text:'fail'}]);
console.log('fail set alias');
});
};
},
Expand Down

0 comments on commit 8022952

Please sign in to comment.