Android Parse saveInBackground / subscribeInBackground无效

时间:2015-06-17 07:09:43

标签: android parse-platform push-notification

在后台发生的Parse事件实际上似乎都没有发生......我看到SaveCallback之外的所有日志,但回调中没有(没有失败或成功)。此外,我的安装永远不会出现在我的Parse仪表板中。任何帮助将不胜感激。

这是我的应用程序文件中的代码(Parse相关),在onCreate:

    ParseCrashReporting.enable(this);
    Parse.enableLocalDatastore(this);
    Parse.initialize(this, "kladjlatkhdtlah", "akthjalhtdas");
    Log.d("com.parse", "Parse initialized");
    ParsePush.subscribeInBackground("", new SaveCallback() {
        @Override
        public void done(ParseException e) {
            if (e == null) {
                Log.d("com.parse.push", "successfully subscribed to the broadcast channel.");
            } else {
                Log.e("com.parse.push", "failed to subscribe for push", e);
            }
        }
    });
    Log.d("com.parse.push", "Should have subscribed");
    PushService.setDefaultPushCallback(this, MainActivity.class);
    ParseInstallation.getCurrentInstallation().saveInBackground(new SaveCallback() {
        @Override
        public void done(ParseException e) {
            if (e == null) {
                Log.d("com.parse.push", "successfully saved installation.");
            } else {
                Log.e("com.parse.push", "failed to save installation", e);
            }
        }
    });
    Log.d("com.parse.push", "Should have saved");
    ParseUser.enableAutomaticUser();
    ParseACL defaultACL = new ParseACL();
    ParseACL.setDefaultACL(defaultACL, true);

0 个答案:

没有答案