Skip to content

Commit b6c4482

Browse files
authored
Merge pull request #3 from aperdec/release/0.0.3
Release/0.0.3
2 parents a26817d + 5e193b6 commit b6c4482

File tree

7 files changed

+210
-81
lines changed

7 files changed

+210
-81
lines changed

README.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
1-
# reactxp-push-notification
2-
This module provides cross-platform support for Push Notifications within the [ReactXP](https://microsoft.github.io/reactxp/) library.
1+
# ReactXP-Push-Notification
2+
This module provides cross-platform support for push notifications within the [ReactXP](https://microsoft.github.io/reactxp/) library. Push notifications are supported on Android and iOS.
33

44
## Documentation
5-
ToDo.
5+
For information about installation and usage, please refer to [react-native-push-notification](https://github.com/zo0r/react-native-push-notification/blob/master/README.md) documentation, which this component implements.
66

77
### Prerequisites
8-
* [ReactXP](https://github.com/microsoft/reactxp/)
9-
10-
## Contributing
11-
12-
## License
13-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
8+
* [ReactXP](https://github.com/microsoft/reactxp/)

index.android.js

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,57 @@
11
'use strict';
22

3-
var PushNotification = require('react-native-push-notification');
3+
var RNPushNotification = require('react-native-push-notification');
44

5-
module.exports = {
6-
PushNotification
7-
}
5+
var Notifications = {
6+
handler: RNPushNotification.handler,
7+
onRegister: false,
8+
onError: false,
9+
onNotification: false,
10+
onRemoteFetch: false,
11+
isLoaded: false,
12+
hasPoppedInitialNotification: false,
13+
14+
isPermissionsRequestPending: false,
15+
16+
permissions: {
17+
alert: true,
18+
badge: true,
19+
sound: true
20+
}
21+
};
22+
23+
Notifications.callNative = function (name: String, params: Array) {
24+
RNPushNotification.callNative(name, params);
25+
};
26+
27+
Notifications.configure = function (options: Object) {
28+
RNPushNotification.configure(options);
29+
};
30+
31+
Notifications.unregister = function () {
32+
RNPushNotification.unregister();
33+
};
34+
35+
Notifications.localNotification = function (details: Object) {
36+
RNPushNotification.localNotification(details);
37+
};
38+
39+
Notifications.localNotificationSchedule = function (details: Object) {
40+
RNPushNotification.localNotificationSchedule(details);
41+
};
42+
43+
Notifications._onRegister = function (token: String) {
44+
RNPushNotification._onRegister(token);
45+
};
46+
47+
Notifications._onRemoteFetch = function (notificationData: Object) {
48+
RNPushNotification._onRemoteFetch(notificationData);
49+
};
50+
51+
Notifications._onNotification = function (data, isFromBackground = null) {
52+
RNPushNotification._onNotification(data);
53+
};
54+
55+
Notifications._onPermissionResult = function () {
56+
RNPushNotification._onPermissionResult();
57+
};

index.ios.js

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,57 @@
11
'use strict';
22

3-
var PushNotification = require('react-native-push-notification');
3+
var RNPushNotification = require('react-native-push-notification');
44

5-
module.exports = {
6-
PushNotification
7-
}
5+
var Notifications = {
6+
handler: RNPushNotification.handler,
7+
onRegister: false,
8+
onError: false,
9+
onNotification: false,
10+
onRemoteFetch: false,
11+
isLoaded: false,
12+
hasPoppedInitialNotification: false,
13+
14+
isPermissionsRequestPending: false,
15+
16+
permissions: {
17+
alert: true,
18+
badge: true,
19+
sound: true
20+
}
21+
};
22+
23+
Notifications.callNative = function (name: String, params: Array) {
24+
RNPushNotification.callNative(name, params);
25+
};
26+
27+
Notifications.configure = function (options: Object) {
28+
RNPushNotification.configure(options);
29+
};
30+
31+
Notifications.unregister = function () {
32+
RNPushNotification.unregister();
33+
};
34+
35+
Notifications.localNotification = function (details: Object) {
36+
RNPushNotification.localNotification(details);
37+
};
38+
39+
Notifications.localNotificationSchedule = function (details: Object) {
40+
RNPushNotification.localNotificationSchedule(details);
41+
};
42+
43+
Notifications._onRegister = function (token: String) {
44+
RNPushNotification._onRegister(token);
45+
};
46+
47+
Notifications._onRemoteFetch = function (notificationData: Object) {
48+
RNPushNotification._onRemoteFetch(notificationData);
49+
};
50+
51+
Notifications._onNotification = function (data, isFromBackground = null) {
52+
RNPushNotification._onNotification(data);
53+
};
54+
55+
Notifications._onPermissionResult = function () {
56+
RNPushNotification._onPermissionResult();
57+
};

index.js

Lines changed: 94 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,99 @@
11
'use strict';
22

3-
// Export web by default. Other platforms have custom index.[platform].js files
4-
var PushNotification = require('./dist/web/PushNotification.tsx');
3+
var PushNotifications = {
4+
handler: null,
5+
onRegister: false,
6+
onError: false,
7+
onNotification: false,
8+
onRemoteFetch: false,
9+
isLoaded: false,
10+
hasPoppedInitialNotification: false,
11+
12+
isPermissionsRequestPending: false,
13+
14+
permissions: {
15+
alert: true,
16+
badge: true,
17+
sound: true
18+
}
19+
};
20+
21+
PushNotifications.callNative = function(name, params) {
22+
/* void */
23+
};
24+
25+
PushNotifications.configure = function(options) {
26+
/* void */
27+
};
28+
29+
PushNotifications.unregister = function() {
30+
/* void */
31+
};
32+
33+
PushNotifications.localNotification = function(details) {
34+
/* void */
35+
};
36+
37+
PushNotifications.localNotificationSchedule = function(details) {
38+
/* void */
39+
};
40+
41+
PushNotifications._onRegister = function(token) {
42+
/* void */
43+
};
44+
45+
PushNotifications._onRemoteFetch = function(notificationData) {
46+
/* void */
47+
};
48+
49+
PushNotifications._onNotification = function(data, isFromBackground = null) {
50+
/* void */
51+
};
52+
53+
PushNotifications._onPermissionResult = function() {
54+
/* void */
55+
};
56+
57+
PushNotifications._requestPermissions = function() {
58+
/* void */
59+
};
60+
61+
PushNotifications.requestPermissions = function() {
62+
/* void */
63+
};
64+
65+
PushNotifications.presentLocalNotification = function() {
66+
/* void */
67+
};
68+
69+
PushNotifications.scheduleLocalNotification = function() {
70+
/* void */
71+
};
72+
73+
PushNotifications.cancelLocalNotifications = function() {
74+
/* void */
75+
};
76+
77+
PushNotifications.cancelAllLocalNotifications = function() {
78+
/* void */
79+
};
80+
81+
PushNotifications.setApplicationIconBadgeNumber = function() {
82+
/* void */
83+
};
84+
85+
PushNotifications.getApplicationIconBadgeNumber = function() {
86+
/* void */
87+
};
88+
89+
PushNotifications.popInitialNotification = function(handler) {
90+
/* void */
91+
};
92+
93+
PushNotifications.abandonPermissions = function() {
94+
/* void */
95+
};
596

697
module.exports = {
798
PushNotification
8-
}
99+
};

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "reactxp-push-notification",
3-
"version": "0.0.2",
4-
"description": "Plugin for ReactXP that provides support for Application Notifications for Android and iOS",
3+
"version": "0.0.3",
4+
"description": "Plugin for ReactXP that provides support for Push Notifications for Android and iOS",
55
"author": "Andrew Perdec <aperdec@gmail.com>",
66
"license": "MIT",
77
"scripts": {

src/web/PushNotification.tsx

Lines changed: 0 additions & 57 deletions
This file was deleted.

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
"declaration": true,
3+
"declaration": false,
44
"noResolve": false,
55
"jsx": "react",
66
"module": "commonjs",
@@ -11,7 +11,7 @@
1111
},
1212

1313
"filesGlob": [
14-
"src/**/*{ts,tsx}"
14+
"src/**/*"
1515
],
1616

1717
"exclude": [

0 commit comments

Comments
 (0)