Giter Site home page Giter Site logo

Comments (9)

avishayil avatar avishayil commented on May 26, 2024

Thanks @maxs15 , i'll have a look on that.

from react-native-onesignal.

maxs15 avatar maxs15 commented on May 26, 2024

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.

avishayil avatar avishayil commented on May 26, 2024

Thanks @maxs15 , do you have an idea for a PR to handle this?

from react-native-onesignal.

maxs15 avatar maxs15 commented on May 26, 2024

It looks like a bug in the OneSignal IOS SDK, not sure what we could do on our side

from react-native-onesignal.

avishayil avatar avishayil commented on May 26, 2024

Maybe @jkasten2 will help on this.

from react-native-onesignal.

maxs15 avatar maxs15 commented on May 26, 2024

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.

maxs15 avatar maxs15 commented on May 26, 2024

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.

avishayil avatar avishayil commented on May 26, 2024

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.

maxs15 avatar maxs15 commented on May 26, 2024

sure @avishayil, I'll look at that

from react-native-onesignal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.