$status_url, 'confirmation_code' => $confirmation_code ); echo json_encode($data); function parse_signed_request($signed_request) { list($encoded_sig, $payload) = explode('.', $signed_request, 2); $secret = "appsecret"; // Use your app secret here // decode the data $sig = base64_url_decode($encoded_sig); $data = json_decode(base64_url_decode($payload), true); // confirm the signature $expected_sig = hash_hmac('sha256', $payload, $secret, $raw = true); if ($sig !== $expected_sig) { error_log('Bad Signed JSON signature!'); return null; } return $data; } function base64_url_decode($input) { return base64_decode(strtr($input, '-_', '+/')); } ?>
Response Format
The response should be a JSON object containing a URL where the user can check the status of their deletion request and an alphanumeric confirmation code. The JSON response has the following form:
{ "url": "https://www.100mphonline.com/deletion?id=abc123", "confirmation_code": "abc123" }
Testing Your Callback
To test your callback:
Log in to your app with Facebook Login.Go to your Facebook profile's Apps and Websites settings tab: https://www.facebook.com/settings?tab=applicationsRemove your app.Click the View Removed Apps and Websites link.In the popup, click the View button to the right of the application.In the appeared window, click Send Request to trigger your callback.