I've noticed that sometimes, when pressing a notification in the notification center, it opens my app but does not clear the notification from the notification center. If I go to the notification and tap it again, nothing happens. I also see this logs out:
Tried to send response for action com.apple.UNNotificationDefaultActionIdentifier more than once. origin: BulletinDestinationCoverSheet.
I'm using standard notifications (no custom UI). I also make sure to call the completion handler in:
-(void)userNotificationCenter:(UNUserNotificationCenter*)center
didReceiveNotificationResponse:(UNNotificationResponse*)response
withCompletionHandler:(void(^)(void))completionHandler
Like this:
-(void)userNotificationCenter:(UNUserNotificationCenter*)center
didReceiveNotificationResponse:(UNNotificationResponse*)response
withCompletionHandler:(void(^)(void))completionHandler
{
UNNotificationRequest *request = response.notification.request;
NSString *requestIdentifier = request.identifier;
[dataSource doLookupForID:requestIdentifier
withCompletionHandler:^(id modelObjectOrNil
{
//show UI for modelObject found for the given identifier.
//....
//call the completionhandler.
completionHandler();
}];
}