{"version":"0.1.0","code":"0000","result":true,"message":"处理成功","errdetail":"","timestamp":1671508911963,"data":{"id":71712247,"title":"9.2.2 初始化","slug":"smokv7","format":"lake","bookId":26046811,"body":null,"body_draft":null,"body_html":"
账号服务包含高德基础账号的注册、登录、退出、信息获取等功能,以及车企账号与高德账号的绑定、解绑、快速登录功能。
对接账号互通功能前,请先和高德项目、产品接口人进行沟通,绑定、快速登录接口涉及的请求来源ID的分配,需要双方配合处理。
特别说明:此处添加的观察者回调是在后续章节介绍的具体业务接口异步回调
int com.autonavi.gbl.user.account.AccountService.init(AccountServiceParam)
int com.autonavi.gbl.user.account.AccountService.addObserver(IAccountServiceObserver)
void com.autonavi.gbl.user.account.AccountService.removeObserver(IAccountServiceObserver)
说明:函数详情,请复制函数名称到在线API搜索
// 实现回调观察者 IAccountServiceObserver\npublic class AccountPresenter implements IAccountServiceObserver {\n private AccountService mAccountService;\n \n // 服务初始化\n private void initAccountService() {\n // 获取AccountService单例\n mAccountService = (AccountService) ServiceMgr.getServiceMgrInstance().getBLService(SingleServiceID.AccountSingleServiceID);\n // 添加回调观察者\n mAccountService.addObserver(this);\n // 构造初始化参数\n AccountServiceParam param = new AccountServiceParam();\n param.dataPath = AutoConstant.PATH + "account";\n // 保证传入目录存在\n FileUtils.createDIR(param.dataPath);\n // 服务初始化\n int res = mAccountService.init(param);\n Log.i(TAG, "initAccountService: init=" + res);\n }\n}\n