Track Push Push

I have a simple news app consisting of UINavigationController, UITableViewController and UIViewController. When the application launches it, it downloads news from the Internet, and then, when it clicks on a table cell, it switches to another view to show the full article, I added push notifications. But I want to process it now, so when the user clicks on the notification, the View view appears along with this article, and if the user clicks the Back button, he will go to the News List table, can anyone help with by this?

+5
source share
1 answer

in the app: didFinishLaunchingWithOptions: you should see what's in the launchOptions dictionary. Something like that:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    โ€ฆ
    NSDictionary *userInfo = [launchOptions objectForKey: UIApplicationLaunchOptionsRemoteNotificationKey];
    if ( userInfo != nil )
        [self handlePushNotification: userInfo];

    โ€ฆ
}

Do not forget to implement:

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo

if a push message arrives while your application is running.

In the handlePushNotification: method, you must create your view stack manually, most likely with an animated: NO.

+2
source

All Articles