Deleting the user¶
For your app's "delete my account" (GDPR's right to erasure, App Store guideline 5.1.1(v)), deleteRecipient erases the current user's recipient on the service: every device of theirs (this one and the others), the notifications sent to them and every event about them. It can't be undone.
Dart
final outcome = await plingBuddy.deleteRecipient();
if (outcome == DeletionOutcome.deleted) showAccountDeleted();
- It answers how the first attempt ended:
deleted(the device then forgets the user and their data, and is anonymous),pending(it couldn't be sent yet, for example offline; the SDK keeps trying, also after a relaunch) orrefused(the service won't delete it, or the device couldn't save the request; the user and their data stay as they were, the calls made meanwhile are applied, and the reported error says why). pendingdoesn't promise the deletion will go through: a later attempt can still be refused, for example withidentity_verification_required, and that's reported to the error listener. Show the user that the deletion is pending, not that it's done.- Before the device's first unlock after a restart, the SDK can't read its state yet: the call then answers
pendingand waits in memory until the unlock, so a restart before it loses the request. - A signed-in user can only be deleted when the application verifies identities (identity verification), since otherwise anyone who knows the external id could erase that user. Without it, the answer is
refusedwithidentity_verification_required, and your backend has to erase the user another way. An anonymous user can always be deleted. - Calls made while the deletion is pending wait for it in memory and are applied after it. They aren't saved, so a relaunch before the deletion ends loses them; pass your user and data to
initializeat every launch, as usual. - The user's other devices aren't told: they register again with their next update, still signed in if your app keeps them so. Sign the user out there yourself.
- Erasing the user in your own backend is up to you; the SDK only erases what PlingBuddy holds.