gpt4 book ai didi

ios - 在 iOS 中接收推送消息

转载 作者:行者123 更新时间:2023-11-29 02:23:37 26 4
gpt4 key购买 nike

要在 iOS 中接收推送消息,我使用以下方法:

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))handler

此方法在我的 AppDelegate.m 中。一切正常。我的问题是,这个方法是否可能不在 AppDelegate 中,而是在其他任何地方?!

最佳答案

不,这是不可能的,因为这是由 iOS 决定的。查看文档 here .

您可以做的是创建一个专用类(例如 PushNotificationHandler),该类应该用于处理您的推送通知并在 application:didReceiveRemoteNotification:fetchCompletionHandler: 中调用它。

关于ios - 在 iOS 中接收推送消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27816665/

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