Pushwoosh / pushwoosh-react-native-plugin

Other
58 stars 44 forks source link

[Bug]: TypeError: Cannot read property 'init' of null, js engine: hermes #169

Closed davortrifunov closed 1 month ago

davortrifunov commented 1 month ago

Documentation

Description

When trying to initialize Pushwoosh I am getting the following error: ERROR TypeError: Cannot read property 'init' of null, js engine: hermes

Bug severity

Urgent

Steps to Reproduce

  1. Install latest pushwoosh-react-native-plugin: 6.1.33
  2. Run iOS project

Your Pushwoosh React Native Plugin version

6.1.32

Last worked Pushwoosh React Native Plugin version (if any)

No response

Affected platforms

Affected OS versions and/or devices

Tested on iOS Simulator iPhone 14 Pro Max

Workaround

No response

Relevant log output

No response

enginseer-dev commented 1 month ago

Hello, @davortrifunov

The Pushwoosh module was renamed to PushwooshFramework in the latest release: https://github.com/Pushwoosh/pushwoosh-react-native-plugin/releases/tag/6.1.33

To fix the issue, please, go to "Targets" -> "NotificationService" -> "Frameworks and Libraries". Delete the old "Pushwoosh.xcframework" and add "PushwooshFramework.xcframework":

Screenshot 2024-09-25 at 21 15 43

Also please note that now API token from your Pushwoosh control panel needs to be added in the info.plist file with string value and "PW_API_TOKEN" key. To official manuals are going to be updated soon.

Please update us on the result.

davortrifunov commented 1 month ago

@enginseer-dev what if this plugin is used in combination with pushwoosh-expo-plugin?

enginseer-dev commented 1 month ago

@davortrifunov The same needs to be done - API key from Pushwoosh control panel needs to be entered into the info.plist file with "PW_API_TOKEN" key and "String" data type:

image

I've tried to reproduce the issue by updating the Pushwoosh React Native plugin to 6.1.33 version in our Expo sample project - Pushwoosh initializes without any issues. Can you please try to enter the API key into your info.plist file and update us on the result?

enginseer-dev commented 1 month ago

@davortrifunov I have a follow-up question regarding the issue - do you use "npx expo prebuild" option?

davortrifunov commented 1 month ago

@enginseer-dev yes, I added the pw_api_token in both info.plist with prebuild and in app.json. I am still getting the same error.

enginseer-dev commented 1 month ago

@favalosdev, may I ask you to clarify us how do you build and launch the iOS project step-by-step?

For instance, in Expo, running the project using npx expo start might lead to the error you’re experiencing. However, using npx expo run:ios ensures a full native build, which might resolve the issue.

enginseer-dev commented 1 month ago

Hello, @davortrifunov

We haven't heard from you in the last two weeks, so we are closing this issue for now. If you are still experiencing the problem, please feel free to reach out with a step-by-step guide on how you are building and launching the iOS project.

We’ll be happy to assist further.