Development guide ================= .. warning:: THIS IS FOR INTERNAL USE ONLY!! Push Notification format ------------------------ .. include:: PushNotificationFormatDescriptionFCM.inc .. include:: PushNotificationFormatDescriptionAPNS.inc Disabling Push while not connect to the XMPP account ---------------------------------------------------- In some cases users may want/need to disable push notifications for their device while not being able to connect to the XMPP server (ie. password was changed, server is offline, user is blocked, etc.). To allow that we have created REST API call available at: ``/rest/push/unregister-device/{push-component-jid}`` where ``push-component-jid`` is a jid of a push component. This endpoint answers POST calls with JSON payload in the following format: .. code:: json { "account": "user@example.com", "provider": "provider-id", "device-token": "XXXXXXX" } where: - ``account`` is a bare jid of users account for which we want to disable push notifications - ``provider`` is a provider id for which client registered (provider is responsible for delivering pushes to proper push service, ie. APNs or FCM) - ``device-token`` is a device id or token used to register for push notifications On the request handler with answer with: **On success.** .. code:: json { "result": "success" } **On failure.** .. code:: json { "result": "failure" } .. warning:: If push component is not a local component, or a payload is incorrect (fields are missing), then endpoing will respond with HTTP error code 404. This is intentional as this API is exposed publicly and we do not want easy for anyone else except client authors to be able to execute those calls.