This guide explains how to use Global Events in a project.
Application events are available since the very beginning of the Smartface as a mean for application components to exchange information. These events should be written in "app.js" file. The most well known usage of application events are given below:
Triggered when application is called by another application. The calling application may send data to this application during calling. This data format should be JSON parsable. For iOS, this method is equal to application handleOpenURL method. For Android, this method is triggered if an activity is called by another activity.
Triggered when device is shaked.
Triggered before exiting application.
Triggered after application is maximized by long touched home button.
Triggered after application is minimized by long touched home button.
This event is triggered in two cases. One of them is application is active and running; recieved a push notification or local notification. Second is app is not active, recieved a push notification. This event is fired after activating (maximize) the app usig the notification.
Triggered after an SMS is recieved.
Runs functions on application start after completing processing of Splash Page, other loading of Smartface Project objects and parsing of i18n/i18.js and app.js.
Device events are available based on device hardware.
Creates action(s) that are run when Accelerometer detects a change. It returns e.x , e.y and e.z parameters where x, y and z stand for the coordinates.
Creates action(s) that are run when the type of the network connection is changed.
Creates action(s) that are run when location is changed. It returns e.lat and e.lng values for latitude and longitude.