Events

The app will sometimes call the website. Events are used for this kind of communication.

General

Events, called from the app, has no return value as those are calls from the app to the website and the website isn’t supposed to return anything back to the app.

Example:

startiapp.PushNotification.addEventListener(
    'tokenRefreshed',
    function (token) {
        alert('Push notification token received: ' + token);
    }
);

Important events

There are a few important events in the system you should know about no matter which modules you have selected.

  • You shouldn’t start calling API methods before the system has told you it’s ready. You should listen for the ready event.

  • Another important event is the error event, which tells you whenever the app encounters an error either internally or when communicating with the website.