菜鸟教程小白 发表于 2022-12-11 19:54:31

ios - Swift - 在没有推送通知的情况下启动应用程序


                                            <p><p>我正在处理一个项目,该项目要求当有来自后端的通知时,它会自动从后台启动应用程序,甚至在设备重新启动后。但是,据我所知,Apple 不允许我们这样做。我做了一些研究,并且有 callkit。但是,callkit 对我来说有点太多了(因为我不需要 VOIP)。但是,我需要一些非常相似的东西(比如 whatsapp 或 hangouts )</p>

<p>流程应该是这样的:
后端通知 -> 应用程序将调用类似 whatsapp/hangouts -> 用户接受 -> 应用程序以特定 View 启动自身(根本不是调用)</p>

<p>注意:我确实尝试过推送通知。但是,推送通知需要用户的操作(实际上是点击通知),而我需要别的东西。</p>

<p>有人给我建议吗? </p>

<p>谢谢</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>如果我没记错的话,如果您不想使用 CallKit,Apple 推送通知服务是唯一可以帮助您的服务。要模拟 WhatsApp 和环聊等通话,您可以使用 Apple 新的高级通知来定制通知 UI(从 iOS 10.0 开始提供)。</p>
<p> <a href="https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/" rel="noreferrer noopener nofollow">https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/</a> </p>
<blockquote>
<p>Apple Push Notification service (APNs) is the centerpiece of the remote notifications feature. It is a robust, secure, and highly efficient service for app developers to propagate information to iOS (and, indirectly, watchOS), tvOS, and macOS devices.</p>
<p>Local notifications and remote notifications are ways to inform users when new data becomes available for your app, even when your app is not running in the foreground. For example, a messaging app might let the user know when a new message has arrived, and a calendar app might inform the user of an upcoming appointment.</p>
</blockquote>
<p>有关高级通知的更多信息:</p>
<p> <a href="https://developer.apple.com/videos/play/wwdc2016/708/" rel="noreferrer noopener nofollow">https://developer.apple.com/videos/play/wwdc2016/708/</a> </p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - Swift - 在没有推送通知的情况下启动应用程序,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/44668629/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/44668629/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - Swift - 在没有推送通知的情况下启动应用程序