Utilities

We describe other functions provided by Monaca.

monaca.getDeviceId()

Get the unique device ID which has been created randomly.

Monaca framework automatically creates a unique device ID at the first time app launch.

monaca.getDeviceId(callback)

Parameter

Return Value

  • None

Example

monaca.getDeviceId(function(id){
   console.log('Device ID: ' + id);
});

monaca.baseUrl

Get an absolute URL to www folder.

monaca.baseUrl

Return Value

Example

window.onload = function()
{
   alert(monaca.baseUrl);
}

monaca.isAndroid

Check whether the device is an Android device or not.

monaca.isAndroid

Return Value

Example

if(monaca.isAndroid === true){
  alert("Android!");
}

monaca.isIOS

Check whether the device is an iOS device or not .

monaca.isIOS

Return Value

Example

if(monaca.isIOS === true){
  alert("iOS!");
}

Last updated