Install OneSignal push notifications on the IOS side of a detached project

I ran into a lot of trouble adding OneSignal notification to the IOS side of my detached project, so i thought I’d share.

Not sure i recommend this, cause it a bit hacky… usually when you are having to go through all this trouble your best choice it to move to another repo…
The repo:

Here is how I made it work:
1.- npm instal and link. (link not cocoa, even though it’s against expo recommendations)
2.- Follow installation steps from the repo
4.- Let it run (it’s going to fail)
5.- An RCTConvert file is going to complain that its missing Yoga. Locate the folder containing RCTConvert and keep it in an open finder window.
6.- In native_modules, or in react, look the Yoga.h file, it lives in a Yoga folder containing 5 other support files. copy it.
7.- Paste it where RCT convert lives.
8.- Run it, it’s still going to fail. missing some files that it wants to import.
9.- Look for the issue, remove React/ from the import line code. run it again. (will fail again)
10.- It’s going to be the same issue, in a different import, so do the same.
11.- And again… be patient, it will happen 5-6 times. After that, it should build, link… work.
12.- :slight_smile:
The Android install is a lot better.
I hope that helps.

4 Likes

Thanks for sharing how you made this work!

I’ve created another issue here https://github.com/geektimecoil/react-native-onesignal/issues/306
Because this solution is very tricky and hacky like you said :slight_smile: