Git Product home page Git Product logo

Comments (11)

jkasten2 avatar jkasten2 commented on July 20, 2024

@SamerGhantous The function should only fire in two cases.

  1. Notification is tapped on.
  2. A notification is received while your app is in focus.

from react-native-onesignal.

SamerGhantous avatar SamerGhantous commented on July 20, 2024

@jkasten2 thanks for your answer,
I have tried and in the first case the onNotificationOpened event was fired and not the registered event,
and when the app is in focus no event is fired when a notification arrived at the device.
any help will be very helpful, thanks!

edit:
I'll explain a bit what I try to achieve, I want to know when the device has received the notification before the user open's it even. and I try to find the correct event to catch this notification, neither the onNotificationOpened or onNotificationRegistered helped me achieve this goal, thanks again.

from react-native-onesignal.

SamerGhantous avatar SamerGhantous commented on July 20, 2024

@jkasten2 I'm using react native 0.30.0

from react-native-onesignal.

LCD344 avatar LCD344 commented on July 20, 2024

@SamerGhantous - in my fork https://github.com/LCD344/react-native-onesignal I got the onNotificationsRegistered function working.

it's still a bit limited (it only works when app is in memory and haven't been force killed) - also I'm not maintaining the fork seriously - but if you want to see what's happening differently it could be a good place to check.

from react-native-onesignal.

tarunmarkose avatar tarunmarkose commented on July 20, 2024

@LCD344 I'm having an issue where onNotificationOpened is not being called when the app has been force killed and a push notification is tapped on. Do you know how I could fix this?

from react-native-onesignal.

LCD344 avatar LCD344 commented on July 20, 2024

Hi, yea, I encountered a problem with that. From my understanding what happens (I'm not an expert but that's the best explanation I managed to come up with) is that the android listener part doesn't fire when the app is killed - so what you need to do is try to get the app to start when you receive the notification.

To resolve this I had to override the notification creation of the onesignal files - which is pretty easy, you just have to follow the steps here - https://documentation.onesignal.com/docs/android-notification-customizations#background-data-and-notification-overriding
then within the function you just wrote, you need to make your app start using an intent... if you still find this hard, I can write you more precise instructions or show you my code.

from react-native-onesignal.

tarunmarkose avatar tarunmarkose commented on July 20, 2024

Hey @LCD344, thanks for taking the time to write this reply!

I should have mentioned though, that we are facing this issue on iOS...

On Thursday 15 September 2016, LCD344 [email protected] wrote:

Hi, yea, I encountered a problem with that. From my understanding what
happens (I'm not an expert but that's the best explanation I managed to
come up with) is that the android listener part doesn't fire when the app
is killed - so what you need to do is try to get the app to start when you
receive the notification.

To resolve this I had to override the notification creation of the
onesignal files - which is pretty easy, you just have to follow the steps
here - https://documentation.onesignal.com/docs/android-
notification-customizations#background-data-and-notification-overriding
then within the function you just wrote, you need to make your app start
using an intent... if you still find this hard, I can write you more
precise instructions or show you my code.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#67 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AHCrLKleMhs7iGOBPIvdayXfcbPbzDdXks5qqHstgaJpZM4Jee0g
.

-Tarun

from react-native-onesignal.

LCD344 avatar LCD344 commented on July 20, 2024

@tarunmarkose - lol...

Sadly, I don't even have a mac and an iphone to work with IOS (insert complains about apple making it hard for poor people to develop :P) - but I guess from my experience, the right thing to do would be to go to the original onesignal documentation, since this component is built on top of it.

from react-native-onesignal.

tarunmarkose avatar tarunmarkose commented on July 20, 2024

Haha! Thanks anyway!

On Thursday 15 September 2016, LCD344 [email protected] wrote:

@tarunmarkose https://github.com/tarunmarkose - lol...

Sadly, I don't even have a mac and an iphone to work with IOS (insert
complains about apple making it hard for poor people to develop :P) - but I
guess from my experience, the right thing to do would be to go to the
original onesignal documentation, since this component is built on top of
it.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#67 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AHCrLD-l-29ohkiBzyyxS-et7JpJHmhBks5qqT4mgaJpZM4Jee0g
.

-Tarun

from react-native-onesignal.

LCD344 avatar LCD344 commented on July 20, 2024

Keep me updated if you find a way, it will become useful once I port my app to ios

from react-native-onesignal.

avishayil avatar avishayil commented on July 20, 2024

@LCD344
It would work with the new SDK, should be out in a couple of days,

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.