Marcos Reboucas
Marcos Reboucas

Reputation: 3489

Delete objects on server when app is deleted from iOS

Searching for a solution it seems there's no delegate method which fires when the app is being deleted.

My app uploads a user profile data on server (name, image) and I can easily delete it manually calling some function inside app linked to a "DELETE PROFILE" button.

But if user deletes the app, without deleting his profile first, his data will be on server forever and available to other user's view, opposed to what should be expected.

What should be the best way to get rid of server data as user deletes the app?

Upvotes: 0

Views: 319

Answers (1)

David Hoerl
David Hoerl

Reputation: 41642

1) Make your app push enabled. Send "background" pushes from time to time, like once a week. Run your own push server - there is JAVA and Python code around, probably other kinds too.

When you see that a token bounces, you know that the app has been deleted. You then mark that account as stale. At some later time, if the user has not done anything with the account, you can then either delete it or mothball it.

The downside to this approach is that you need to get the user's permission to send it remote notifications.

2) Require that the user re-log into their account like once every 3 months. If they don't log in, then you can do as above - mark, mothball, then delete.

Upvotes: 1

Related Questions