Comments (9)
Thanks @maxs15 , i'll have a look on that.
from react-native-onesignal.
Thanks for such a quick reply @avishayil.
I think I just found the issue and the bug is in fact in the OneSignal Library.
Just before registering the push notifications I was asking for the user location (showing an alert to the user).
OneSignal had to wait for my location alert to close to show the push notification alert, and it looks like this is the root of the issue.
By removing my location alert, everything looks to work fine now ! :)
Hope it may help some people
from react-native-onesignal.
Thanks @maxs15 , do you have an idea for a PR to handle this?
from react-native-onesignal.
It looks like a bug in the OneSignal IOS SDK, not sure what we could do on our side
from react-native-onesignal.
Maybe @jkasten2 will help on this.
from react-native-onesignal.
Unfortunately it wasn't the main cause of the issue, still having some problems, but I think I finally found the issue by digging in the docs:
Note about the OneSignalIdsAvailableBlock: (https://documentation.onesignal.com/v2.0/docs/ios-sdk-api#OneSignalIdsAvailableBlock)
If you disable auto register or the user waits over 30 seconds to say yes to the system prompt then your call back will be called twice. First with just the userId field and then a 2nd time to with the push token included.
We would have to find a way to ignore this first call..
from react-native-onesignal.
I don't see any way to differentiate:
- The call when you wait 30sec (userId populated, pushToken nil)
- The call when the user refused the push (userId populated, pushToken nil)
Maybe we could send the idsAvailable result as an event ? (We could declare it in the configure options)
from react-native-onesignal.
Hi @maxs15 , that sounds reasonable.
Happy if you could help and setting up a PR for that, I'm currently busy on migrating to RN 0.29 and adding all the other functions for < RN 0.28 support.
Could you help out with this issue?
from react-native-onesignal.
sure @avishayil, I'll look at that
from react-native-onesignal.
Related Issues (20)
- [Bug]: React native - Push notifications are not received in iOS when app is running ( Foreground ) HOT 2
- [question]: Unable to start receiver com.onesignal.notifications.receivers.BootUpReceiver:
- (OneSignalNotificationServiceExtension )I got error on build with recat native sdk. How to fix it and what did i do wrong ? HOT 1
- [Bug]: Build fails with Framework not found OneSignalUser after adding onesignal. HOT 3
- [Bug]: Empty subscription id HOT 2
- [Bug]: Problem with addEventListener removeEventListener HOT 3
- [question]: OneSignal + Multi Stage/Flavour Environment HOT 1
- [Bug]: fallback to settings prompt is shown when calling requestPermission(false) HOT 1
- [Bug]: calling requestPermission() returns array with boolean HOT 1
- [question]: Can we use the same bundle ID for development and production with different OneSignal app IDs?
- [question]: How to get `getPushSubscriptionId` in the next line of code HOT 5
- [Bug]: Onesignal push notification with status Failed on iOS HOT 3
- [bug]: why is user tags not added or linked on subscriptions HOT 2
- [question]: How to customize notification prompts based on user language preference? HOT 1
- [Bug]: reactNativeOnesignal.OneSignal.clearHandlers is unedfined HOT 1
- [question]: Multiple commands produce '/Users/hamzabakaran/Library/Developer/Xcode/DerivedData/mobile..../Build/Products/Debug-iphonesimulator/.../Frameworks/OneSignalExtension.framework' HOT 3
- [Bug]: `OneSignal.Notifications.canRequestPermission` not working [Android 11, Android 12] HOT 1
- Closed
- [Bug]: opted in state stops updating on Android after app restarted HOT 6
- [question]: App stopped due to OneSignal?.Notifications?.requestPermission(true); HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-onesignal.