0

我搜索了我的问题并没有找到答案。所以我正在使用城市飞艇来推送通知,它工作正常。所以现在我想做这个:当用户点击通知打开应用程序时,我想在 uialertview 中再次给他通知文本。那么我可以在哪里获取通知文本?我可以用这种方法吗

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

 UIApplicationState appState = UIApplicationStateActive;
    if ([application respondsToSelector:@selector(applicationState)]) {
        appState = application.applicationState;
    }

    [[UAPush shared] handleNotification:userInfo applicationState:appState];
    [[UAPush shared] resetBadge];}

非常感谢你。

4

1 回答 1

0

我可以阅读打开我的应用程序的推送通知didReceiveRemoteNotification:(NSDictionary *)userInfo- 这是我的didReceiveRemoteNotification

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

    // TestFlight API
    TESTFLIGHT_CHECKPOINT(@"Receive Remote Notification");

    // Urban Airship
    [[UAPush shared] handleNotification:userInfo applicationState:application.applicationState];
    NSLog(@"userInfo: %@",userInfo);
    [UAInboxPushHandler handleNotification:userInfo];
}

当我从 aps 通知启动我的应用程序时,我在调试窗口中有这个:

2013-01-17 20:52:49:947 iFlightBag[8229:2311] -[AppDelegate_Shared application:didReceiveRemoteNotification:] [Line 2403] userInfo: {
    "_" = "l0-mgGElEeKbHAAbIbyL6A";
    aps =     {
        alert = "Manual: IOM update 2013-01-17T20:14:42-08:00";
        badge = 0;
    };
    operation = update;
    tab = manuals;
}
于 2013-01-18T04:56:28.543 回答