TheLakshya
(Lakshya Pratap)
February 8, 2021, 4:20pm
1
Hi Team,
Onesignal Push notifcations are not working…
I can see this error in onesignal dashboard…
I think this happened only after i published app to google play
First, make sure that these values are correct If not working , try another one
I had the same problem and everything was correct, but the problem still existed until I got tired of firebase and created a new account and created a new database and the notifications became fine.
TheLakshya
(Lakshya Pratap)
February 8, 2021, 4:36pm
3
But in creator i need app ID and i have correctly placed that.
TheLakshya
(Lakshya Pratap)
February 8, 2021, 4:38pm
4
And I would like to tell you that i have already tried creating a new fresh account with all values new…but its same
oseamiya
(Oseamiya)
February 8, 2021, 5:25pm
5
Do you have uploaded google-services.json file??
This might be the problem..
1 Like
TheLakshya
(Lakshya Pratap)
February 9, 2021, 9:01am
6
Yes i have uploaded even i am using firebase authentication and that is not possible without google-services.json
oseamiya
(Oseamiya)
February 9, 2021, 9:05am
7
I have checked it and its working for me.. There might be the reason. Check
opened 08:49PM - 21 May 18 UTC
closed 02:28AM - 09 Jun 18 UTC
**Description:**
The registred device returns an error on OneSignal dashboard… , therefore unable to receive push notifications.
**Environment**
```
react-native -v
react-native-cli: 2.0.1
react-native: 0.55.4
```
package.json
```
"dependencies": {
"react": "16.3.1",
"react-native": "0.55.4",
"react-native-onesignal": "^3.2.3"
}
```
**Steps to Reproduce Issue:**
1. react-native init OneSignalTest
2. cd OneSignalTest
3. yarn install
4. yarn add react-native-onesignal
5. react-native link
6. Follow : https://documentation.onesignal.com/docs#section-android-specific-instructions
7. On android/app/build.gradle, insert `compile project(':react-native-onesignal') `on dependencies. It can't compile without that dependence.
8. On App.js class, insert the listeners : https://documentation.onesignal.com/docs#section-usage
9. On ComponentWillMount insert this OneSignal.configure(); to force a return on onIds.
on Ids listener , erase the class method and create a local one, so we can see the id.
If we didn't do it, the id would never return
```
OneSignal.addEventListener('ids', device => {
console.log('[OneSignal]>>ids: ', device);
});
```
On Init insert your app ID.
10. then : react-native run-android.
(On adb logcat it will return an error, but you will se the id on debug mode.)
11. Search the id on OneSignal Dashboard and there it is.
**Anything else:**
```
E/OneSignal(31234): Unknown error getting FCM Token
E/OneSignal(31234): java.lang.NoSuchMethodError: No static method isDeviceProtectedStorage(Landroid/content/Context;)Z in class Landroid/support/v4/content/ContextCompat; or its super classes (declaration of 'android.support.v4.content.ContextCompat' appears in /data/app/com.onesignaltest-1/base.apk)
E/OneSignal(31234): at com.google.firebase.FirebaseApp.zza(Unknown Source)
E/OneSignal(31234): at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
E/OneSignal(31234): at com.onesignal.PushRegistratorFCM.initFirebaseApp(PushRegistratorFCM.java:64)
E/OneSignal(31234): at com.onesignal.PushRegistratorFCM.getToken(PushRegistratorFCM.java:50)
E/OneSignal(31234): at com.onesignal.PushRegistratorAbstractGoogle.attemptRegistration(PushRegistratorAbstractGoogle.java:97)
E/OneSignal(31234): at com.onesignal.PushRegistratorAbstractGoogle.access$100(PushRegistratorAbstractGoogle.java:37)
E/OneSignal(31234): at com.onesignal.PushRegistratorAbstractGoogle$1.run(PushRegistratorAbstractGoogle.java:84)
E/OneSignal(31234): at java.lang.Thread.run(Thread.java:818)
```

Edit 1:
I've tried to do those, but without success:
- Update React-native OneSignal SDK to 3.2.4
- https://documentation.onesignal.com/docs/react-native-sdk-setup#section-adding-the-gradle-plugin
- #387 Add `<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>` to the AndroidManifest.xml
TheLakshya
(Lakshya Pratap)
February 12, 2021, 4:22am
8
I didn’t get it…Can u plz tell me what is the reason…it’s still not working