Skip to content

Commit 1b95d6b

Browse files
KenChoiKenChoi
authored andcommitted
fix conflict
2 parents 43d571a + 57b2438 commit 1b95d6b

File tree

14 files changed

+264
-268
lines changed

14 files changed

+264
-268
lines changed

example/.flowconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,20 @@ suppress_type=$FlowIssue
3434
suppress_type=$FlowFixMe
3535
suppress_type=$FixMe
3636

37+
<<<<<<< ours
3738
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-7]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
3839
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-7]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
40+
=======
41+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(5[0-6]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
42+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(5[0-6]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
43+
>>>>>>> theirs
3944
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
4045

4146
unsafe.enable_getters_and_setters=true
4247

4348
[version]
49+
<<<<<<< ours
4450
^0.37.0
51+
=======
52+
^0.56.0
53+
>>>>>>> theirs

example/documents/APIs.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,14 @@ reset tags.
108108
- **extra** : Object // local notification extra (key-value)
109109
- **fireTime** : Number // show local notification time(ms)
110110
- **badge** : Number // when local notification fire, application icon will set badge with this value (iOS Only)
111-
- **soundName** : String // if you what to custom notification sound ,you should specify audio file name (iOS Only)
111+
- **sound** : String // if you what to custom notification sound ,you should specify audio file name (iOS Only)
112112
- **subtitle** : String // set local notification subtitle (iOS10+ Only)
113113

114114
```javascript
115115
var currentDate = new Date()
116116
JPushModule.sendLocalNotification(
117117
{
118118
id:5,
119-
title:'haha',
120119
content:'content',
121120
extra:{key1:'value1',key2:'value2'},
122121
fireTime: currentDate.getTime() + 3000,
@@ -197,19 +196,15 @@ All apis can find in jpush-react-native/index.js.
197196
set application's badge.
198197

199198
```js
200-
JPushModule.setBadge(5, (success) => {
201-
console.log(success)
202-
});
199+
JPushModule.setBadge(5, (success) => { } );
203200
```
204201

205202
#### getBadge
206203

207204
get application's badge.
208205

209206
```javascript
210-
JPushModule.getBadge((badge) => {
211-
console.log(badge)
212-
});
207+
JPushModule.getBadge( (badge) => { } );
213208
```
214209

215210
#### setLocalNotification
@@ -250,13 +245,13 @@ setLocalNotification( Date, // date local notification fire data
250245
JPushModule.addOpenNotificationLaunchAppListener(callback)
251246
```
252247

253-
- removeOpenNotificationLaunchAppListener(function)
248+
- removeOpenNotificationLaunchAppEventListener(function)
254249

255250
```javascript
256-
JPushModule.removeOpenNotificationLaunchAppListener(callback)
251+
JPushModule.removeOpenNotificationLaunchAppEventListener(callback)
257252
```
258253

259-
remove listener:application not running and tap notification to run application,`removeOpenNotificationLaunchAppListener` and `addOpenNotificationLaunchAppListener` used in pairs.
254+
remove listener:application not running and tap notification to run application,`removeOpenNotificationLaunchAppEventListener` and `addOpenNotificationLaunchAppListener` used in pairs.
260255

261256
**Network Did Login Event**
262257

example/documents/APIs_zh.md

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- [接收推送事件](#接收推送事件)
1313
- [接收自定义消息事件](#接收自定义消息事件)
1414
- [iOS Only API](#ios-only-api)
15+
- [setupPush](#setuppush)
1516
- [setBadge](#setbadge)
1617
- [getBadge](#getbadge)
1718
- [setLocalNotification](#setlocalnotification)
@@ -133,21 +134,26 @@ Android 和 iOS 通用 API。
133134
- sendLocalNotification(notification)
134135

135136
- **buildId** : Number // 设置通知样式,1 为基础样式,2 为自定义样式。自定义样式需要先调用 setStyleCustom 接口设置自定义样式。(Android Only)
137+
<<<<<<< HEAD
136138
- **id** : Number // 通知的 id, 可用于取消通知
137139
- **title** : String // 通知标题
138140
- **content** : String // 通知内容
141+
=======
142+
- **id** : Number // 通知的 id, 可用于取消通知
143+
- **title** : String // 通知标题
144+
- **content** : String // 通知内容
145+
>>>>>>> 57b24382bb295d08dbb0f1275ebfc3880fe2d9b9
139146
- **extra** : Object // extra 字段
140147
- **fireTime** : Number // 通知触发时间的时间戳(毫秒)
141148
- **badge** : Number // 本地推送触发后应用角标的 badge 值 (iOS Only)
142-
- **soundName** : String // 指定推送的音频文件 (iOS Only)
149+
- **sound** : String // 指定推送的音频文件 (iOS Only)
143150
- **subtitle** : String // 子标题 (iOS10+ Only)
144151

145152
```javascript
146153
var currentDate = new Date()
147154
JPushModule.sendLocalNotification(
148155
{
149156
id:5,
150-
title:'haha',
151157
content:'content',
152158
extra:{key1:'value1',key2:'value2'},
153159
fireTime: currentDate.getTime() + 3000,
@@ -214,31 +220,38 @@ Android 和 iOS 通用 API。
214220
- removeReceiveCustomMsgListener(function)
215221

216222
```
217-
JPushModule.removeReceiveCustomMsgListener(callback);
223+
JPushModule.removeReceiveCustomMsgListener(callback);
218224
```
219225

220226

221227

222228
### iOS Only API
223229

230+
#### setupPush
231+
232+
调用这个接口会向系统注册推送功能(会弹出推送权限请求),注意使用自动配置会自动在 `AppDeletate.m` 插入注册代码如下,如果不希望在应用启动的时候就向用户申请权限可以删掉这部分代码。
233+
234+
```objective-c
235+
// AppDelegate.m 自动插入的代码
236+
JPUSHRegisterEntity * entity = [[JPUSHRegisterEntity alloc] init];
237+
entity.types = UNAuthorizationOptionAlert|UNAuthorizationOptionBadge|UNAuthorizationOptionSound;
238+
[JPUSHService registerForRemoteNotificationConfig:entity delegate:self];
239+
```
240+
224241
#### setBadge
225242
226243
设置应用 badge 值,该方法还会同步 JPush 服务器的的 badge 值,JPush 服务器的 badge 值用于推送 badge 自动 +1 时会用到。
227244
228245
```js
229-
JPushModule.setBadge(5, (success) => {
230-
console.log(success)
231-
});
246+
JPushModule.setBadge(5, (success) => {} );
232247
```
233248

234249
#### getBadge
235250

236251
获取应用 badge 值。
237252

238253
```javascript
239-
JPushModule.getBadge((badge) => {
240-
console.log(badge)
241-
});
254+
JPushModule.getBadge((badge) => { } );
242255
```
243256

244257
#### setLocalNotification
@@ -279,21 +292,21 @@ setLocalNotification( Date, // date 触发本地推送的时间
279292
JPushModule.addOpenNotificationLaunchAppListener(callback)
280293
```
281294

282-
- removeOpenNotificationLaunchAppListener(function)
295+
- removeOpenNotificationLaunchAppEventListener(function)
283296

284297
```javascript
285-
JPushModule.removeOpenNotificationLaunchAppListener(callback)
298+
JPushModule.removeOpenNotificationLaunchAppEventListener(callback)
286299
```
287300

288-
取消监听:`removeOpenNotificationLaunchAppListener` 取消事件回调,和`addOpenNotificationLaunchAppListener` 方法成对使用。
301+
取消监听:`removeOpenNotificationLaunchAppEventListener` 取消事件回调,和`addOpenNotificationLaunchAppListener` 方法成对使用。
289302

290303
**Network Did Login Event**
291304

292305
**NOTE**: iOS 需要安装到 [email protected]+ 。
293306

294307
- addnetworkDidLoginListener(function)
295308

296-
添加回调:添加网络已经等了事件回调`setTag``setAlias` 需要在网络已经登录成功后调用才会有效 。
309+
添加回调:添加网络已登录事件回调`setTag``setAlias` 需要在网络已经登录成功后调用才会有效 。
297310

298311
```javascript
299312
var callback = () => {

example/documents/common_problems.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
- [事件的解析](#事件的解析)
44
- [页面跳转](#页面跳转)
55
- [编译报错](#编译报错)
6-
- [iOS 收不到推送](#iOS 收不到推送)
7-
- [iOS 应用角标 Badge](#iOS 应用角标 Badge)
6+
- [iOS 收不到推送](#iOS收不到推送)
7+
- [iOS 应用角标 Badge](#iOS应用角标Badge)
88
- [其他](#其他)
99

1010

example/index.ios.js

Lines changed: 15 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -2,91 +2,28 @@
22

33

44
import React from 'react';
5-
import ReactNative from 'react-native';
5+
import {
6+
AppRegistry,
7+
} from 'react-native';
8+
9+
import {
10+
StackNavigator
11+
} from 'react-navigation';
612

713
var PushActivity = require('./react-native-iOS/push_activity.js');
814
var SetActivity = require('./react-native-iOS/set_activity');
915
var LocalPushActivity = require('./react-native-iOS/localPush_activity');
1016

11-
var {
12-
Text,
13-
TextInput,
14-
View,
15-
Navigator,
16-
BackAndroid,
17-
NativeModules,
18-
StyleSheet,
19-
AppRegistry
20-
} = ReactNative;
21-
22-
var PushDemo = React.createClass({
23-
24-
configureScene(route) {
25-
return Navigator.SceneConfigs.FloatFromRight;
17+
const PushDemo = StackNavigator({
18+
Home: {
19+
screen: PushActivity
2620
},
27-
28-
renderScene(router, navigator) {
29-
var Component = null;
30-
this._navigator = navigator;
31-
switch(router.name) {
32-
case "pushActivity":
33-
Component = PushActivity;
34-
break;
35-
case "setActivity":
36-
Component = SetActivity;
37-
break;
38-
case "LocalPushActivity":
39-
Component = LocalPushActivity;
40-
break;
41-
}
42-
return <Component navigator = { navigator } />
43-
},
44-
45-
render() {
46-
return (
47-
<Navigator
48-
initialRoute = { {name: 'pushActivity' }}
49-
configureScene = { this.configureScene }
50-
renderScene = { this.renderScene } />
51-
);
52-
}
53-
});
54-
55-
56-
var styles = StyleSheet.create({
57-
58-
// For the container View
59-
parent: {
60-
padding: 16
61-
},
62-
63-
backBtnStyle: {
64-
borderWidth: 1,
65-
borderColor: '#3f80dc',
66-
borderRadius: 5
67-
},
68-
69-
backBtnText: {
70-
textAlign: 'center',
71-
fontSize: 25,
72-
color: '#ffffff'
73-
},
74-
buttonStyle: {
75-
marginTop: 15,
76-
padding: 5,
77-
borderWidth: 1,
78-
borderColor: '#48bbec',
79-
borderRadius: 8,
80-
justifyContent:'center',
81-
alignSelf:'stretch',
82-
flexDirection: 'row',
83-
backgroundColor:'#48bbec'
84-
21+
Setting: {
22+
screen: SetActivity
8523
},
86-
buttonText: {
87-
fontSize: 25,
88-
color: '#ffffff',
24+
LocalPush: {
25+
screen: LocalPushActivity
8926
}
90-
});
27+
})
9128

9229
AppRegistry.registerComponent('PushDemo', () => PushDemo);

0 commit comments

Comments
 (0)