菜鸟教程小白 发表于 2022-12-11 22:39:24

iphone - 如何在 APNS 中发布推送通知以及如何在 iPhone 中显示通知?


                                            <p><p>我对 APNS 有几个疑问。我正在努力澄清 APNS,但仍需要一些澄清。我必须知道<code>我们如何在 APN Server 中发布推送通知,以及我们如何将通知推送到 Apple APN Server?</code> 还有我如何接收来自 Apple 的通知并向用户显示通知?我知道我们收到了来自下方代表的通知,</p>

<pre><code>-(void)application:(UIApplication *)app didReceiveRemoteNotification:(NSDictionary *)userInfo
</code></pre>

<p><code>我们应该如何向用户显示通知</code>,请建议任何示例代码?请澄清我愚蠢的怀疑。提前致谢。请帮帮我。</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>本教程很有用,请参阅
<a href="http://mobiforge.com/developing/story/programming-apple-push-notification-services" rel="noreferrer noopener nofollow">http://mobiforge.com/developing/story/programming-apple-push-notification-services</a> </p>

<p>当您收到推送通知时,请<code>NSLog userInfo</code></p>

<pre><code>-(void)application:(UIApplication *)app didReceiveRemoteNotification:(NSDictionary *)userInfo
{
      NsLog(&#34;%@&#34;,userInfo);
}
</code></pre>

<p>推送通知仅出现一次,弹出窗口打开约 10 秒(取决于通知类型)...如果单击然后 didReceiveRemoteNotification delegte 调用,如果您无法单击任何原因看到通知,请转到设置->通知点击...并检查</p>

<p>如果您想存储总推送通知,请使用数据库并存储在您的数据库中</p></p>
                                   
                                                <p style="font-size: 20px;">关于iphone - 如何在 APNS 中发布推送通知以及如何在 iPhone 中显示通知?,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/10106416/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/10106416/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: iphone - 如何在 APNS 中发布推送通知以及如何在 iPhone 中显示通知?