0 Replies
      Latest reply on Aug 20, 2019 1:25 PM by Macho Man Randy Savage
      Macho Man Randy Savage Level 3 Level 3 (365 points)

        My app posts a local notification to the UNNotificationCenter & I  attach an image with the notification. If I press the notification in the notifcation center to launch my app, my UNUserNotificationCenterDelegate gets hit with -userNotificationCenter:userNotificationCenter:withCompletionHandler:

         

        If I dig for the attachment I provided the notification, I do get an URL, but I can't access the resource.

         

        - (void)userNotificationCenter:(UNUserNotificationCenter*)center
        didReceiveNotificationResponse:(UNNotificationResponse*)response
                 withCompletionHandler:(void(^)(void))completionHandler
        {
        
              UNNotificationRequest *request = response.notification.request;
              UNNotificationContent *content = request.content;
        
               for (UNNotificationAttachment *aAttachment in content.attachments)
               {
                  NSURL *fileURL = aAttachment.URL;
        
                 //If I attempt to do anything with the URL fails. I do get a URL (not nil) but I cannot access it. 
               }
        
        
            //....
            completionHandler();
        }

        .

        Is an app not able to do anything with a notification's attached resources?