-
Notifications
You must be signed in to change notification settings - Fork 368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
An error is shown when running init from iOS - RNOneSignal.initWithAppId undefined is not an object #499
Comments
+1, i have same problem
i call |
+1 "react-native-onesignal": "^3.2.1" |
+1 Just tried this functionality as well on 3.2.1, except OneSignal seemingly does nothing on |
@dorshay6 @mnshkv @podvipodvert Are any of you trying to run in Expo? We recently updated the SDK so that it would silently do nothing (not crash, not function, etc) in the Expo client. It will basically stay uninitialized until you detach from Expo and run it natively. However it looks like we didn't add this check to the |
In any case, this indicates that the RNOneSignal native event emitter isn't getting initialized somehow. The only environment I know that would cause this would be Expo |
Not in expo, might be a bad install? cant find where I'm wrong |
It could be a linking issue. Are you sure you ran Can you import RCTOneSignal.h in the AppDelegate and use the native method to initialize? The old native initialization method is deprecated but it still works. |
I did run the link but it didn't help, will try to import later |
same problem "react-native": "0.50.4", "react-native-onesignal": "^3.2.1", |
Hi Guys, I solve this problem. You just need |
@podvipodvert Do you have the next line in your podfile |
@dorshay6 yes |
@Nightsd01 Can you please share the the docs for native init in iOS? cant find them in this repo |
@podvipodvert can you please tell me more about this step |
Hey guys, after running |
@dorshay6 Version 3.2.2 fixes our Podspec that would have caused compiler issues with cocoapods. But really you shouldn't need to use cocoapods unless all of your other dependencies are installed with it. Otherwise just use npm and react linking. To anyone who is still having this issue, please do one of two things:
|
Was anyone able to make this work? I just had the 3.2.2 version and I made it work on Android by adding the |
@dorshay6 Please let me know if 3.2.3 resolves this issue for you |
Just fixed this on my end. After installing |
That sounds like an Xcode pbxproject linking issue - it happens. Usually you can literally just replace the static library (like libOneSignal.a) and Xcode will be able to link to it just fine. I'm closing this issue because it should be fixed by 3.2.3 - please feel free to respond if you are still encountering this problem and I'll be happy to reopen the issue & investigate! |
@Nightsd01 Solved for me thanks |
I have solved it by linking library manually. |
@Nightsd01, I need some help. |
@matias91 have a look at this portion of the doc. |
@matias91 yeah, @shafayeatsumit's link is what you should do. Basically you need to drag the RCTOneSignal.xcodeproj file (from node_modules) into your Xcode project and then link the library in your target's Link Binary with Libraries section |
Thanks for the answers, @shafayeatsumit and @Nightsd01. |
Thanks @shafayeatsumit, that did the trick for me! This happened to me when I uninstalled the package because It was messed up due to updating. I installed it again and manually linking it fixed it. 👍 |
You have to add (libRCTOneSignal.a) to your main application target also. |
add "libRCTOneSignal.a" in main project -> Build Phases -> Link Binary with Libararies |
Description:
An error is shown when running init from iOS, Android is good
Environment
Steps to Reproduce Issue:
The text was updated successfully, but these errors were encountered: