Reputation: 87
I am pretty new to this. I implemented the Urban Airship push notification and its working properly. Now I need to implement how to handle a push notication. I would like to show a tab or when the user clicks on the notification.
Appreciate any help.
Here is the instruction from urban airship and I dont know how to implement UAPushNotificationDelegate
.
Handling notifications
iOS handles push notifications received outside the application, but if a notification is received while the app is running, it is up to the application developer to handle it.
The sample UI includes an implementation of
UAPushNotificationDelegate
that handles alerts, sounds and badges, however if you wish to customize this behavior, you can provide your own implementation:[UAPush shared].delegate = customPushDelegate;
Upvotes: 2
Views: 1673
Reputation: 5552
You would listen for an app delegate method and handle the notification:
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
{
if ( application.applicationState == UIApplicationStateActive )
{
//do your handling here
}
}
If you pass in custom json objects you would also parse it here
Upvotes: 1