菜鸟教程小白 发表于 2022-12-12 15:56:24

ios - 如何在 iOS 模拟器中模拟本地/推送通知?


                                            <p><p>WatchKit 允许我们 <a href="https://developer.apple.com/library/ios/documentation/General/Conceptual/WatchKitProgrammingGuide/ConfiguringYourXcodeProject.html" rel="noreferrer noopener nofollow">simulate notifications</a>带有 <code>.apns</code> 文件。</p>

<p>如何在 iOS 应用中做同样的事情? (最好在模拟器中。)</p>

<p>我问的原因是我想在应用程序最初通过通知启动时激活调试器(即我想看看应用程序中发生了什么:didFinishLaunchingWithOptions: 方法)。如果我开始一个新的调试 session ,它会立即调用 application:didFinishLaunchingWithOptions:,然后当我点击通知时我永远无法测试该代码路径。</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>没有任何方法可以在模拟器中模拟通知。您可以调试到真实设备并发送沙盒推送通知以在 Xcode 中点击该功能。</p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 如何在 iOS 模拟器中模拟本地/推送通知?,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/31864651/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/31864651/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 如何在 iOS 模拟器中模拟本地/推送通知?