iOS app now goes to story in notification.

This commit is contained in:
Samuel Clay 2016-11-18 17:37:34 -08:00
parent 5d14c0e495
commit d34e0ed041
2 changed files with 18 additions and 3 deletions

View file

@ -208,7 +208,9 @@ class MUserFeedNotification(mongo.Document):
(story['story_title'][:50], usersub.feed.feed_title[:50]))
payload = Payload(alert={'title': title,
'body': body},
custom={'story_hash': story['story_hash']})
custom={'story_hash': story['story_hash'],
'story_feed_id': story['story_feed_id'],
})
apns.gateway_server.send_notification(token, payload)
def send_android(self, story):

View file

@ -351,8 +351,21 @@
//Called to let your app know which action was selected by the user for a given notification.
-(void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)())completionHandler{
NSLog(@"User Info : %@",response.notification.request.content.userInfo);
completionHandler();
NSLog(@"User Info : %@", response.notification.request.content.userInfo);
NSString *storyHash = [response.notification.request.content.userInfo objectForKey:@"story_hash"];
NSString *storyFeedId = [response.notification.request.content.userInfo objectForKey:@"story_feed_id"];
if (!self.activeUsername) {
return;
} else {
[self.navigationController popToRootViewControllerAnimated:NO];
[self loadTryFeedDetailView:storyFeedId
withStory:storyHash
isSocial:NO
withUser:nil
showFindingStory:YES];
self.tryFeedCategory = @"feedsub";
}
}
-(void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {