简体   繁体   中英

C# Parse.com - Setting and deleting Push Notification Channels

In my WP8 Application I am trying to setup my channels for push notifications using Parse.com when a user logs in. For now I am just using a static channel reference to try and get this working. However my problem is that each time I call Installation.saveAsync() this creates a new installation rather than updating the installation for the device. Looking in the Data Browser I think that the problem is that the installisation seems to have no deviceToken.

I don't really know what I am doing wrong as the code I am using is coming directly from the Parse documentation. I have attached my code for initialising parse below to see if anyone can spot my error

internal async static void Initialise()
{
    ParseClient.Initialize(appId, donNetKey);
    ParseFacebookUtils.Initialize(facebookId);

    var installation = ParseInstallation.CurrentInstallation;
    installation.Channels = new List<string>() { "example" };
    await installation.SaveAsync();
}

Thanks in advance!

Not sure if this will fix your problem or not, but try resetting the badge. installation["badge"] = 0;

问题最终导致我在某些时候卸载了该应用程序,而当我再次重新安装该应用程序时,parse无法检测到该设备已经安装了该设备,因此它会创建另一个。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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