Reputation: 335
In my windows phone app I've integrated Parse version 1.7.0 and I'm developing for windows phone 8.0 and above. I've followed the instructions in parse.com and I'm getting the exception:
System.ArgumentNullException: Value cannot be null. Parameter name: uriString
at System.Uri..ctor(String uriString)
at Parse.Internal.ParseCommand..ctor(String relativeUri, String method, String sessionToken, IList`1 headers, Stream stream, String contentType)
at Parse.Internal.ParseCommand..ctor(String relativeUri, String method, String sessionToken, IList`1 headers, IDictionary`2 data)
at Parse.Internal.ParseAnalyticsController.TrackAppOpenedAsync(String pushHash, String sessionToken, CancellationToken cancellationToken)
at Parse.ParseAnalytics.TrackAppOpenedWithPushHashAsync(String pushHash)
at Parse.ParseAnalytics.TrackAppOpenedAsync()
at xxxx.App.<Application_Launching>d__5.MoveNext()
and the code where exception is coming is
try{
await ParseAnalytics.TrackAppOpenedAsync();
}
catch (Exception ex){
Debug.WriteLine("Exception in Parse Initialise \n" + ex.Message);
}
But working fine in emulator...
Upvotes: 1
Views: 68
Reputation: 151690
My best guess, clicking around a bit in the docs and looking at the exception message, you've failed to properly initialize the Parse SDK.
From their Quickstart for Windows Phone, "New Project", first code block shown is:
public App()
{
// (existing project code here)
ParseClient.Initialize("APPLICATION ID", ".NET KEY");
}
I can only assume that this will initialize some static variables, such as the URI to post Parse messages to, and that this is missing from your app.
That being said, I stand by my earlier comment: of course it would be better if a library like this threw an ConfigurationErrorsException or InvalidOperationException like "Cannot find AppSettings key X" or "Call (the initialization method) first", instead of blindly passing an uninitialized variable and letting framework code throw an exception.
Upvotes: 2