ios - phonegap 推送插件不会在 iOS 上引发注册事件
<p><p>我正在使用 <a href="https://github.com/phonegap/phonegap-plugin-push" rel="noreferrer noopener nofollow">phonegap-plugin-push</a>让我的 ionic 应用程序注册和接收通知。
它在 Android 上完美运行,但在 iOS 上不会引发注册事件。</p>
<p>问题是我可以看到设备正在注册推送通知:</p>
<pre><code>00:00 4/Notify: Push Plugin register called
00:00 4/Notify: Push Plugin register success: <d4fab0e8 85074aa2 f3a33a85 d32a373f f3b5e4f6 bb94aecb 9fe3732d 77eb5c14>
</code></pre>
<p>但我的应用中从未调用过“注册”事件。</p>
<pre><code> // Initialize push notifications for iOs and Android
var pushObj = PushNotification.init({
"android": {"senderID": Constants.ANDROIDSENDERID},
"ios": {"alert": "true", "badge": "true", "sound": "true"}, "windows": {}
});
console.log('add listener push registration');
// handle push notifications
pushObj.on('registration', function (data) {
console.log('registration successful');
}
</code></pre>
<p>“注册成功”日志消息是在 Android 上编写的,而不是在 iOS 上编写的。
我已经被这个问题困扰了一天多。
有谁知道这个问题的解决方案(或可能解决方案的方向)?</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>我也遇到了同样的问题,这是位于 </p> 的源文件中的错误
<pre><code>/src/ios/PushPlugin.m
</code></pre>
<p>它已修复并已提出拉取请求。可以通过@<a href="https://github.com/phonegap-build/PushPlugin/pull/646" rel="noreferrer noopener nofollow">#646</a> 跟踪该问题。 </p>
<p>如果您可以使用非官方插件,请将此插件导入您的项目</p>
<pre><code>phonegap plugin add https://github.com/pauljacobv/PushPlugin.git
</code></pre>
<p>它可以解决这个问题。</p></p>
<p style="font-size: 20px;">关于ios - phonegap 推送插件不会在 iOS 上引发注册事件,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/33093926/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/33093926/
</a>
</p>
页:
[1]