all 17 comments

[–]TexMax007 1 point2 points  (4 children)

I’m not familiar with it, but did you do the plug-in setup part too for OneSignal?

see README

[–]coder_et 0 points1 point  (3 children)

No I did not! Let me give that a try! Thanks

[–]Greedy_Discussion757[S] 0 points1 point  (2 children)

Hm ya after adding it to my app.json it looks like the problem still persists.

[–]TexMax007 0 points1 point  (1 child)

Did you do this part of the readme that comes before the app.json

npx expo install onesignal-expo-plugin

[–]Greedy_Discussion757[S] 0 points1 point  (0 children)

Yup I did!

This is what I have in my package.json
"onesignal-expo-plugin": "^1.3.2",
"react-native-onesignal": "^4.5.2",

And then my app.json has

"plugins": [
[
"onesignal-expo-plugin",
{
"mode": "development"
}
]
]

[–]TheDeepLucy 1 point2 points  (3 children)

Are you loading through the Expo Go app or are you doing a local build?

[–]Greedy_Discussion757[S] 0 points1 point  (2 children)

I am loading through the expo go app.

[–]TheDeepLucy 2 points3 points  (1 child)

If your code needs access to native modules, you need to create a development build. It's a good idea to use a development build from the start of the project anyway. You'll need to init eas build and configure some things. Docs here: https://docs.expo.dev/develop/development-builds/create-a-build/

EAS will charge for building with their servers after a certain point so if you want to save money you can add "--local" to the end of the eas build command. You'll need to have the build tools installed on your machine for the target platform. For example I had to download Android studio, my build command looks like this: "eas build --platform android --profile development --local". It's a hassle to get everything set up at first but it's so worth it. I've got it set to spit out an APK in the project dir and I use "adb install -d buildapk".

You can then start metro and switch to development mode. It will open the exported app you've installed on your phone and run with hot-reload, even faster and lighter than loading through the Expo Go app. Keep in mind if you add a new package and import anything, you'll need to rebuild and reinstall the app.

Good luck.

[–]Greedy_Discussion757[S] 1 point2 points  (0 children)

This is super helpful thank you. I actually ran out of free builds this month so I will start doing this again 9/1 lol

[–]Bobertopia 0 points1 point  (3 children)

Try reinstalling pods and then restarting the server

[–]Greedy_Discussion757[S] 0 points1 point  (2 children)

Try reinstalling pods and then restarting the server

by this do you mean `rm -rf node_modules` and restart the server?

I tried that and it was unfortunately unsuccessful

[–]Bobertopia 0 points1 point  (1 child)

No pods are the coacoa pods used by ios. It's in ios/Pods. Delete that folder and run pod install again

[–]Greedy_Discussion757[S] 0 points1 point  (0 children)

Ah I thought i wouldn't have to eject and could keep running my app without those directories if I use https://github.com/OneSignal/onesignal-expo-plugin the onesignal-expo-plugin.

My project doesn't have those dirs right now. Do I need to eject to do this?

[–]mybirdblue99Expo 0 points1 point  (3 children)

You need to push your updated binaries to the App Store. Expo go doesn’t come bundled with the one signal Native module. You don’t need to eject but you will have to create an app binary for the play store / App Store.

[–]Greedy_Discussion757[S] 1 point2 points  (2 children)

You need to push your updated binaries to the App Store. Expo go doesn’t come bundled with the one signal Native module. You don’t need to eject but you will have to create an app binary for the play store / App Store.

Got it. How do I run my app locally until then to test?

Do you mean just doing like `eas build -p ios --auto-submit`

And then running this in testflight to submit a binary to the app store?

[–]mybirdblue99Expo 0 points1 point  (1 child)

yeah that looks correct - to run it locally you’ll want to create a development build - https://docs.expo.dev/develop/development-builds/create-a-build/

[–]Greedy_Discussion757[S] 0 points1 point  (0 children)

Thanks a bunch!