ionic platform



$ionicPlatform

$ionicPlatform is used to detect the current platform and, for example, overlay the Android back button in PhoneGap/Cordova.

Method

onHardwareBackButton(callback)

For platforms that have a hardware back button, you can bind to it using this method.

ParametersTypeDetails
callbackfunction

When this event occurs, the callback function is triggered.

offHardwareBackButton(callback)

Remove the back button listening event.

ParametersTypeDetails
callbackfunction

The initially bound monitor function.

registerBackButtonAction(callback, priority, [actionId])

Register the hardware back button action. When the button is clicked, only one action will be executed, so this method determines that the registered back button action has the highest priority.

For example, if a pull-up menu is already displayed, the back button should close the pull-up menu instead of returning to a page view or closing an open model.

ParametersTypeDetails
callbackfunction

Fired when the back button is clicked, if the monitor has the highest priority.

prioritynumber

Only the highest priority will be executed.

actionId
(optional)
##*The id specifies this action. Default: a random and unique id.

Return value: Function, a triggered function, will log out backButtonAction.

ready([callback])

When the device is ready, a callback function is triggered.

ParametersTypeDetailscallback
(Optional)
function=The function triggered.

#Return: promise object, the object is constructed and resolved after success.