Can't get Unity SDK to connect to aws hosted parse instance (null ref in GenerateWWWInstance)

Has nobody gotten Unity SDK to work w/ self hosted Parse deployment? If I use the prescribed code, that looks like this:

    ParseClient.Initialize(new ParseClient.Configuration {
        ApplicationId = "abc123",
        Server = "http://exampe.ip.com/parse/"
    });

i get a callstack that looks like this:

>

 NullReferenceException: Object reference not set to an instance of an object
UnityEngine.WWW.FlattenedHeadersFrom (System.Collections.Generic.Dictionary`2 headers) (at C:/buildslave/unity/build/Runtime/Export/WWW.cs:118)
UnityEngine.WWW..ctor (System.String url, System.Byte[] postData, System.Collections.Generic.Dictionary`2 headers) (at C:/buildslave/unity/build/artifacts/generated/common/runtime/UtilsBindings.gen.cs:129)
Parse.Internal.HttpClient.GenerateWWWInstance (System.String uri, System.Byte[] bytes, System.Collections.Hashtable headerTable)
Parse.Internal.HttpClient+<>c__DisplayClass10+<>c__DisplayClass16.<ExecuteAsync>b__9 ()
Parse.PlatformHooks+<RunDispatcher>d__2e.MoveNext ()
UnityEngine.Debug:LogException(Exception)
Parse.<RunDispatcher>d__2e:MoveNext()

What am I missing?

Answers


I've debugged this and its due to a null value for the windowskey (aka ClientKey). Alter your initialization code to be the following and it should work:

ParseClient.Initialize(new ParseClient.Configuration {
    ApplicationId = "abc123",
    Server = "http://exampe.ip.com/parse/",
    WindowsKey = ''   //<== specify an empty string
});

in index.js:

....
var api = new ParseServer({
databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
  cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
  appId: process.env.APP_ID || 'myAppId',
  masterKey: process.env.MASTER_KEY || 'myMasterKey', //Add your master key here. Keep it secret!
  serverURL: process.env.SERVER_URL || 'http://localhost:1337/parse',  // Don't forget to change to https if needed
  clientKey: '',   <=== possibly not needed, just to be sure
  liveQuery: {
    classNames: ["Scores", "Posts", "Comments"] // List of classes to support for query subscriptions
  }
});

Need Your Help

How to write a Doxygen comment for variadic function, i.e., a function with undefined number of arguments?

php function comments doxygen variadic

I am trying to write a doxygen block comment for a function with unlimited number of parameters, then I couldn't find a right tag for it. Supplied parameters should all be strings, and they will be

How to make QR readers recognize my generated QR code?

javascript android cordova qr-code

I'm researching an idea I have for an app and it needs the ability to scan QR codes. I'm totally new to QR codes and have been looking online for a while and can't find the answer.