|
@@ -177,60 +177,60 @@ export default function Page() {
|
|
|
else {
|
|
else {
|
|
|
loadRNCache()
|
|
loadRNCache()
|
|
|
|
|
|
|
|
- PushNotification.configure({
|
|
|
|
|
- onRegister: function (token) {
|
|
|
|
|
- console.log('TOKEN:', token);
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
- onNotification: function (notification) {
|
|
|
|
|
- console.log('NOTIFICATION:', notification);
|
|
|
|
|
- // notification.finish(PushNotificationIOS.FetchResult.NoData);
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
- permissions: {
|
|
|
|
|
- alert: true,
|
|
|
|
|
- badge: true,
|
|
|
|
|
- sound: true,
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ // PushNotification.configure({
|
|
|
|
|
+ // onRegister: function (token) {
|
|
|
|
|
+ // console.log('TOKEN:', token);
|
|
|
|
|
+ // },
|
|
|
|
|
+
|
|
|
|
|
+ // onNotification: function (notification) {
|
|
|
|
|
+ // console.log('NOTIFICATION:', notification);
|
|
|
|
|
+ // // notification.finish(PushNotificationIOS.FetchResult.NoData);
|
|
|
|
|
+ // },
|
|
|
|
|
+
|
|
|
|
|
+ // permissions: {
|
|
|
|
|
+ // alert: true,
|
|
|
|
|
+ // badge: true,
|
|
|
|
|
+ // sound: true,
|
|
|
|
|
+ // },
|
|
|
|
|
+
|
|
|
|
|
+ // popInitialNotification: true,
|
|
|
|
|
+ // requestPermissions: true,
|
|
|
|
|
+ // });
|
|
|
|
|
|
|
|
- popInitialNotification: true,
|
|
|
|
|
- requestPermissions: true,
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- var channelId = "your-channel-id" + new Date().getTime()
|
|
|
|
|
- PushNotification.createChannel({
|
|
|
|
|
- channelId: channelId, // (required)
|
|
|
|
|
- channelName: "My channel", // (required)
|
|
|
|
|
- channelDescription: "A channel to categorise your notifications", // (optional) default: undefined.
|
|
|
|
|
- playSound: false, // (optional) default: true
|
|
|
|
|
- soundName: "default", // (optional) See `soundName` parameter of `localNotification` function
|
|
|
|
|
- importance: Importance.HIGH, // (optional) default: Importance.HIGH. Int value of the Android notification importance
|
|
|
|
|
- vibrate: true, // (optional) default: true. Creates the default vibration pattern if true.
|
|
|
|
|
- }, (created) => {
|
|
|
|
|
- console.log('create channel result',created)
|
|
|
|
|
- PushNotification.localNotificationSchedule({
|
|
|
|
|
- //... You can use all the options from localNotifications
|
|
|
|
|
- channelId: channelId,
|
|
|
|
|
- title: 'Leon test',
|
|
|
|
|
- message: "Local notification push", // (required)
|
|
|
|
|
- date: new Date(Date.now() + 10 * 1000), // in 60 secs
|
|
|
|
|
- allowWhileIdle: true, // (optional) set notification to work while on doze, default: false
|
|
|
|
|
- // repeatType:'minute',
|
|
|
|
|
- /* Android Only Properties */
|
|
|
|
|
- // repeatTime: 1, // (optional) Increment of configured repeatType. Check 'Repeating Notifications' section for more info.
|
|
|
|
|
- });
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ // var channelId = "your-channel-id" + new Date().getTime()
|
|
|
|
|
+ // PushNotification.createChannel({
|
|
|
|
|
+ // channelId: channelId, // (required)
|
|
|
|
|
+ // channelName: "My channel", // (required)
|
|
|
|
|
+ // channelDescription: "A channel to categorise your notifications", // (optional) default: undefined.
|
|
|
|
|
+ // playSound: false, // (optional) default: true
|
|
|
|
|
+ // soundName: "default", // (optional) See `soundName` parameter of `localNotification` function
|
|
|
|
|
+ // importance: Importance.HIGH, // (optional) default: Importance.HIGH. Int value of the Android notification importance
|
|
|
|
|
+ // vibrate: true, // (optional) default: true. Creates the default vibration pattern if true.
|
|
|
|
|
+ // }, (created) => {
|
|
|
|
|
+ // console.log('create channel result',created)
|
|
|
|
|
+ // PushNotification.localNotificationSchedule({
|
|
|
|
|
+ // //... You can use all the options from localNotifications
|
|
|
|
|
+ // channelId: channelId,
|
|
|
|
|
+ // title: 'Leon test',
|
|
|
|
|
+ // message: "Local notification push", // (required)
|
|
|
|
|
+ // date: new Date(Date.now() + 10 * 1000), // in 60 secs
|
|
|
|
|
+ // allowWhileIdle: true, // (optional) set notification to work while on doze, default: false
|
|
|
|
|
+ // // repeatType:'minute',
|
|
|
|
|
+ // /* Android Only Properties */
|
|
|
|
|
+ // // repeatTime: 1, // (optional) Increment of configured repeatType. Check 'Repeating Notifications' section for more info.
|
|
|
|
|
+ // });
|
|
|
|
|
+ // })
|
|
|
|
|
|
|
|
- PushNotification.localNotificationSchedule({
|
|
|
|
|
- //... You can use all the options from localNotifications
|
|
|
|
|
- title: 'Leon test2',
|
|
|
|
|
- message: "Local notification push2", // (required)
|
|
|
|
|
- date: new Date(Date.now() + 15 * 1000), // in 60 secs
|
|
|
|
|
- allowWhileIdle: true, // (optional) set notification to work while on doze, default: false
|
|
|
|
|
- // repeatType:'minute',
|
|
|
|
|
- /* Android Only Properties */
|
|
|
|
|
- // repeatTime: 1, // (optional) Increment of configured repeatType. Check 'Repeating Notifications' section for more info.
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ // PushNotification.localNotificationSchedule({
|
|
|
|
|
+ // //... You can use all the options from localNotifications
|
|
|
|
|
+ // title: 'Leon test2',
|
|
|
|
|
+ // message: "Local notification push2", // (required)
|
|
|
|
|
+ // date: new Date(Date.now() + 15 * 1000), // in 60 secs
|
|
|
|
|
+ // allowWhileIdle: true, // (optional) set notification to work while on doze, default: false
|
|
|
|
|
+ // // repeatType:'minute',
|
|
|
|
|
+ // /* Android Only Properties */
|
|
|
|
|
+ // // repeatTime: 1, // (optional) Increment of configured repeatType. Check 'Repeating Notifications' section for more info.
|
|
|
|
|
+ // });
|
|
|
|
|
|
|
|
// PushNotification.localNotificationSchedule({
|
|
// PushNotification.localNotificationSchedule({
|
|
|
// //... You can use all the options from localNotifications
|
|
// //... You can use all the options from localNotifications
|