更新日期:2024-11-27QuickGame(鸿蒙)客户端接入文档
1.1 将 gamesdkLibrary.har 包放在⼯程的 libs ⽬录下:
1.2 在 App Module 的 oh-package.json5中,添加依赖项:
如下图:
"requestPermissions": [
{}],
如下图:
以上内容可参考Demo的实现
} from 'gamesdklibrary'
// 创建GameSDKManager实例对象 ,参数传SDK后台的productCode参数 gamesdkInstance: GameSDKManager = GameSDKManager.getInstance('44021448506430380961470188790 224')
this.gamesdkInstance.initWithProductCode('440214485064303 80961470188790224')
// 在游戏控制器创建SDK登录控制器对象 @State dialogViewController: DialogViewController = new DialogViewController() //打开登录界⾯ this.dialogViewController.openLoginDialog()
/创建订单数据对象 let orderInfo: GameSDKOrderInfo = { goodsID:'testGoodsID', productName: 'testProductName', cpOrderID: 'testCpOrderID', amount: 'testAmount', callbackUrl: 'testCallbackUrl', extrasParams: 'testExtrasParams' } //⽀付 this.gamesdkInstance.payWithOrderInfo(orderInfo)
//创建⻆⾊数据对象 let roleInfo: GameSDKRoleInfo = { roleId:'testRoleId', roleName: 'testRoleName', serverId: 'testServerId', serverName: 'testServerName', roleLevel: 'testRoleLevel', vipLevel: 'testVipLevel' } //上传游戏⻆⾊ this.gamesdkInstance.updateRoleInfo(roleInfo)
//展示隐私弹窗 this.dialogViewController.openPrivacyDialog()
可参考SDK Demo进行接⼊
李先生:13880511661
QQ:48157910
赵先生:15390049857
QQ:1077535763
孙女士:13551010407
QQ:1799614139
QQ群:698731538