Description:
I tried to use OneSignal SDK with react native expo (bare-minuimum workflow) using this Link but when i cannot find any subscribers through OneSingal dashboard setup
Also, when i try to init a normal react-native-cli without expo, the installation and listening to subscribers works perfectly fine.
P.S. I tried to install for android devices
Environment
P.S.
Steps to Reproduce Issue:
Create firebase project with an android app with the correct bundle ID
Anything else:
Again, I tried all steps on expo with bare workflow since OneSignal is a native module.
an update, I tried run yarn android so that it uses react-native run-android and OneSignal was able to get the new subscriber. However, when using expo start then choose real android device, OneSignal is not going to work.
You can close if you confirm OneSignal is not supposed to run on expo emulators even though the project is expo with bare workflow
Same problem here.
Steps to Reproduce:
Create firebase project.
Create OneSignal app with Firebase Server key and Firebase sender ID
Install OneSignal SDK (yarn add react-native-onesignal)
On App the same code from https://onesignal.com/#react
Fire up the app with a real android device using yarn android and run on android
Check OneSignal dashboard for new subscribers
result:
We haven't detected any subscribed users yet for this platform. Try some of the tips below, or contact us for support. [...]
@bruiglesias dont' use expo's functionalities like expo start then 'a for android or 'i' for ios
use yarn android or yarn ios
simply run the app on react-native-cli's side
but if your project is on expo.. you will need to eject to be expo with bare-workflow from here
i'm using: yarn android
you're getting any errors?
without errors on app, but when I ckeck OneSignal dashboard for new subscribers I have: We haven't detected any subscribed users yet for this platform. Try some of the tips below, or contact us for support. [...]
I updated my steps to reproduce above.
@bruiglesias try init a normal RN project without expo and do the installation process and see if it works fine. with normal RN the installation is fine... and if it does work, you might have missed a step on your expo project
@bruiglesias if nothing works
try to follow firebase's instruction when you setup the app through firebase console
Project-level build.gradle (
buildscript {
repositories {
// Check that you have the following line (if not, add it):
google() // Google's Maven repository
}
dependencies {
...
// Add this line
classpath 'com.google.gms:google-services:4.3.4'
}
}
App-level build.gradle (
apply plugin: 'com.android.application'
// Add this line
apply plugin: 'com.google.gms.google-services'
and copy your move your google-services.json to ROOT/android/app if android and same goes for ios's instruction
@bruiglesias ,
Can you please update this issue? I'm curious whether the suggestion by @AbdulmalickDimnang worked for you.
In terms of Expo, please take a look at our documentation and make sure you followed every step carefully.
Cheers
@AbdulmalickDimnang @rgomezp the suggestion by @AbdulmalickDimnang worked for me.
glad it worked
Closed