diff --git a/ios/PushDemo/AppDelegate.m b/ios/PushDemo/AppDelegate.m
index aa307c67..e5046b1a 100644
--- a/ios/PushDemo/AppDelegate.m
+++ b/ios/PushDemo/AppDelegate.m
@@ -19,24 +19,7 @@ @implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
-
-// if ([[UIDevice currentDevice].systemVersion floatValue] >= 8.0) {
-// //可以添加自定义categories
-// [JPUSHService registerForRemoteNotificationTypes:(UIUserNotificationTypeBadge |
-// UIUserNotificationTypeSound |
-// UIUserNotificationTypeAlert)
-// categories:nil];
-// } else {
-// //categories 必须为nil
-// [JPUSHService registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge |
-// UIRemoteNotificationTypeSound |
-// UIRemoteNotificationTypeAlert)
-// categories:nil];
-// }
-//
-// [JPUSHService setupWithOption:launchOptions appKey:appKey
-// channel:channel apsForProduction:isProduction];
-// [self performSelector:@selector(registerNotificationOptions:) withObject:launchOptions afterDelay:0];
+
NSURL *jsCodeLocation;
@@ -58,7 +41,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
* on the same Wi-Fi network.
*/
- jsCodeLocation = [NSURL URLWithString:@"http://192.168.70.115:8081/index.ios.bundle?platform=ios&dev=true"];
+ jsCodeLocation = [NSURL URLWithString:@"http://127.0.0.1:8081/index.ios.bundle?platform=ios&dev=true"];
/**
* OPTION 2
diff --git a/react-native-iOS/push_activity.js b/react-native-iOS/push_activity.js
index bb4c4db6..206b432f 100644
--- a/react-native-iOS/push_activity.js
+++ b/react-native-iOS/push_activity.js
@@ -15,9 +15,7 @@ var {
NativeAppEventEmitter
} = React;
-// var ToastAndroid = NativeModules.ToastAndroid;
var PushHelper = NativeModules.JPushHelper;
-// var JSHelper = NativeModules.JSHelper;
var PushActivity = React.createClass({
getInitialState: function() {
@@ -35,11 +33,7 @@ var PushActivity = React.createClass({
this.props.navigator.push({ name:'setActivity' });
},
onInitPress() {
- // PushHelper.init( (success) => {
- // // ToastAndroid.show(success, ToastAndroid.SHORT);
- // }, (error) => {
- // // ToastAndroid.show(error, ToastAndroid.SHORT);
- // });
+
console.log('on click init push ');
PushHelper.setupPush('dssdf');
@@ -50,28 +44,7 @@ var PushActivity = React.createClass({
onSetuplocalNotificationPress() {
this.props.navigator.push({ name:'LocalPushActivity' });
},
- onResumePress() {
- // PushHelper.resumePush((success) => {
- // ToastAndroid.show(success, ToastAndroid.SHORT);
- // }, (error) => {
- // ToastAndroid.show(error, ToastAndroid.SHORT);
- // });
- },
componentWillMount() {
- // JSHelper.initModule(
- // (map) => {
- // this.setState({
- // appkey: map.myAppKey,
- // imei: map.myImei,
- // package: map.myPackageName,
- // deviceId: map.myDeviceId,
- // version: map.myVersion
- // })
- // }
- // );
- // DeviceEventEmitter.addListener('receivePushMsg', (data) => {
- // this.setState({ pushMsg: data });
- // });
var subscription = NativeAppEventEmitter.addListener('didRegisterToken', (token) => {
this.setState({ pushToken: token });
@@ -143,15 +116,7 @@ var PushActivity = React.createClass({
local notification
-
-
- RESUMEPUSH
-
-
+
token: { this.state.pushToken }