Comments (11)
@SamerGhantous The function should only fire in two cases.
- Notification is tapped on.
- A notification is received while your app is in focus.
from react-native-onesignal.
@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.
@jkasten2 I'm using react native 0.30.0
from react-native-onesignal.
@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.
@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.
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.
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.
@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.
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.
Keep me updated if you find a way, it will become useful once I port my app to ios
from react-native-onesignal.
@LCD344
It would work with the new SDK, should be out in a couple of days,
from react-native-onesignal.
Related Issues (20)
- [Bug]: External Id is not getting set HOT 1
- [Bug]: Cycle inside SampleProject; building could produce unreliable results HOT 3
- [Bug]: addTag could not be invoked HOT 3
- [Bug]: react native App Crashes in Android device Only, works on emulator HOT 1
- [Bug]: canRequestPermission is not working as expected HOT 3
- [Bug]: Missing API declaration HOT 3
- [Bug]: Can not build at AppCenter HOT 1
- [question]: Issue with Push Notifications in App Store Builds HOT 1
- iOS: Badge not showing HOT 2
- [Bug]: In v5, the Subscription Status does not change to 'Subscribed'. HOT 9
- [Bug]: permissionChange listener is not giving the correct hasPermission value until background/foreground HOT 3
- [question]: getIdAsync is returning null with latest SDK HOT 6
- [Bug]: Dependency problem while adding onesignal to an existing react native project HOT 3
- [Bug]: Incorrectly returning notification permission data until you close and open the app
- [question]: Even though I followed all the instructions, the icon does not change
- [Bug]: NotificationClickEvent returning `launchUrl` instead of `launchURL` (on Android) HOT 7
- [Bug]: Incorrect Typing for launchUrl in OSNotification HOT 1
- [Bug]: Erroneous "Usage Duration" for Android subscriptions in SDK 5.2.0 HOT 1
- [Feedback]: canRequestPermission should probably return false on Android versions < 13 HOT 1
- [Bug]: No type or protocol named 'OSUser' and 'OSLiveActivities' HOT 9
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.