使用 Cordova Phonegap 的 Windows Phone 8 中的 Parsh 推送通知 [英] Parsh Push Notification In Windows Phone 8 using Cordova Phonegap

查看:24
本文介绍了使用 Cordova Phonegap 的 Windows Phone 8 中的 Parsh 推送通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 phonegap 为 Windows 手机使用解析集成推送通知.我使用了

然后在 NuGet 包管理器中搜索Parse"并点击安装:

然后进入你的 App.xaml.cs 文件(如截图所示):

并在 C# 文件中的所有导入之后添加以下内容:using Parse;

然后在同一个 App.xaml.cs 文件中的 App 类构造函数中添加以下内容:

this.InitializeComponent();this.Suspending += OnSuspending;ParseClient.Initialize(APP_ID_HERE, .NET_KEY_HERE);//这些值来自 Parsethis.Startup += async (sender, args) =>{ParseAnalytics.TrackAppOpens(RootFrame);等待 ParsePush.SubscribeAsync("");};

然后最后在您的 WMAppManifest.xml 中启用 ID_CAP_PUSH_NOTIFICATION 功能,如下所示:

完成所有操作后,您应该能够从 Parse 接收未经身份验证的推送通知.希望这会有所帮助,我在寻找适用于 Windows Phone 8 的 Cordova 实现时遇到了很多问题.

I am trying to integrate push notification using parse for windows phone using phonegap. I have use https://github.com/avivais/phonegap-parse-plugin this plugin and use app and client id as .NET id.

After run app in device i see record in parse. It also show one registered device.But when i send test Push from parse Backend its not receiving. :(

I have tried lot of things.But no help found from google. Please help me.Thanks in Advance.

解决方案

I am probably too late to answer this for you, but hopefully it'll be of some use for someone else. I was having an issue with this as well and decided to just not do it through Cordova, but instead utilize the .NET way provided by Parse. This is poorly elsewhere documented (except Parse) from what I've experienced, and we got frustrated doing this on Android too and ended up doing it through Java.

First, open your project folder, go into the Platforms folder and then into the WP8 folder and open that platforms Visual Studio's Solution file.

Then right click the C# Project Directory in the solution explorer as shown below. Select "Manage NuGet Packages".

Then search for "Parse" in the NuGet Package Manager and click Install:

Then go into your App.xaml.cs file (shown in the screenshot):

And add the following after all the imports in the C# file: using Parse;

Then inside the App class constructor inside the same App.xaml.cs file add the following:

this.InitializeComponent();
this.Suspending += OnSuspending;
ParseClient.Initialize(APP_ID_HERE, .NET_KEY_HERE);  // these values come from Parse

this.Startup += async (sender, args) => {
    ParseAnalytics.TrackAppOpens(RootFrame);
    await ParsePush.SubscribeAsync("");
};

Then lastly enable the ID_CAP_PUSH_NOTIFICATION capability in your WMAppManifest.xml as shown:

Once all that is done you should be able to receive unauthenticated push notifications from Parse. Hope this helps, I had a lot of issues myself finding a working Cordova implementation for Windows Phone 8.

这篇关于使用 Cordova Phonegap 的 Windows Phone 8 中的 Parsh 推送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆