Module Response.Results

type success

The type representing a success result. If no error occurred, the JSON in the results attribute contains a mandatory field message_id and an optional field registration_id.

val message_id_of_success : success -> string

message_id_of_success success returns a string specifying a unique ID for each successfully processed message.

val registration_id_of_success : success -> string option

registration_id_of_t result returns a string specifying the canonical registration token for the client app that the message was processed and sent to. A value will be returned by FCM if the registration ID of the device you sent the notification to has changed. The value will be the new registration ID and must be used to send new notifications. If you don't change the ID, you will receive the error NotRegistered.

type error =
  1. | Missing_registration
  2. | Invalid_registration
  3. | Unregistered_device
  4. | Invalid_package_name
  5. | Authentication_failed
  6. | Mismatch_sender_id
  7. | Invalid_JSON
  8. | Message_too_big
  9. | Invalid_data_key
  10. | Invalid_time_to_live
  11. | Timeout
  12. | Internal_server
  13. | Device_message_rate_exceeded
  14. | Topics_message_rate_exceeded
  15. | Unknown

Sum type to represent errors. You can use string_of_error to have a string representation of the error.

val string_of_error : error -> string

string_of_error error returns a string representation of the error error.

type t =
  1. | Success of success
  2. | Error of error

The type representing a result.