nabto_device_fcm_send()

DESCRIPTION

Send a notification.

The future returns NABTO_DEVICE_EC_OK iff the invocation of the basestation went OK. A successful invocation of the basestation does not mean a successful invocation of FCM. On OK, the FCM response should evaluated using nabto_device_fcm_notification_get_response_status_code() and nabto_device_fcm_notification_get_response_body(). The response status code is generally enough to determine if a message went OK or not. The response body can be used to get a detailed description in the case an error occurs.

Future status:

  • NABTO_DEVICE_EC_OK if the notification is delivered to FCM.
  • NABTO_DEVICE_EC_STOPPED if the operation is stopped.
  • NABTO_DEVICE_EC_NOT_ATTACHED if the device is currently not attached to the basestation.
  • NABTO_DEVICE_EC_INVALID_STATE if vital data is missing e.g. the project id or the body of the notification.

DECLARATION

NABTO_DEVICE_DECL_PREFIX void NABTO_DEVICE_API
nabto_device_fcm_send(NabtoDeviceFcmNotification* notification, NabtoDeviceFuture* future)

PARAMETERS

notification:
[in] The notification to send
future:
[in] Future which resolves when sending has been concluded