加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Java > 正文

java / parse错误.试图从Android sdk发送到Parse

发布时间:2020-12-15 02:14:17 所属栏目:Java 来源:网络整理
导读:几天前为另一个应用程序设置了这个并且工作正常,结果成功发送到MongoLab. 尝试使用下面相同的基本代码再次为新应用程序执行此操作,但每次都失败. 有任何想法吗?谢谢! @Override public void onCreate() { super.onCreate(); // Enable Local Datastore. Pa
几天前为另一个应用程序设置了这个并且工作正常,结果成功发送到MongoLab.
尝试使用下面相同的基本代码再次为新应用程序执行此操作,但每次都失败.

有任何想法吗?谢谢!

@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");
              }
          }
      });

——日志在最后显示———

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

解决方法

您的客户端密钥为空.

从heroku设置添加客户端密钥.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读