Starting June 30, 2022, iOS apps that support account creation must let users initiate the deletion of their account within the app.
More information and guidance from Apple can be found here.
If your app allows user creation via Identity Management, you can use the following steps to implement a button that triggers the deletion of user accounts.
Note: Our example is for a Sandbox application. If you'd like to implement this on your Production application, please use one of the base URLs here for calling the API endpoint.
-
Create a PHP file in your server with the following content:
XML<!DOCTYPE html> <html> <head><meta charset="UTF-8"></head> <body><?php $aid = "<AID>"; $api_token = "<api token>"; if ($_SERVER["REQUEST_METHOD"] == "POST") { $uid = $_POST['uid']; $url = "https://sandbox.piano.io/api/v3/publisher/gdpr/delete?aid=".$aid."&api_token=".$api_token."&scope=ALL&uid=".$uid; // create a new cURL resource $ch = curl_init(); // set URL and other appropriate options $options = array(CURLOPT_URL => $url); curl_setopt_array($ch, $options); // grab URL and pass it to the browser $output = curl_exec($ch); // close cURL resource, and free up system resources curl_close($ch); // return the output echo $output; } else { echo "Request method must be POST!"; } ?></body> </html> -
Put your AID and API token to the
$aidand$api_tokenvariables. -
Call the
/file.phpyou saved with the POST request method and the requireduidparameter to delete a user.
This way you can secure your API token as it won’t be saved directly in your application. You can change the request method to GET or add more security measurements. The script above is just an example.
Our iOS SDK is available here.
More information about the GDPR Deletion API endpoint can be found under this link.