【问题标题】:Cordova Tools for Visual Studio - PushNotification has no method init用于 Visual Studio 的 Cordova 工具 - PushNotification 没有方法 init
【发布时间】:2015-12-03 17:30:29
【问题描述】:

我正在尝试在 Visual Studio 中创建一个 Cordova 应用程序,它将接收来自 Azure 移动服务的推送通知。我正在使用这个插件:https://github.com/phonegap/phonegap-plugin-push/

我通过打开 config -> Plugins -> Custom 并输入上面的 GitHub 地址来安装它。它安装得很好,但我一定遗漏了一些东西,因为这段代码不起作用:

document.addEventListener('deviceready', function () {
    mobileServiceClient = new WindowsAzure.MobileServiceClient(
                'AZURE_MOBILE_URL',
                'MY_API_KEY');
// Create a new PushNotification and start registration with the PNS.
var pushNotification = PushNotification.init({
    "android": { "senderID": MY_SEND£ER_ID}
});

在 Goolgle Android 模拟器中运行,它说 init 不是函数。

【问题讨论】:

    标签: azure-mobile-services visual-studio-cordova


    【解决方案1】:

    听起来好像插件没有正确安装。我经常把我的整个项目都删了,重新得到源代码,然后重新添加插件

    有时获取插件的本地副本也会有所帮助

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-10-19
      • 1970-01-01
      • 1970-01-01
      • 2019-03-03
      • 2015-04-04
      相关资源
      最近更新 更多