Skip to content

Commit d70e95c

Browse files
committed
去除无用代码准备发布
1 parent 42648d0 commit d70e95c

File tree

2 files changed

+4
-56
lines changed

2 files changed

+4
-56
lines changed

ios/PushDemo/AppDelegate.m

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,7 @@ @implementation AppDelegate
1919

2020
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
2121
{
22-
23-
// if ([[UIDevice currentDevice].systemVersion floatValue] >= 8.0) {
24-
// //可以添加自定义categories
25-
// [JPUSHService registerForRemoteNotificationTypes:(UIUserNotificationTypeBadge |
26-
// UIUserNotificationTypeSound |
27-
// UIUserNotificationTypeAlert)
28-
// categories:nil];
29-
// } else {
30-
// //categories 必须为nil
31-
// [JPUSHService registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge |
32-
// UIRemoteNotificationTypeSound |
33-
// UIRemoteNotificationTypeAlert)
34-
// categories:nil];
35-
// }
36-
//
37-
// [JPUSHService setupWithOption:launchOptions appKey:appKey
38-
// channel:channel apsForProduction:isProduction];
39-
// [self performSelector:@selector(registerNotificationOptions:) withObject:launchOptions afterDelay:0];
22+
4023

4124
NSURL *jsCodeLocation;
4225

@@ -58,7 +41,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
5841
* on the same Wi-Fi network.
5942
*/
6043

61-
jsCodeLocation = [NSURL URLWithString:@"http://192.168.70.115:8081/index.ios.bundle?platform=ios&dev=true"];
44+
jsCodeLocation = [NSURL URLWithString:@"http://127.0.0.1:8081/index.ios.bundle?platform=ios&dev=true"];
6245

6346
/**
6447
* OPTION 2

react-native-iOS/push_activity.js

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ var {
1515
NativeAppEventEmitter
1616
} = React;
1717

18-
// var ToastAndroid = NativeModules.ToastAndroid;
1918
var PushHelper = NativeModules.JPushHelper;
20-
// var JSHelper = NativeModules.JSHelper;
2119
var PushActivity = React.createClass({
2220

2321
getInitialState: function() {
@@ -35,11 +33,7 @@ var PushActivity = React.createClass({
3533
this.props.navigator.push({ name:'setActivity' });
3634
},
3735
onInitPress() {
38-
// PushHelper.init( (success) => {
39-
// // ToastAndroid.show(success, ToastAndroid.SHORT);
40-
// }, (error) => {
41-
// // ToastAndroid.show(error, ToastAndroid.SHORT);
42-
// });
36+
4337
console.log('on click init push ');
4438
PushHelper.setupPush('dssdf');
4539

@@ -50,28 +44,7 @@ var PushActivity = React.createClass({
5044
onSetuplocalNotificationPress() {
5145
this.props.navigator.push({ name:'LocalPushActivity' });
5246
},
53-
onResumePress() {
54-
// PushHelper.resumePush((success) => {
55-
// ToastAndroid.show(success, ToastAndroid.SHORT);
56-
// }, (error) => {
57-
// ToastAndroid.show(error, ToastAndroid.SHORT);
58-
// });
59-
},
6047
componentWillMount() {
61-
// JSHelper.initModule(
62-
// (map) => {
63-
// this.setState({
64-
// appkey: map.myAppKey,
65-
// imei: map.myImei,
66-
// package: map.myPackageName,
67-
// deviceId: map.myDeviceId,
68-
// version: map.myVersion
69-
// })
70-
// }
71-
// );
72-
// DeviceEventEmitter.addListener('receivePushMsg', (data) => {
73-
// this.setState({ pushMsg: data });
74-
// });
7548

7649
var subscription = NativeAppEventEmitter.addListener('didRegisterToken', (token) => {
7750
this.setState({ pushToken: token });
@@ -143,15 +116,7 @@ var PushActivity = React.createClass({
143116
local notification
144117
</Text>
145118
</TouchableHighlight>
146-
<TouchableHighlight
147-
underlayColor = '#f5a402'
148-
activeOpacity = { 0.5 }
149-
style = { styles.btnStyle }
150-
onPress = { this.onResumePress }>
151-
<Text style = { styles.btnTextStyle }>
152-
RESUMEPUSH
153-
</Text>
154-
</TouchableHighlight>
119+
155120
<Text style = { styles.textStyle }>
156121
token: { this.state.pushToken }
157122
</Text>

0 commit comments

Comments
 (0)