my.getScreenOrientation

Call this API to get screen orientation.

Sample code

copy
my.getScreenOrientation({   
  success: (res) => {
    my.alert({
      title: 'success',
      content: JSON.stringify(res)
    })
  },
  fail: (res) => {
    my.alert({
      title: 'fail',
      content: JSON.stringify(res)
    })
  } 
})

Parameters

Property

Type

Required

Description

success

Function

No

Callback function upon call success

fail

Function

No

Callback function upon call failure

complete

Function

No

Callback function upon call completion (to be executed upon either call success or failure)

Success callback function

Property

Type

Description

success

Boolean

Specifies whether the call is successful. When the value is true, the call is successful.

orientation

String

Indicates the orientation of the screen, portrait or landscape.

Fail callback function

Property

Type

Description

error

Number

The error code for the failure

errorMessage

String

The error message