Windows Phone 8: Parsing Disabled Alerts Invalid Server Error Response

I followed the short tutorial given on the Parse.com quick start page, Push Notifications works great in my app, but the problem is the phone has no network connection, the app crashes.

System.Reflection.TargetInvocationException: An exception was thrown by the target of the invocation. ---> Parse.ParseException: Invalid response from server ---> System.ArgumentException: JSON input was invalid. Parse.Internal.Json.Parse (string input)

I tried to test the network using DeviceNetworkInformation.IsNetworkAvailable before initializing ParseClient, but it only works when there is no network connection at all. I want it to work when the server is not responding.

            ParseClient.Initialize("My App Id", "My .Net id");
            this.Startup += async (sender, args) =>
            {
                ParseAnalytics.TrackAppOpens(RootFrame);

                await ParsePush.SubscribeAsync("");
            };
            ParsePush.ToastNotificationReceived +=ParsePushOnToastNotificationReceived;

      

I am calling the code above inside application ().

+3


source to share





All Articles