gpt4 book ai didi

iphone - IOS Urban Airship 。如何处理通知

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:51:21 24 4
gpt4 key购买 nike

我对这个很陌生。我实现了 Urban Airship 推送通知并且它正常工作。现在我需要实现如何处理推送通知。我想显示一个选项卡或当用户点击通知时显示。

感谢任何帮助。

这是 Urban Airship 的指令,我不知道如何实现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;

最佳答案

您将监听应用委托(delegate)方法并处理通知:

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
{
if ( application.applicationState == UIApplicationStateActive )
{
//do your handling here
}
}

如果你传入自定义的 json 对象,你也会在这里解析它

关于iphone - IOS Urban Airship 。如何处理通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10659426/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com