我使用解析来处理推送通知。因为我已经有自己的数据库,所以我只使用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);
}
}
});
然后我得到以下错误:
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)
谢谢!
最佳答案
我认为您正在尝试向没有足够授权的用户发出请求。 也许,您是在 session 已经销毁(用于注销)时执行此请求,而不是在销毁它之前执行此请求。
关于Android无法删除parse安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30453713/