Is there any way to retrieve what type (local
or remote
) notification fired userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:
?
I'm working on some kind of internal analytics module for my apps. In the each app I need to send to our analytics server specific information from notification userInfo and notification type (local or remote).
To get userInfo
I'm using the following code:
- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)())completionHandler {
NSDictionary *userInfo = response.notification.request.content.userInfo;
//app-specific logic goes here
}
Of course when scheduling local notification, I can add specific parameter (to each app) to the userInfo
to retrieve notification type. But might be more clear way exists to do what I want.