Move to RCTEventEmitter, unified JS initialization and more. #395
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
I have recently needed to bring support for OneSignal to RN app which I'm working on and logically the first thing what I tried was this library - react-native-onesignal. Unfortunately, I was facing many issues, that was related to the setup of my app where I use for example react-native-navigation or redux-saga. The other thing is that the react-native-onesignal has many things implemented in way that is very different to that we can see in native onesignal library for iOS and Android and some things aren't implemented at all. I think that it's not good as on one side it's confusing for someone who wants to use this library. On the other side, it has to be very difficult to maintain it, particularly when there is some change in the native one's libs.
So for that reasons I have decided to look under the hood and try to solve some of that. Now I would like to show off what I have done for now and hear what do you think about that. Eventually, I will be more than happy to collaborate on merging it.
So now something about the changes.
OneSignal.init(Constants.oneSignalAppId, { autoPrompt: true });
this line have to be added to the main index.js of your app and it's all. No need to change something in Xcode or Android studio 🙂.async/await
syntax can be used now etc..It still needs some work (documentation, ..) but I believe that the changes are meaningful.
Thanks.
PS: Sorry for the awkward title of PR.
This change is