PushResource
Push devices and the project's push provider under /v1/push.
- Stable unknown
- Release candidate not available
- Development since 0.2.0-dev.32+058a03c
public final class PushResourcePush devices and the project's push provider under /v1/push. Get it from Ovok.push().
Methods
devices
public PushResource.Devices devices()Returns the signed-in person's push devices.
Returns: the devices resource
provider
public PushResource.Provider provider()Returns the project's push provider, for project admins.
Returns: the provider resource
PushResource.Devices
public static final class DevicesThe devices the signed-in person receives push on, each their own.
Devices.register
public JsonNode register(
Object device,
RequestOptions options) throws IOException, InterruptedExceptionRegisters a device token to the signed-in person; the same token again answers the same device (POST /v1/push/devices).
Parameters:
device: thetoken,platform(ios,androidorweb) and optionalappIdoptions: per-request options, such as the timeout
Returns: the device, never with its token
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
Devices.list
public JsonNode list(RequestOptions options) throws IOException, InterruptedExceptionLists the signed-in person's devices (GET /v1/push/devices).
Parameters:
options: per-request options, such as the timeout
Returns: the response body, with the devices under devices
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
Devices.unregister
public void unregister(String id, RequestOptions options) throws IOException, InterruptedExceptionRemoves a device, which then gets no more push (DELETE /v1/push/devices/{id}).
Parameters:
id: the device idoptions: per-request options, such as the timeout
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
PushResource.Provider
public static final class ProviderThe provider the project's push goes through (fcm, apns, expo or relay).
Provider.retrieve
public JsonNode retrieve(RequestOptions options) throws IOException, InterruptedExceptionReads the push provider and its settings, never a secret (GET /v1/push/provider).
Parameters:
options: per-request options, such as the timeout
Returns: the provider
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
Provider.create
public JsonNode create(
Object provider,
RequestOptions options) throws IOException, InterruptedExceptionSets up the push provider; a relay's signing secret is answered this once (POST /v1/push/provider).
Parameters:
provider: theprovidername and its credentialsoptions: per-request options, such as the timeout
Returns: the provider as set up
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
Provider.update
public JsonNode update(
Object changes,
RequestOptions options) throws IOException, InterruptedExceptionChanges the push provider (PATCH /v1/push/provider).
Parameters:
changes: theproviderset up, and the fields to changeoptions: per-request options, such as the timeout
Returns: the provider after the change
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
Provider.remove
public void remove(RequestOptions options) throws IOException, InterruptedExceptionRemoves the push provider; no push is sent until one is set up again (DELETE /v1/push/provider).
Parameters:
options: per-request options, such as the timeout
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
Last updated on