parse-community / Parse-SDK-Android

The Android SDK for Parse Platform
https://parseplatform.org/
Other
1.89k stars 735 forks source link

Installation object not created #421

Open zhouhao27 opened 8 years ago

zhouhao27 commented 8 years ago

I've create an application. But the installation object has never been created.

My app looks like this:

  Parse.initialize(new Parse.Configuration.Builder(cordova.getActivity())
    .applicationId(appId)
    .clientKey("clientKey")
    .server(serverUrl) 
    .build()
  );            

ParsePush.subscribeInBackground("");

I'm using parse server. The server code:

var api = new ParseServer({
  databaseURI:  config.dbUrl,
  cloud:        __dirname + '/cloud/main.js',
  appId:        config.appId,
  masterKey:    config.masterId, 
  clientKey:    'clientKey',
  fileKey:      'optionalFileKey',
  serverURL:    config.serverUrl,
  push: {
    android: {
        senderId: '1xxxxxxxxxx3',
        apiKey: 'Axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx4'        
    },    
    ios: [
      {
        pfx: 'cert/push-dev.p12',
        bundleId: 'com.myapp.app',
        production: false
      }
    ]
  }
})

How to debug this? Thanks.

zhouhao27 commented 8 years ago

I found the PushTutorial for Android is for two years already. Any new tutorial for Android. My server is working for iOS.

thphuccoder commented 8 years ago

I got same problem. The Installation record is not created.

luongvm commented 8 years ago

problem is that the object is updated instead of created when use ParseInstallation.getCurrentInstallation().saveInBackground() so it never got created

bdbaddog commented 7 years ago

Looks like the android sdk is adding an ObjectID to the new Installation object before it's saved. When the code sees that it trys to update the object rather than creating a new one which yields the error. I'm looking at this as it's affecting me as well. Not sure where the objectid is coming from as locally assigned objectIds are supposed to start with local_

paveldimov commented 7 years ago

any ideas on how that could be avoided ?