简体   繁体   English

ReferenceError:在MobileFirst中未定义cordova

[英]ReferenceError: cordova is not defined in MobileFirst

I am developing Chat application push notification using PubNub. 我正在使用PubNub开发聊天应用程序推送通知。 I used pushnotification.js file in my Mobilefirst project as per the direction from 根据我的指示,我在Mobilefirst项目中使用了pushnotification.js文件

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

But i am getting the "ReferenceError: cordova is not defined" . 但是我收到“ ReferenceError:cordova未定义”。 How can i solve this issue in my MobileFirst Project? 我该如何在MobileFirst Project中解决此问题?

Please suggest 请建议

You are not explaining at all(!) the steps you have taken in order to set this up. 您根本不需要解释(!)设置步骤。 I am not sure what kind of support you're actually looking for with such a question. 对于这样的问题,我不确定您实际上在寻求哪种支持。

What I Can recommend you to do is to NOT use a Hybrid app for this. 我可以建议您做的是不要为此使用混合应用程序。 Instead, assuming you're using MobileFirst Platform Foundation 7.1, you can use the "pure" Cordova application type (instead of "hybrid" from MobileFirst Studio). 相反,假设您使用的是MobileFirst Platform Foundation 7.1,则可以使用“纯” Cordova应用程序类型(而不是MobileFirst Studio中的“混合”)。 With this application type you will be able to more easily follow the instructions provided in that page. 使用此应用程序类型,您将能够更轻松地遵循该页面中提供的说明。

This is because plug-man is not supported by Hybrid apps to install Cordova plug-ins, making it very difficult to get things working. 这是因为Hybrid应用程序不支持Plug-man来安装Cordova插件,因此很难正常工作。

So go ahead and follow this tutorial first: https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-1/foundation/hello-world/integrating-mfpf-sdk-in-cordova-applications/ 因此,请继续并首先遵循本教程: https : //developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-1/foundation/hello-world/integrating-mfpf-sdk-in-cordova-applications/

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

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