卸载应用程序后清理解析数据 [英] Clean up Parse data after app uninstall

查看:22
本文介绍了卸载应用程序后清理解析数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将 Android Parse API 用于推送通知 (v1.9.4),我想知道如何在用户卸载应用程序时清理 Parse 应用程序数据(安装、用户和会话对象).这可能吗?我看到 2-1 年前的一些帖子表明这是不可能的,我想知道事情是否有所不同,是否有新的解决方法:

I'm using Android Parse API for push notifications (v1.9.4) and I would like to know how to clean up Parse app data (Installation, User and Session objects) as the app is uninstalled by the user. Is this possible at all? I have seen some posts from 2-1 years ago that indicates that such is not possible and I wonder if things got different and if there are new workarounds for it:

以上这些帖子仅涉及安装对象删除,我在网上找不到有关如何删除会话和用户数据的信息.我真的需要清理所有内容,否则会发生一些奇怪的事情,例如 ParseException用户名 XXX 已经被占用",当某些用户在重新安装应用程序后尝试注册(通过调用 signUpInBackground)时,更不用说为幽灵解析安装发送的冗余通知...

These posts above only refer to the installation object removal, and I could not find info on the web on how to remove the session and the user data. I really need to clean up everything or else weird things happen such as ParseException "username XXX already taken" when some user tries to sign up (by calling signUpInBackground) after re-installation of the app, not to mention the redundant notifications sent for ghost parse installations...

非常感谢您的帮助!

推荐答案

您可以检测用户是否卸载了应用程序,但您可以通过一些工作来避免该问题.

You can detect if the user uninstall the application but you can avoid the issue with some work.

例如,我在 Installation 中添加了一个新列,它保存了一个指向 User 的指针,因此下次用户登录时我会搜索并删除之前的 <此用户的代码>安装以创建新的.这样一来,每个用户只能进行一次安装(包括设备令牌).

For example, I've added a new column in the Installation which save a pointer to the User so next time the user login I search and delete the previous Installation of this user to create the new one after. This way you will only have one installation (with device token included) per user.

我知道,这有点难看,但这是避免这种 Parse 限制的唯一方法.

I know, it's little ugly but it's the only way to avoid this Parse limitation.

这篇关于卸载应用程序后清理解析数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆