mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
iOS app now goes to story in notification.
This commit is contained in:
parent
5d14c0e495
commit
d34e0ed041
2 changed files with 18 additions and 3 deletions
|
@ -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):
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue