Java 无法从android应用程序中删除分析对象

Java 无法从android应用程序中删除分析对象,java,android,parse-platform,Java,Android,Parse Platform,因此,我目前正在android中的解析安装中保存一个用户名,如下所示: ParseInstallation installation = ParseInstallation.getCurrentInstallation(); installation.put("user", username); installation.saveInBackground(); 然后,我通过用户名进行查询,将推送发送到特定设备。如果

因此,我目前正在android中的解析安装中保存一个用户名,如下所示:

ParseInstallation installation = ParseInstallation.getCurrentInstallation();
                    installation.put("user", username);
                    installation.saveInBackground();
然后,我通过用户名进行查询,将推送发送到特定设备。如果我现在想“取消”该设备与接收推送的链接,我必须从解析安装表中删除该行,其中用户名是应用程序中存储的用户名

我几乎什么都试过了,现在我要说的是:

ParseInstallation installation = ParseInstallation.getCurrentInstallation();
                ParseObject object = installation.getParseObject("user");
                object.deleteInBackground();

但是,唉,这也不行。我也尝试过
安装。deleteInBackground()
,但也失败了。如何从设备中删除此parseobject或安装,使其无法再接收推送?

您无法从客户端删除安装对象-您只能使用主密钥从解析云代码中删除

您可以简单地执行以下操作:

ParseInstallation installation = ParseInstallation.getCurrentInstallation();
                        installation.remove("user");
                        installation.saveInBackground();
或者,如果这不起作用,请尝试:

ParseInstallation installation = ParseInstallation.getCurrentInstallation();
                    installation.put("user", "" OR null);
                    installation.saveInBackground();

您可以尝试做的是:

ParseInstallation installation = ParseInstallation.getCurrentInstallation();
installation.deleteInBackground();
如果这不起作用,那么您确实可以仅通过CloudCode(使用主密钥)从解析中删除安装对象


我真的看不出为什么parse会允许这样做,因为您实际运行的是应用程序,所以是否要删除其安装对象?不知道会发生什么行为。

仔细检查api,了解安装的实际操作。put(key,val)是什么。确保在“删除”之前准确检索到所需的对象。。。谢谢,我想我试过这个,但是嘿,这个有用。唯一的问题是,应用程序的“安装”仍然位于解析控制面板上的我的安装表中,但没有更多的推送给该用户。