当前位置:网站首页>Before the login welcome bar pops up, switch the game to the background, and then switch back to the game after the welcome bar pops up. Huawei anti addiction pop-up does not appear, and you can direc

Before the login welcome bar pops up, switch the game to the background, and then switch back to the game after the welcome bar pops up. Huawei anti addiction pop-up does not appear, and you can direc

2022-07-18 17:00:00 Huawei Developer Forum

Problem description

Our game integrates Huawei game anti addiction function , Submit audit , Rejected :“ Your game does not limit the time to provide services to minors ”.

Our game is set to automatically login , That is, enter the game and actively call the Huawei login interface , After logging in successfully, you can directly enter the game . My own test of anti addiction is effective , That is, after the minor account is successfully logged in , Anti addiction pop-up window can pop up , At this time, you can prevent underage players from entering the game .

Under the guidance of Huawei's operation , Find the specific recurrence scenario provided by the audit :

stay Interactive center feedback , Just indicate your problems and needs .

Feedback entry : land AGC- At the small bell in the upper right corner of all pages .

The audit test steps are , When entering the game , Before the login welcome bar pops up ( Or before the anti addiction pop-up ), Cut the game to the backstage , After the Huawei login welcome bar pops up on the mobile interface , Then switch back to the game , At this time, there is no Huawei anti addiction pop-up window on the interface , But directly into the game , It seems that the anti addiction pop-up window was stuck when cutting backstage , So as to bypass anti addiction .

Problem analysis

I will follow Huawei Official documents Check our code for vulnerabilities , Integrated anti addiction requires attention to the following :

Register in the initialization interface to realize anti addiction callback OnExit();
Call after successful login getCurrentPlayer/getGamePlayer Interface to get player information , Otherwise, anti addiction will not take effect .

Check code , The above two points meet the requirements .

Then code debugging found , Cut to the background scene , Do not pop up the anti addiction pop-up window , There is no way to go to the logic of quitting the game when it is initialized , So that anti addiction can't stop minors from entering the game .

Contact Huawei technical support ( can Bill of lading contact ) Help solve the problem . Technical response , Game cut to backstage , At this time, because you can't get activity, So you can't pull up the anti addiction pop-up , You can no longer control players to exit the game through the pop-up window .

Huawei requires , When calling the login interface (silentSignIn or signInIntent) After success , To be called getCurrentPlayer/getGamePlayer Interface to get player information playerID/openID, After success , Before entering the game . In the scenario of audit test , Switch front and background operations , call getCurrentPlayer/getGamePlayer Interface , I can't get playId/openId Of , The game should prohibit players from entering .

The conclusion is : Control players to enter the game , It depends on whether you can get playId/openId To judge , Not just based on the anti addiction bullet box .

Problem solving

According to the technical reply , We are getCurrentPlayer The interface failure callback prompts the user that the player information acquisition failed , And add logic that forbids players from entering the game , Problem solving .

原网站

版权声明
本文为[Huawei Developer Forum]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/199/202207161052264919.html