Polling for New Actions
One way that clients can receive new actions is if they manually request them from the Akula Action Service. This is sometimes referred to as polling. Typically, you have an app check for new actions whenever the app is launched or foregrounded. You can also instruct your app to request new actions on a regular basis if the app remains open for some period of time.
This section describes how to poll for new actions in a client app.
- Android –
- iOS –
On Android and iOS, the
update() method returns a promise.
The following example shows how each client can check for new actions:
updateWithDelegate() methods methods act asynchronously. To synchronously request a list of actions on Android and iOS, use the
The following example shows how Android and iOS clients synchronously request new actions:
If the Action Service does not return any action commands on a polling request, then none of the listeners are invoked.