-
Notifications
You must be signed in to change notification settings - Fork 263
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
Push notifications disappear if received while app not running #338
Comments
Hi David, Calling Can you give me some information about your setup, ie. what version of the iOS SDK are you using, how are you adding it as a dependency, what kind of code are you executing in the |
Also @DavideCan , can you use Command+Shift+F and search your entire project to see if you use |
hi @Nightsd01, my code is currently this
To reproduce the problem, run the app with XCode, stop the app with XCode (with the stop button ◼︎) and send a push with |
@DavideCan This does not appear to be an issue caused by the SDK, calling
|
@DavideCan Me to have the same problem not solved yet. |
Hi @Nightsd01, you're right, I created an empty project with only the OneSignal init in the But I managed to figure out what exactly is causing the problem: resetting the badge count. So as soon as a notification arrives that sets both the My momentary fix is to set
I hope I managed to make everyone understand how to reproduce the problem. |
Why was the issue closed? I think at least a paragraph should be entered on troubleshooting-ios to explain how to solve. |
Hi, I have the same problem using the Cordova SDK for iOS (which in turn uses this SDK)... Any solution/workaround? My customers are losing push notifications for this. |
We have updated the documentation to explain why this happens and how to prevent it if you don't want this behavior - most developers do but some don't. |
@Maqix The SDK would not be causing that behavior. If you can, you can zip up your project and I can take a look. |
@Maqix Also...are you setting the badge count to 0 in this latest push notification? iOS will automatically clear notifications if you set the badge count to 0. |
Push notifications disappear if received while app not runningHello everyone please try this below snippet
Note :- just need to add .list in this method so you will get disappear push notification Thanks |
Push notifications disappear if received when the app is closed by ios (you can simulate this status by stopping the app from xcode) in the background and then comes a push with
content-available
to1
. In this case iOS callsapplication:didFinishLaunchingWithOptions
before callingapplication:didReceiveRemoteNotification:fetchCompletionHandler:
.In
application:didFinishLaunchingWithOptions
, as suggested by your documentation, I callOneSignal.initWithLaunchOptions
, which in turn callsUIApplication.registerForRemoteNotifications
which will make the notification disappear as soon as it arrives.see this answer in Stack Overflow
The text was updated successfully, but these errors were encountered: