Alipay+ DocsAlipay+ Docs

getCurrentRegion​

The getCurrentRegion API is used by the MPP app to get the user's current region.

Method signature

copy
public String getCurrentRegion(Context context);

Request parameters

Name

Type

Length

Description

Required

context

String

/

The context of the Android activity.

M

Response parameters

Type

Length

Description

Required

String

/

The user's current region that is obtained based on the cellular service provider and time zone. Note that the user's region may not be obtained in rare cases, for example, the time zone is newly added, which does not exist in the mapping table.

O

Sample

copy
String region = AlipayPlusClient.getInstance().getCurrentRegion(context);