extract alert from urban airship userinfo

100 views Asked by At

Inside the method

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

How do I extract the alert value from the dictionary UserInfo? I believe the dictionary might look something like

  {
    "_" = "l0-mgGElEeKbHAAbIbyL6A";
    aps =     {
        alert = "Manual: IOM update 2013-01-17T20:14:42-08:00";
        badge = 0;
    };
    operation = update;
    tab = manuals;
}

Is this really always the case? Or does Urban Airship provide a method for doing this? which would really be ideal.

UPDATE

Based on feedback by @Spynet

It seems that by alert what I really mean is the actual text message, which in the case where the alert itself is a dictionary may be called the body of the alert. All the same, does Urban Airship provide a method for extracting such information? Or must I roll out my own? If my own, has anyone done this successfully? Thanks.

1

There are 1 answers

0
Konsol Labapen On

Actually urban airship does take care of it for you. Simple implement the protocol UAPushNotificationDelegate and method

- (void)displayNotificationAlert:(NSString *)alertMessage;