Closed AllyssonAlas closed 3 years ago
UPDATE:
Errors from Android Studio's Logcat (filtered with "onesignal" keyword):
2021-01-26 17:11:49.736 3144-3365/? E/OneSignal: Cannot change requiresUserPrivacyConsent() from TRUE to FALSE
2021-01-26 17:11:49.737 3144-3365/? W/OneSignal: appContext set, but please call setAppId(appId) with a valid appId to complete OneSignal init!
2021-01-26 17:11:51.116 3144-3365/? V/OneSignal: setAppId called with id: 8fe68dc0-52b2-4c44-a788-1a66778d2e0a changing id from: null
2021-01-26 17:11:51.117 3144-3365/? V/OneSignal: Starting OneSignal initialization!
2021-01-26 17:11:51.120 3144-3365/? V/OneSignal: No class found, not setting up OSRemoteNotificationReceivedHandler
2021-01-26 17:11:51.121 3144-3365/? V/OneSignal: OneSignal SDK initialization delayed, waiting for privacy consent to be set.
2021-01-26 17:11:51.123 3144-3365/? E/OneSignal: Cannot change requiresUserPrivacyConsent() from TRUE to FALSE
2021-01-26 17:20:21.576 3144-3144/? D/OneSignal: onActivityPaused: com.testworkshop.MainActivity@43f3963
2021-01-26 17:20:21.576 3144-3144/? D/OneSignal: curActivity is NOW: null
2021-01-26 17:20:21.643 3144-3144/? D/OneSignal: onActivityStopped: com.testworkshop.MainActivity@43f3963
2021-01-26 17:20:21.643 3144-3144/? D/OneSignal: curActivity is NOW: null
2021-01-26 17:20:22.414 3144-3144/? D/OneSignal: onActivityDestroyed: com.testworkshop.MainActivity@43f3963
2021-01-26 17:20:22.414 3144-3144/? D/OneSignal: curActivity is NOW: null
Yeah same issue. Any work arounds?
Howdy, The issue is you are requiring privacy consent but you are not setting the consent to granted.
I.e: if you use the function setRequiresUserPrivacyConsent
you need to actually provide consent via provideUserConsent
.
Take a look at our React Native documentation for more info.
Enjoy!
Thx, it worked! But why isn't this in the quickstart section?
Howdy, The quickstart section is aimed to help set up your app with OneSignal. For details regarding specific functions, please see the main SDK reference.
Enjoy!
hey I used promptForPushNotificationsWithUserResponse
to prompt and successfully registered my ios devices. But when I push notification, there are nothing showing up on iphone, android works perfect with no issues at all. Any ideas?
Description: Just making a very small sample to later on install One Signal on my projects, so i copied and pasted the code from install guide docs and put it on a function and just call inside of an useEffect, I'm using the button to call the function just to test purposes.
Environment react: 16.13.1 react-native" 0.63.4, react-native-onesignal: 4.0.3
installed by node using the docs: https://documentation.onesignal.com/docs/react-native-sdk-setup
Steps to Reproduce Issue: Just install and start the project
Anything else: The console.log is showing this string: "promptForPushNotificationsWithUserResponse: this function is not supported on Android" OneSignal.getDeviceState function is returning this object:
{isEmailSubscribed: false, isSubscribed: false, isPushDisabled: false, hasNotificationPermission: true}
Adb logcat is showing this when app starts: