0 Replies
      Latest reply on Sep 10, 2019 7:45 AM by Macho Man Randy Savage
      Macho Man Randy Savage Level 3 Level 3 (375 points)

        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();
             }];
        }