菜鸟教程小白 发表于 2022-12-12 09:14:03

ios - NSNotificationCenter 是否与推送通知相关?


                                            <p><p>我正在尝试使用 NSNotificationCenter 在我的 iOS 应用中注册一些通知观察者。 NSNotificationCenter 是否与推送通知相关?我认为不是,但我想得到一些确认。</p>

<p>如果我使用 NSNotificationCenter,我需要做任何额外的事情吗?</p>

<p>在 Apple 开发者成员(member)中心的 Certificates, Identifiers & Profiles 中,每个 app ID 都有一个应用服务,即 Push Notifications。该服务被配置为启用或禁用。我认为如果我使用 NSNotificationCenter,我不需要启用该服务。我说的对吗?</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>没错,它们是不同的。 <code>NSNotificationCenter</code> 是 Cocoa 框架的基础组件,用于应用程序中的松散耦合消息传递。这个系统早于苹果推送通知的东西,你可以自由使用。</p>

<p>推送通知(本地或远程)完全通过另一种机制处理。</p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - NSNotificationCenter 是否与推送通知相关?,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/32941024/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/32941024/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - NSNotificationCenter 是否与推送通知相关?