# In the HTTP request is an Authorization header. Its value is the word ApplePushNotifications and the authentication token, separated by a single space. The authentication token is the same token that’s specified in your package’s website.json file. Your web service can use this authentication token to determine which user is removing their permission policy.

# Use this authentication token to remove the device token from your database, as if the device had never registered to your service.

#TODO: Create a record to store this device token. It will be used to send push notifications later.

render json: {message:'ok'}, status:200

end

# If a user removes permission of a website in Safari preferences, a DELETE request is sent to the following URL:

# In the HTTP request is an Authorization header. Its value is the word ApplePushNotifications and the authentication token, separated by a single space. The authentication token is the same token that’s specified in your package’s website.json file. Your web service can use this authentication token to determine which user is removing their permission policy.

# Use this authentication token to remove the device token from your database, as if the device had never registered to your service.

#TODO: Delete the record with this device token. The device will no longer accept notifications.

render json: {message:'ok'}, status:200

end

# If an error occurs, a POST request is sent to the following URL:

# webServiceURL/version/log

# post '/:version/log' => 'safari_apn#log'

deflog

# In the HTTP body is a JSON dictionary containing a single key, named logs, which holds an array of strings describing the errors that occurred.

# Use this endpoint to help you debug your web service implementation. The logs contain a description of the error in a human-readable format. See “Troubleshooting” for a list of possible errors.

#TODO: Log the incoming messages intelligently within the application.