Reputation: 5274
I have push notifications enabled for my app and I detect whether the app is opened from a push notification or not on didFinishLaunchingWithOptions
I want to take action based on the push notification that the user has opened the app from. So for example if the notification says "Someone has added you to their friends", opening the app from that notification would take the user to that other user's profile.
How can I achieve this?
Upvotes: 1
Views: 2903
Reputation: 794
on application:didFinishLaunchingWithOptions: method;
NSDictionary *notification = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
if (notification) {
// do something with notification
}
Upvotes: 9