使用 Parse 的 Cordova Push Notification 在应用程序打开时在应用程序关闭时或在后台工作时不起作用 Window Phone

Cordova Push Notification using Parse not working when app is Open when App is closed or in background it is working in Window Phone

我在 windows phone 中创建了 Cordova。一切正常。 但现在我已经使用 Parse 集成了推送通知。我配置正确。但现在我只有在我的应用程序处于后台或关闭时才会收到推送。但是当我的应用程序打开时我没有收到推送通知。

我用过this插件。

终于找到答案了。 我已删除旧插件并安装 https://github.com/cookys/parse-push-plugin 并在 App.xaml.cs 文件

中添加以下代码
 // Parse initialization
        ParseClient.Initialize("APP_ID", ".NET_KEY");

        this.Startup += async (sender, args) =>
        {
            ParseAnalytics.TrackAppOpens(RootFrame);
            await ParseInstallation.CurrentInstallation.SaveAsync();
        };

它对我有用。 :)