Than app received the push and the app is not running I need to call a network method to my API. I need to do it silently without any interactions from user(like clicking notification or someting else - without it)
I set the content-available key in your push payload to 1.
How can I do it?
I implemented
func application( application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject], fetchCompletionHandler handler: (UIBackgroundFetchResult) -> Void) {
And as a test I added
UIApplication.sharedApplication().applicationIconBadgeNumber = 20
But looks like it is not working because then I close my app and send a test notification , the bagde number is not 20