b8ne / react-native-pusher-push-notifications

Manage pusher interest subscriptions and notification events in Javascript.
MIT License
97 stars 85 forks source link

RNPusherPushNotifications is null #54

Closed mritzman-dg closed 3 years ago

mritzman-dg commented 4 years ago

I have a react-native app built and expo and am trying to setup listening to a pusher beam push notifications. When I try to set the instance id with RNPusherPushNotifications.setInstanceId(settings.PUSHER_INSTANCE_ID) this call but I'm getting the following error:

null is not an object (evaluating 'RNPusherPushNotifications.setAppKey')
- node_modules/react-native-pusher-push-notifications/index.js:25:32 in setInstanceId
* app/screens/LoginScreen.js:79:44 in useEffect$argument_0
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:16921:31 in commitHookEffectList
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:16970:29 in commitPassiveHookEffects
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:307:15 in invokeGuardedCallbackImpl
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:531:36 in invokeGuardedCallback
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:20061:28 in flushPassiveEffectsImpl
* [native code]:null in flushPassiveEffectsImpl
- node_modules/scheduler/cjs/scheduler.development.js:643:23 in unstable_runWithPriority
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:18920:21 in renderRoot
* [native code]:null in renderRoot
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:18709:28 in runRootCallback
* [native code]:null in runRootCallback
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:5642:32 in runWithPriority$argument_1
- node_modules/scheduler/cjs/scheduler.development.js:643:23 in unstable_runWithPriority
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:5638:22 in flushSyncCallbackQueueImpl
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:5627:28 in flushSyncCallbackQueue
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:18556:30 in scheduleUpdateOnFiber
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:7799:17 in classComponentUpdater.enqueueSetState
- node_modules/react/cjs/react.development.js:325:31 in Component.prototype.setState
- node_modules/@react-navigation/native/src/withOrientation.js:26:20 in handleOrientationChange
- node_modules/react-native/Libraries/vendor/emitter/EventEmitter.js:190:12 in emit
- node_modules/react-native/Libraries/Utilities/Dimensions.js:85:24 in set
- node_modules/react-native/Libraries/Utilities/Dimensions.js:130:21 in RCTDeviceEventEmitter.addListener$argument_1
- node_modules/react-native/Libraries/vendor/emitter/EventEmitter.js:190:12 in emit
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:436:47 in __callFunction
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:111:26 in __guard$argument_0
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:384:10 in __guard
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:110:17 in __guard$argument_0
* [native code]:null in callFunctionReturnFlushedQueue

React SDK Version: 36.0.0 react-native-pusher-push-notifications: ^2.4.0 Expo version: 3.13.1

mritzman-dg commented 4 years ago

tried this package again yesterday and am still running into this issue, anyone else seeing this?

evanb2 commented 4 years ago
  1. Make sure you run npx pod-install aka cd ios/ && pod install && cd ../ In the output of that command you should see this package listed. Ex:
    Detected React Native module pods for react-native-pusher-push-notifications, BugsnagReactNative, RNCAsyncStorage, RNCPushNotificationIOS, RNGestureHandler, RNVectorIcons, react-native-image-picker, react-native-intercom, react-native-netinfo
  2. I never got this specific linking error but I could not get this to build without doing these steps: https://github.com/b8ne/react-native-pusher-push-notifications#possible-issues

And as always, after you've done that make sure you wipe your build folder and reset watchman: yarn start --reset-cache

Humni commented 3 years ago

Is this still an issue @mritzman-dg?