|
|
@@ -12,29 +12,27 @@ PushNotification.configure({
|
|
|
// (必需)在收到或打开远程通知或打开本地通知时调用
|
|
|
onNotification: function (notification) {
|
|
|
console.log("NOTIFICATION:", notification);
|
|
|
- if (!isIOS) {
|
|
|
- if (notification.title) {
|
|
|
- //TODO 处理通知
|
|
|
- notification.channelId = "10186";
|
|
|
- notification.smallIcon = "ic_notification";
|
|
|
- notification.showWhen = true;
|
|
|
- PushNotification.localNotification(notification);
|
|
|
- } else if (notification.data) {
|
|
|
- //TODO 处理消息
|
|
|
-
|
|
|
- }
|
|
|
- } else {
|
|
|
- //(必需)在收到或打开远程通知或打开本地通知时调用
|
|
|
- if (notification.finish) {
|
|
|
- notification.finish(PushNotificationIOS.FetchResult.NoData);
|
|
|
- }
|
|
|
+
|
|
|
+ /*if (notification.title) {
|
|
|
+ //TODO 处理通知
|
|
|
+ notification.channelId = "10186";
|
|
|
+ notification.smallIcon = "ic_notification";
|
|
|
+ notification.showWhen = true;
|
|
|
+ PushNotification.localNotification(notification);
|
|
|
+ } else if (notification.data) {
|
|
|
+ //TODO 处理消息
|
|
|
+
|
|
|
+ }*/
|
|
|
+ //(必需)在收到或打开远程通知或打开本地通知时调用
|
|
|
+ if (isIOS && notification.finish) {
|
|
|
+ notification.finish(PushNotificationIOS.FetchResult.NoData);
|
|
|
}
|
|
|
},
|
|
|
|
|
|
// (可选)当按下Registered Action且invokeApp为false时调用,如果为true,将调用onNotification(Android)
|
|
|
onAction: function (notification) {
|
|
|
- console.log("ACTION:", notification.action);
|
|
|
- console.log("NOTIFICATION:", notification);
|
|
|
+ //console.log("ACTION:", notification.action);
|
|
|
+ //console.log("NOTIFICATION:", notification);
|
|
|
|
|
|
// process the action
|
|
|
},
|