Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16552

registerNotificationActions is not a function in ReactNative

$
0
0

Trying to get action click event in push notification, for this i have user below method

import PushNotification from 'react-native-push-notification';import PushNotificationIOS from '@react-native-community/push-notification-ios';import PushNotificationAndroid from 'react-native-push-notification';PushNotificationAndroid.registerNotificationActions(actions);DeviceEventEmitter.addListener('notificationActionReceived', function (      action,    ) {      console.log('Notification action received: '+ action);      const info = JSON.parse(action.dataJSON);      if (info.action == 'Accept') {        // Do work pertaining to Accept action here      } else if (info.action == 'Reject') {        // Do work pertaining to Reject action here      }    });

While sending push notification, i am getting below error:

TypeError: _reactNativePushNotification.default.registerNotificationActions is not a function. (In '_reactNativePushNotification.default.registerNotificationActions(actions)', '_reactNativePushNotification.default.registerNotificationActions' is undefined)r


Viewing all articles
Browse latest Browse all 16552

Trending Articles