Detect if the app was launched/opened from a push notification

See This code : – (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { if ( application.applicationState == UIApplicationStateInactive || application.applicationState == UIApplicationStateBackground ) { //opened from a push notification when the app was on background } } same as -(void)application:(UIApplication *)application didReceiveLocalNotification (UILocalNotification *)notification

iOS application: how to clear notifications?

Most likely because Notification Center is a relatively new feature, Apple didn’t necessarily want to push a whole new paradigm for clearing notifications. So instead, they multi-purposed [[UIApplication sharedApplication] setApplicationIconBadgeNumber: 0]; to clear said notifications. It might seem a bit weird, and Apple might provide a more intuitive way to do this in the future, … Read more

SendEmptyPushNotification to gateway.push.apple.com no longer working

Me too man. Let’s figure this out together like Apex Legends. I have submitted a TSI to Apple. They sent out an email on feb 10 saying: On March 29, 2021, token and certificate-based HTTP/2 connections to the Apple Push Notification service must incorporate the new root certificate (AAACertificateServices 5/12/2020) which replaces the old GeoTrust … Read more

What is Silent Push Notification? When does the device receive it?

They can be used to inform the application of new content without having the user informed. Instead of displaying a notification alert, the application will be awakened in background (iOS does not automatically launch your app if the user has force-quit it) and application:didReceiveRemoteNotification:fetchCompletionHandler: will be called. You then have the opportunity to process any … Read more

This certificate has an invalid issuer Apple Push Services

I think I’ve figured this one out. I imported the new WWDR Certificate that expires in 2023, but I was still getting problems building and my developer certificates were still showing the invalid issuer error. In keychain access, go to View -> Show Expired Certificates. Then in your login keychain highlight the expired WWDR Certificate … Read more

What are different types of notifications in iOS and how to configure them correctly?

EDIT: While this answer is fully applicable, there are some additions (not changes) to notifications in iOS 12. I highly recommend watching WWDC 2018: What’s New in User Notifications and read this amazing and must read article. Main changes are: grouped notifications along with summary format provisional notifications ie show notifications directly in notification center … Read more