IOS - 在应用程序在后台时通过UNNotificationAction触发发送HTTP请求

3
我正在使用自定义操作(接受、拒绝)的通知内容扩展。当我点击拒绝时,我尝试向我的服务器发送https请求,但一直收到-1009错误(似乎网络连接已断开)。应用程序已设置使用后台模式。在后台是否可能运行任何网络调用?

https://developer.apple.com/documentation/uikit/core_app/managing_your_app_s_life_cycle/preparing_your_app_to_run_in_the_background/https://developer.apple.com/documentation/uikit/core_app/managing_your_app_s_life_cycle/preparing_your_app_to_run_in_the_background/extending_your_app_s_background_execution_timeextending_your_app_s_background_execution_time - Nordeast
1个回答

2

我的错。 问题在于在等待我的REST响应之前调用了completionHandler。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接