objective c - iOS: How to get all of the push notification userinfo while your App is completely closed and reopened? -
i not sure if possible, need grab of push notification userinfo when user opens app. can of push notification userinfo when app opened or in background, not when app closed. way around this? code below how userinfo currently.
- (void)application:(uiapplication *)application didreceiveremotenotification:(nsdictionary *)userinfo { id data = [userinfo objectforkey:@"data"]; nslog(@"data%@",data); }
unfortunately, it's not possible client side method query old notifications have occurred while app closed. see question: didreceiveremotenotification when in background.
a way around keep track of notifications send server per user. when didreceiveremotenotification:
called, can take notification , compare against server's messages current user. if 1 of them matches, mark way on server. way, if there messages sent when app backgrounded, can query messages haven't been marked server , 'missed' notifications.
Comments
Post a Comment