# Location

# getLocation

Supported since Base Library 1.3.9, iOS SDK 2.1.23, and Android SDK 2.1.38

getLocation(Object object)

Retrieves the current geographic location and other related information. This API cannot be called after the user exits the Mini-Program.

Parameters

Object object

Property Type Default Value Required Description
type string gcj02 No Currently, regardless of the parameter value, the gcj02 coordinate system will be returned.
altitude boolean false No If set to true, altitude information will be returned. Since obtaining altitude requires higher precision, it may slow down the API response.
success function No Callback function for a successful API call.
fail function No Callback function for a failed API call.
complete function No Callback function for when the API call completes (executed regardless of success or failure).

Note

  • API Authorization Failure (iOS):
  1. If the user denies authorization, the error message returned will be: unauthorized, indicating the user has not granted location permissions.
  2. If the Host-App prohibits the Mini-Program from actively requesting permissions, the error message returned will be: unauthorized disableauthorized, indicating the SDK is forbidden from requesting location permissions.
  • API Authorization Failure (Android):
  1. If the user denies authorization, the error message returned will be: unauthorized, indicating the user has not granted permission to obtain location information.
  2. If the Host-App prohibits the Mini-Program from actively requesting permissions, the error message returned will be: unauthorized disableauthorized, indicating the SDK is forbidden from initiating permission requests.
© FinClip with ❤ , Since 2017