-
Notifications
You must be signed in to change notification settings - Fork 368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The callback idsAvailable() exists in module RNOneSignal but only one callback may be registered #47
Comments
Thanks @maxs15 , i'll have a look on that. |
Thanks for such a quick reply @avishayil. |
Thanks @maxs15 , do you have an idea for a PR to handle this? |
It looks like a bug in the OneSignal IOS SDK, not sure what we could do on our side |
Maybe @jkasten2 will help on this. |
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)
We would have to find a way to ignore this first call.. |
I don't see any way to differentiate:
Maybe we could send the idsAvailable result as an event ? (We could declare it in the configure options) |
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? |
sure @avishayil, I'll look at that |
Hey guys,
I discovered an error that is happening when using
![](https://cloud.githubusercontent.com/assets/1653525/16179386/120a965c-3632-11e6-9a22-5d59db45185f.jpg)
registerForPushNotifications
andidsAvailable
I'm getting this RN error:
My code is as simple as that:
I found out that the issue is related to the idsAvailable method in RCTOneSignal.m.
The callback registered in [oneSignal IdsAvailable:callback] is called twice (The first time without pushToken and the second time with a pushToken)
The issue is that it'll call the RN callback twice, and RN only authorize the callback to be called once in a method.
I'm trying to find a fix.. I guess we should call the idsAvailable method after the push has been successfully registered (or declined).
@avishayil, any idea how we could fix that ?
Thanks,
The text was updated successfully, but these errors were encountered: