Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
565 views
in Technique[技术] by (71.8m points)

parse platform - Parsh Push Notification In Windows Phone 8 using Cordova Phonegap

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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".

enter image description here

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

enter image description here

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

enter image description here

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:

enter image description here

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...