简体   繁体   English

PubNub JavaScript SDK:PNmessage未定义

[英]PubNub JavaScript SDK: PNmessage is not defined

I'm trying to follow this tutorial for sending Push Messages using PubNub JavaScript SDK - https://www.pubnub.com/docs/swift/mobile-gateway#Publishing_to_APNS 我试图按照本教程中使用JavaScript的PubNub SDK发送推送消息- https://www.pubnub.com/docs/swift/mobile-gateway#Publishing_to_APNS

However, when I try to run the page in the browser, I get the following error: 但是,当我尝试在浏览器中运行页面时,出现以下错误:

Uncaught ReferenceError: PNmessage is not defined

A quick Google brought this answer - https://www.pubnub.com/community/discussion/501/phonegap-android-gcm-push-notification-error-pnmessage-is-undefined but it didn't really solve my problem even using the latest JavaScript SDK (3.9.2). 一个快速的Google带来了这个答案-https: //www.pubnub.com/community/discussion/501/phonegap-android-gcm-push-notification-error-pnmessage-is-undefined,但是它甚至没有真正解决我的问题使用最新的JavaScript SDK(3.9.2)。

I also can't post new questions on the PubNub Developer Community so I am trying my luck here. 我也无法在PubNub开发者社区上发布新问题,因此我在这里很幸运。 Anyone with the similar experience and has a workaround to this problem? 任何有类似经验并有解决此问题的方法?

Android Push Notifications Android推送通知

A step-by-step tutorial for Google Cloud Messaging to Android using PhoneGap. 使用PhoneGap的Google Cloud Messaging到Android的分步教程。

https://www.pubnub.com/blog/2014-12-18-sending-android-push-notifications-via-gcm-javascript-using-phonegap/ https://www.pubnub.com/blog/2014-12-18-sending-android-push-notifications-via-gcm-javascript-using-phonegap/

iOS Push Notifications iOS推送通知

A step-by-step tutorial how to send and receive iOS push notifications for devices via APNS. 分步教程,介绍如何通过APNS发送和接收设备的iOS推送通知。

https://www.pubnub.com/blog/2014-12-22-sending-ios-push-notifications-via-apns-javascript-using-apns-phonegap/ https://www.pubnub.com/blog/2014-12-22-sending-ios-push-notifications-via-apns-javascript-using-apns-phonegap/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM