EvilMindDevs / hms-unity-plugin

The HMS Unity Plugin makes it easy to include Huawei Mobile Services into Unity-based games. Authentication, in-app purchases, push alerts, ads, and interaction with gaming services are just a few of the basic capabilities that this formidable tool makes available to your applications.
https://evilminddevs.gitbook.io/hms-unity-plugin/
310 stars 44 forks source link

Issue with Ads not loading on non-Huawei device #503

Open ArsalanRizwan opened 1 month ago

ArsalanRizwan commented 1 month ago

Describe the bug & problem I have a game made in Unity version 2020.3.40f1. I have integrated petal ads in my game using the latest HMS Unity Plugin Version V2.3.8. I have released the game on app gallery. There is a splash ad when game launches. A banner ad that loads and stay at bottom of screen and an interstitial ad that shows up on certain button clicks. I have Samsung A02s (Android 12). Before releasing the game I tested it with test ads and they all were working perfectly fine on my phone. Then I used my own ad ids and after the app got released I installed it on my phone but the problem is that no ads load and show up on my phone. I have latest app gallery and HMS core installed on my phone. I also tested it on Samsung A34 (Android 14) and it also has the same behavior. Then I tested my game using cloud debugging on Huawei P30 and P40 and on both devices I was able to see the ads being loaded and shown as they should be. I also have an old Huawei Y5 Prime (Android 8.1) device and the ads also load and show up in my game on this device. I would like to know if it is possible to show ads on non-Huawei devices and how would I be able to fix this problem. I have attached a log file from my Samsung A02s device.

Steps to Reproduce:

Step1 : Integrate the HMS Evil Minds Plugin into a Unity project. Step2 : Implement the Ads functionality as per the documentation. Step3 : Attempt to load and show ads on non-Huawei device. Step4 : Observe that no ad loads and show up on non-Huawei device.

Expected behavior The ads should load and show on non-Huawei devices like for e.g. Samsung A02s, A34 but they only show on Huawei devices.

Environment:

Smartphones:

Thank you for your help.

github-actions[bot] commented 1 month ago

Thank you for reporting this issue/advice.

We will get back to you as soon as possible.
Would you like to star our plugin to support us? :sparkles:

Andronovo-bit commented 1 month ago

Hi @ArsalanRizwan,

We will analyze your issue and come back soon.

During this time, If you want, you can look at this link for your issue. There are some solution suggestion in this link.

https://developer.huawei.com/consumer/en/doc/HMSCore-Guides/publisher-service-faq-0000001050064974

Also, you can look this our documantation about ads;

Aziz-T commented 1 month ago

Hi @ArsalanRizwan,

When I examine the log file, I see that there is more than one error code. These error codes are error code 204, error code 700, error code 499.

The common meaning of these error codes is that Ads Kit cannot obtain your exact country code from your device. Since Ads Kit cannot obtain the country code, no suitable ads can be found on the server and a 204 error occurs. Error code 204 is due to no ad matching your request. When the requested ad configuration does not match any existing ad specifications or target conditions, the SDK returns error 204. I will give you the following suggestions to solve the error:

  1. If there is no SIM Card in the phones, try tracking the SIM Cards in the phones. Sim Card may be required to determine the country code.

  2. Set your current region on the phone to a region other than China mainland and the US.

  3. Also, if HMS Core is not installed on non-Huawei devices, make sure you are using Ads - Prime SDK.

If you have any further questions, please feel free to ask.

ArsalanRizwan commented 1 month ago

Hi @Aziz-T,

Thank you for your detailed reply. I have checked and there is working sim card in my phone. And I am from Pakistan and that is my current region.

Since ads donot work in Pakistan region so I have been using a vpn to test the ads on my phone. And I have also double checked latest version of HMS core is also installed on my phone.

As I mentioned earlier I also have an old Huawei Y5 Prime (Android 8.1) device. I have installed my same game from app gallery on it and by using the vpn I am able to get and see the ads in my game. But when I do the same on my Samsung A02s or A34 phones I am not able to get and see ads on these phones.

I am not able to understand why this is happening and why non-Huawei devices are not able to load and show ads that work fine on my other Huawei device. I am also not sure if I have missed something during integration that is causing this problem in non Huawei phones.

Also there is one thing I forgot to mention. I also have non Unity apps made from Android Studio in my Samsung phone that have integrated Petal Ads. And in these apps ads also work perfectly fine when I'm connected to a vpn. So the only problem I'm having is with Unity apps with Petal Ads in non-Huawei phones.

Thank you.

ArsalanRizwan commented 2 weeks ago

Hi, @Andronovo-bit, @Aziz-T

I have still not been able to figure out and solve this problem. I would like to know that is there any update regarding the solution of it?

Thank you.