rdelrosario / xamarin-plugins

Cross platform Xamarin & Windows plugins for PCLs
MIT License
179 stars 161 forks source link

Problem with OnMessage (Newtonsoft.Json.Linq.JObject values, ...) #33

Closed MKahmen closed 8 years ago

MKahmen commented 8 years ago

Hi,

public async void OnMessage (Newtonsoft.Json.Linq.JObject values, PushNotification.Plugin.Abstractions.DeviceType deviceType)
        {
            if (deviceType == DeviceType.iOS) {
                Debug.WriteLine (values.SelectToken("aps"));
        }

Gives me the following output:

{
    alert = "This is a test alert.";
    badge = 0;
    sound = default;
}

I want to parse alert but it seems like I can't since the " are missing around it, right? How can I retrieve the string This is a test alert.? Any tipps / ideas?

BR

rdelrosario commented 8 years ago

This is Android or iOS?

MKahmen commented 8 years ago

iOS. Push sent with PushSharp.

charri commented 8 years ago

Fixed with #37

rdelrosario commented 8 years ago

Thanks for the fix @charri. Will release a new NuGet package version with this fix.