Android无法删除解析安装

Lil*_*ian 5 android parse-platform

我使用解析来处理推送通知.因为我已经拥有自己的数据库,所以我只使用parse存储安装数据.(不使用ParseUser登录并在应用程序中注销)当我退出我的应用程序时,我想删除我的安装.

ParseInstallation installation = ParseInstallation.getCurrentInstallation();
installation.deleteInBackground(new DeleteCallback() {
    @Override
    public void done(ParseException ex) {
        Log.d(TAG, "ParseInstallation deleteInBackground done");
        if (ex != null) {
            Log.e(TAG, "ParseInstallation deleteInBackground", ex);
        }
    }
});
Run Code Online (Sandbox Code Playgroud)

然后我收到以下错误:

com.parse.ParseRequest$ParseRequestException: forbidden
        at com.parse.ParseRequest.newPermanentException(ParseRequest.java:391)
        at com.parse.ParseRESTCommand.onResponse(ParseRESTCommand.java:197)
        at com.parse.ParseRequest$3.then(ParseRequest.java:258)
        at com.parse.ParseRequest$3.then(ParseRequest.java:254)
        at bolts.Task$14.run(Task.java:796)
        at bolts.BoltsExecutors$ImmediateExecutor.execute(BoltsExecutors.java:105)
        at bolts.Task.completeAfterTask(Task.java:787)
        at bolts.Task.continueWithTask(Task.java:599)
        at bolts.Task.continueWithTask(Task.java:610)
        at bolts.Task$12.then(Task.java:702)
        at bolts.Task$12.then(Task.java:690)
        at bolts.Task$14.run(Task.java:796)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
        at java.lang.Thread.run(Thread.java:841)
Run Code Online (Sandbox Code Playgroud)

谢谢!

And*_*ano 1

我认为您正在尝试向没有足够授权的用户发出请求。也许,您在会话已被销毁(用于注销)时执行此请求,而不是在销毁会话之前执行此请求。