Skip to content

Commit

Permalink
去除无用代码准备发布
Browse files Browse the repository at this point in the history
  • Loading branch information
huangminlinux committed Apr 5, 2016
1 parent 42648d0 commit d70e95c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 56 deletions.
21 changes: 2 additions & 19 deletions ios/PushDemo/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
Expand Down
39 changes: 2 additions & 37 deletions react-native-iOS/push_activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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');

Expand All @@ -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 });
Expand Down Expand Up @@ -143,15 +116,7 @@ var PushActivity = React.createClass({
local notification
</Text>
</TouchableHighlight>
<TouchableHighlight
underlayColor = '#f5a402'
activeOpacity = { 0.5 }
style = { styles.btnStyle }
onPress = { this.onResumePress }>
<Text style = { styles.btnTextStyle }>
RESUMEPUSH
</Text>
</TouchableHighlight>

<Text style = { styles.textStyle }>
token: { this.state.pushToken }
</Text>
Expand Down

0 comments on commit d70e95c

Please sign in to comment.