Comments (6)
To increment the badge count when a notification is received you can set ios_badgeType
to "Increase" and ios_badgeCount
to 1. Our SDK should be resetting the badge count back to 0 each time the app is opened / resumed automatically. I haven't seen any bugs with this is it is more likely another plugin / SDK code be interfering. Can you try to reproduce the issue in a new project? Let us know the steps to reproduce the issue if you're still seeing it.
You can set content_available
to true on OneSignal to wake up your app in the background. It will fire the application:didReceiveRemoteNotification:fetchCompletionHandler: selector in your app's code.
Thanks.
from onesignal-ios-sdk.
That's not what I'm experiencing. When I enter the app, the increment count is not reset. It might be that it's reset if you open the app by clicking the notification, but not if you open the app like normal.ย
All the best
Holger Sindbaek ยท UI/UX Designer & Web/iOS Programmer ยท HolgerSindbaek.com
On Fri, Feb 12, 2016 at 2:07 PM -0800, "Josh Kasten" [email protected] wrote:
To increment the badge count when a notification is received you can set ios_badgeType to "Increase" and ios_badgeCount to 1. Our SDK should be resetting the badge count back to 0 each time the app is opened / resumed automatically. I haven't seen any bugs with this is it is more likely another plugin / SDK code be interfering. Can you try to reproduce the issue in a new project? Let us know the steps to reproduce the issue if you're still seeing it.
You can set content_available to true on OneSignal to wake up your app in the background. It will fire the application:didReceiveRemoteNotification:fetchCompletionHandler: selector in your app's code.
Thanks.
โ
Reply to this email directly or view it on GitHub.
from onesignal-ios-sdk.
The only issue I can see where the badge counter would not be cleared is if you were not calling initWithLaunchOptions from the application:didFinishLaunchingWithOptions: selector in your app or there is another plugin / SDK or code changing the value.
We have a clearBadgeCount internal function that is called in a number of locations to make sure the badge is cleared. It includes the follow events.
- An app cold start from either tapping on a notification or tapping on the app icon. Called from it application:didFinishLaunchingWithOptions: as long as initWithLaunchOptions is called from it.
- When focus is resumed to the app from any event. Our SDK hooks into applicationWillResignActive: where this function is called.
- A OneSignal notification event is fired. Anytime a OneSignal notification is counted as open from either tapping on one or one is received while the app is in focus.
Can you post a project reproducing the issue along with the iOS version you're testing on with step by step instructions reproducing the issue?
Thanks.
from onesignal-ios-sdk.
I was setting "applicationIconBadgeNumber" manually different places. I think that had some unexpected consequences.
I've taken that away now and it's working perfectly.
from onesignal-ios-sdk.
@jkasten2 , @ALL hi ,
how to set content_available
in application:didReceiveRemoteNotification:fetchCompletionHandler
??? , What code is it? i don't know! i search about and, There is no explanation for this
please help me, Thanx
from onesignal-ios-sdk.
@AmirDaliri application:didReceiveRemoteNotification:fetchCompletionHandler
will fire when a notification is received with content_available
set to true
from OneSignal. See Apple's docs below for more detail on this method.
https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623013-application
There is another issue open related to syncing badge counts you can follow bellow.
#57
from onesignal-ios-sdk.
Related Issues (20)
- [Bug]: IAM with SwiftUI HOT 1
- [Bug]: iOS 17 Incorrect data reporting HOT 1
- [Bug]: Dashboard reports incorrect device info for devices sharing account
- [Bug]: Inconsistent Badge Count Incrementation after Reset HOT 8
- [Bug]: Resuming an NSURLSessionTask with nil URL HOT 5
- [Bug]: Not handling unsupported languages gracefully HOT 5
- [Bug]: incomplete migration guide to 5. HOT 9
- Localization error HOT 1
- [question]: dyld[3745]: Library not loaded: HOT 1
- [question]: `macOS` support HOT 2
- [Bug]: Silent notifications HOT 23
- Handle tap on push notification HOT 2
- [Bug]: Is NOT allowed to set HSTS for main doc HOT 3
- [question]: How to disable push notification request (ios) HOT 1
- [Bug]: OneSignalUserDefaults Crash HOT 6
- [Bug]: OneSignalCore NSKeyedArchiver Crash HOT 1
- [Bug]: [OneSignalRequest urlRequest] Crash HOT 4
- [Bug]: OneSignalOSCore __swift_instantiateConcreteTypeFromMangledName Crash HOT 6
- [Bug]: [OneSignal startNewSessionInternal] Crash HOT 9
- [Bug]: Asset validation failed (50) The app references non-public selectors in Payload/Runner.app/Frameworks/OneSignalFramework.framework/OneSignalFramework: setSharedInstance HOT 5
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 onesignal-ios-sdk.