简体   繁体   中英

java/parse error. trying to send from android sdk to Parse

set up this for another app few days ago and it worked fine, results successfully sent to MongoLab. tried to do it again for a new app using the same basic code below, but it fails everytime.

Any ideas? Thanks!

 @Override
  public void onCreate() {
    super.onCreate();

    // Enable Local Datastore.
    Parse.enableLocalDatastore(this);

    // Add your initialization code here
    Parse.initialize(new Parse.Configuration.Builder(getApplicationContext())
            .applicationId("abc123")
            .clientKey(null)
            .server("http://abc123.herokuapp.com/parse/")
    .build()
    );

      ParseObject gameScore = new ParseObject("GameScore");
      gameScore.put("score", 1337);
      gameScore.put("playerName", "Sean Plott");
      gameScore.put("cheatMode", false);
      gameScore.saveInBackground(new SaveCallback() {
          public void done(ParseException e) {
              if (e == null) {
                  Log.i("Parse", "Save Succeeded");
              } else {
                  Log.i("Parse", "Save Failed");
              }
          }
      });

------the logs show this at the end---------

D/InputMethodManagerService: ime_enabled = false is same as last value, no change
W/InputMethodManagerService: Got RemoteException sending setActive(false) notification to pid 23566 uid 10087
I/ActivityManager: Displayed com.parse.starter/.MainActivity: +410ms (total +10m33s240ms)
D/WindowManager: topDisplayedActivityInfo, appToken: Token{2e99c6e0 ActivityRecord{2e79b238 u0 com.parse.starter/.MainActivity t19}}
W/System: Ignoring header X-Parse-Client-Key because its value was null.
W/System: Ignoring header X-Parse-Client-Key because its value was null.
W/System: Ignoring header X-Parse-Client-Key because its value was null.
D/dalvikvm: GC_FOR_ALLOC freed 600K, 25% free 2735K/3644K, paused 10ms, total 10ms
W/System: Ignoring header X-Parse-Client-Key because its value was null.
I/Parse: Save Failed

Your client key is null.

Add your client key from your heroku settings.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM