目录

HealthKitAuthResult

Class Info

public class HealthKitAuthResult extends Result

登录授权流程返回结果类。

Public Method Summary

Qualifier and Type

Method Name and Description

HealthKitAuthResult

fromJson(String json)

将JSON字符串转换为HealthKitAuthResult对象。

AuthAccount

getAuthAccount()

获取授权结果返回的账号信息。

int

getErrorCode()

获取授权流程返回的错误码。

boolean

isSuccess()

判断授权流程是否成功。

void

setAuthAccount(AuthAccount authAccount)

设置返回结果中的账号信息。

String

toJson()

将HealthKitAuthResult对象转换为JSON字符串。

Public Methods

[h2]fromJson(String json)

Method

public HealthKitAuthResult fromJson(String json) throws JSONException

将JSON字符串转换为HealthKitAuthResult对象。

Parameters

Name

Description

json

表示HealthKitAuthResult对象的JSON字符串。

Returns

Type

Description

HealthKitAuthResult

HealthKitAuthResult对象。

Throws

Name

Description

JSONException

JSON解析异常。

[h2]getAuthAccount()

Method

public AuthAccount getAuthAccount()

获取授权结果返回的账号信息。

Returns

Type

Description

AuthAccount

授权结果返回的账号信息。

[h2]getErrorCode()

Method

public int getErrorCode()

获取授权流程返回的错误码。

Returns

Type

Description

int

授权流程返回的错误码。

[h2]isSuccess()

Method

public boolean isSuccess()

判断授权流程是否成功。

Returns

Type

Description

boolean

授权流程是否成功。

  • true:授权成功。
  • false:授权失败。

[h2]setAuthAccount(AuthAccount authAccount)

Method

public void setAuthAccount(AuthAccount authAccount)

设置返回结果中的账号信息。

Parameters

Name

Description

authAccount

账号信息。

[h2]toJson()

Method

public String toJson() throws JSONException

将HealthKitAuthResult对象转换为JSON字符串。

Returns

Type

Description

String

HealthKitAuthResult对象转换出的JSON字符串。

Throws

Name

Description

JSONException

转换JSON异常。