Giter Site home page Giter Site logo

Comments (23)

alihan98ersoy avatar alihan98ersoy commented on June 24, 2024

Hello,

  1. Are you testing with a physical device and Is it Huawei? If you are testing with Cloud Debugging can you change the user to the owner?

499 seems to be related to your region. Is your region the US?

  1. Please open your phone settings -> Language & Region and please check the phone's current region. If it is the US please change it to any supported country.
  2. Please open your phone settings -> Language & Region and please check the phone's current language. If is it English(US) please change it to any supported country.
  3. If these solutions do not work. You can test ads on a phone that has a sim card inserted.

from hms-unity-plugin.

flashmandv avatar flashmandv commented on June 24, 2024

Thank you for your reply.
It seems the ads are working in Huawei device, but not in any other device (despite having the HMS Core and services).
That is strange as in one of the oldest versions of the SDK that was working.
Anyway, closing this

from hms-unity-plugin.

alihan98ersoy avatar alihan98ersoy commented on June 24, 2024

Maybe you can try to implement ads-prime SDK for non-Huawei devices.

from hms-unity-plugin.

flashmandv avatar flashmandv commented on June 24, 2024

Actually I did, but it did not work on my samsung and oneplus devices

from hms-unity-plugin.

alihan98ersoy avatar alihan98ersoy commented on June 24, 2024

I just tested it with a Samsung phone and it is working for me. If you want, we can investigate the problem together. You can reopen this issue

from hms-unity-plugin.

flashmandv avatar flashmandv commented on June 24, 2024

Hello,
Sure, lets see why ads are not showing. I've built dev apk of the game. Here is the link:
https://drive.google.com/file/d/1bE5FlmKqkKTKxnELoayWf_2W7lGD2g0o/view?usp=sharing

You can check the LogCat. Ads are shown when you start new game (solo is easiest) and then exit the game after 5 seconds.

And btw these spam errors are coming from the SDK. I think the old managers were instances of MonoBehavior and these new ones are not so some editor script is throwing these errors:
image

'HmsPlugin.HMSIAPManager' is missing the class attribute 'ExtensionOfNativeClass'!
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

from hms-unity-plugin.

alihan98ersoy avatar alihan98ersoy commented on June 24, 2024

Hello,

On my Huawei Phone(p40 lite) it is working. And I am seeing real ads.
But on my Samsung phone, I am getting error 3. This is a typical situation for non-released games. You should test Ads with test ID before releasing the game.

  • Everything seems to be working but to ensure you can test with testID on non-Huawei devices.

image
image

from hms-unity-plugin.

flashmandv avatar flashmandv commented on June 24, 2024

Thanks for the update. I could not see ads in my Samsung S21+ even though I checked the "Use Test Ads" checkbox.
I even tried with both interestitial AD ID set with test as prefix and without test as prefix.
The version I've sent you you is a development release version with "Use Test Ads" unchecked

from hms-unity-plugin.

alihan98ersoy avatar alihan98ersoy commented on June 24, 2024

Would you mind sharing the "Use Test Ads" checked APK with me? Maybe I can find the issue by testing it.

from hms-unity-plugin.

flashmandv avatar flashmandv commented on June 24, 2024

Sure. Here is the dev apk with test ads ON. My interestitial ID is entered without "test" prefix. I'm not sure which is correct
https://drive.google.com/file/d/1zrNQmgvZHJX7yilqGOJhW7M1U6Q_hJpW/view?usp=sharing
image

from hms-unity-plugin.

alihan98ersoy avatar alihan98ersoy commented on June 24, 2024

With this APK it is getting error 3 on both devices.

  • If you tick use test ads, it uses the testIDs we defined earlier. For example
  • Are you defining Ads id from a script or letting the plugin define it? If you are not defining this can be a temporary situation.
  • Or maybe you can try to disable "Use Test Ads" and then you can try to fill the id parts manually with test ids.
    Testing an Interstitial Ad
    Testing a Rewarded Ad

from hms-unity-plugin.

flashmandv avatar flashmandv commented on June 24, 2024

These are the test ad IDs that I used in HMSAdsKitManager:

private const string TestInterstitialAdId = "testb3ltpi8wg4";
private const string TestRewardedAdId = "testr7r1yk97jh";

should they be without the test prefix? I tested with and without test prefix but no ads were shown in any case (the builds I've sent you have the test prefix)

from hms-unity-plugin.

alihan98ersoy avatar alihan98ersoy commented on June 24, 2024

Your test ID seems wrong. And test prefix included.
Can you test with these test IDs?

        private const string TestBannerAdId = "testw6vs28auh3";
        private const string TestInterstitialAdId = "testb4znbuh3n2";
        private const string TestRewardedAdId = "testx9dtjwj8hp";
        private const string TestSplashImageAdId = "testq6zq98hecj";
        private const string TestSplashVideoAdId = "testd7c5cewoj6";

image
image

from hms-unity-plugin.

flashmandv avatar flashmandv commented on June 24, 2024

Hello,

I tried it but it still refuses to show ads. I remember I changed these default values after my initial tests did not show working ads...so that's not the problem

from hms-unity-plugin.

alihan98ersoy avatar alihan98ersoy commented on June 24, 2024

Hello,

Can you try to build our demo scene(Huawei/Demos/Ads/AdsDemo.unity) with these kit settings [Picture]? If it works maybe the problem can be in the scripts. So you can refer to our demo scene to solve the problem.
image

from hms-unity-plugin.

flashmandv avatar flashmandv commented on June 24, 2024

I tried the demo but still no test ads are shown. The splash image and splash video are flashing black screen for parts of a second but no actual (test)ad is shown.

Here is my AndroidManifest if you see something wrong:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="net.boardgamesonline.Rento.huawei" android:installLocation="preferExternal" android:versionCode="0" android:versionName="1.0" xmlns:amazon="http://schemas.amazon.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
  <supports-screens android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
  <application  android:usesCleartextTraffic="true" android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="false" android:allowBackup="true">
    <activity android:exported="true" android:name="com.playrento.deeplink.RentoUnityPlayerActivity" android:label="@string/app_name" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize" android:launchMode="singleTask" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
      <intent-filter android:autoVerify="true">
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="http" android:host="playrento.com" android:pathPrefix="/inv" />
        <data android:scheme="https" android:host="playrento.com" android:pathPrefix="/inv" />
      </intent-filter>
      <intent-filter android:autoVerify="false">
        <action android:name="android.intent.action.VIEW" />
        <data android:scheme="rento" android:host="inv/" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
      </intent-filter>
      <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
      <meta-data android:name="android.app.lib_name" android:value="unity" />
      <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />

    </activity>
	<activity android:exported="false"
    android:name="com.astricstore.imageandvideopicker.AndroidPickerActivity"
    android:configChanges="orientation|keyboardHidden|screenSize">
    </activity>
     <activity android:exported="false"
    android:name="eu.janmuller.android.simplecropimage.CropImage"
    android:configChanges="orientation|keyboardHidden|screenSize">
    </activity>
    <meta-data android:name="com.huawei.hms.client.appid" android:value="appid=101046261" />
    <meta-data android:name="com.huawei.hms.client.cpid" android:value="cpid=890359200004000064" />
    <meta-data android:name="com.huawei.hms.version" android:value="2.6.1" />
    <provider android:name="com.huawei.updatesdk.fileprovider.UpdateSdkFileProvider" android:authorities="net.boardgamesonline.Rento.huawei.updateSdk.fileProvider" android:exported="false" android:grantUriPermissions="true" />

    <service android:exported="false" android:name=".MyFirebaseMessagingService">
      <intent-filter>
        <action android:name="com.google.firebase.MESSAGING_EVENT" />
      </intent-filter>
    </service>
    <service android:exported="false" android:name=".MyFirebaseInstanceIDService">
      <intent-filter>
        <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
      </intent-filter>
    </service>
   
  </application>
  <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <!-- used by image picker -->
  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <!-- used by image picker -->
  <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  <uses-permission android:name="com.huawei.appmarket.service.commondata.permission.GET_COMMON_DATA" />
  <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
  <uses-permission android:name="android.permission.READ_PHONE_STATE" />
 
</manifest>

from hms-unity-plugin.

alihan98ersoy avatar alihan98ersoy commented on June 24, 2024

These 2 line did not work for me. I delete these 2 line and it is working.

<meta-data android:name="com.huawei.hms.version" android:value="2.6.1" />
<provider android:name="com.huawei.updatesdk.fileprovider.UpdateSdkFileProvider" android:authorities="net.boardgamesonline.Rento.huawei.updateSdk.fileProvider" android:exported="false" android:grantUriPermissions="true" />

from hms-unity-plugin.

flashmandv avatar flashmandv commented on June 24, 2024

Unfortunately deleting these lines does not solve it for me. I also tried deleting the other ID metadatas for the Huawei SDK..still no ads on my Samsung (tried test ads and prod).
Here is my mainTemplate.gradle:

buildscript {
	repositories {
		google()
		jcenter()
		 maven {url 'https://developer.huawei.com/repo/'}
	}

	dependencies {
		//classpath 'com.huawei.agconnect:agcp:1.6.1.300'
	}
}

allprojects {
    repositories {
        google()
        jcenter()
        // Configure the Maven repository address for the Petal Ads SDK.
        maven {url 'https://developer.huawei.com/repo/'}
    }
} 

apply plugin: 'com.android.library'

**APPLY_PLUGINS**

dependencies {

    implementation fileTree(dir: 'libs', include: ['*.jar'])
    
**DEPS**}

android {
    compileSdkVersion **APIVERSION**
    buildToolsVersion '**BUILDTOOLS**'

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        minSdkVersion **MINSDKVERSION**
        targetSdkVersion **TARGETSDKVERSION**
        ndk {
            abiFilters **ABIFILTERS**
        }
        versionCode **VERSIONCODE**
        versionName '**VERSIONNAME**'
        consumerProguardFiles 'proguard-unity.txt'**USER_PROGUARD**
		multiDexEnabled true
    }

    lintOptions {
        abortOnError false
    }

    aaptOptions {
		noCompress = ['.ress', '.resource', '.obb'] + unityStreamingAssets.tokenize(', ')
        ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~"
    }**PACKAGING_OPTIONS**
}**REPOSITORIES****SOURCE_BUILD_SETUP**
**EXTERNAL_SOURCES**

And here is my launcherTemplate.gradle:

apply plugin: 'com.android.application'
buildscript {
	repositories {
		google()
		jcenter()
		maven {url 'https://developer.huawei.com/repo/'}
	}

	dependencies {
		//classpath 'com.huawei.agconnect:agcp:1.6.1.300'
	}
}

allprojects {
    repositories {
        google()
        jcenter()
        // Configure the Maven repository address for the Petal Ads SDK.
        maven {url 'https://developer.huawei.com/repo/'}
    }
} 

dependencies {

    implementation 'androidx.multidex:multidex:2.0.1'
    implementation project(':unityLibrary')
    }

android {
    compileSdkVersion **APIVERSION**
    buildToolsVersion '**BUILDTOOLS**'

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        minSdkVersion **MINSDKVERSION**
        targetSdkVersion **TARGETSDKVERSION**
		multiDexEnabled true
        applicationId '**APPLICATIONID**'
        ndk {
            abiFilters **ABIFILTERS**
        }
        versionCode **VERSIONCODE**
        versionName '**VERSIONNAME**'
    }

    aaptOptions {
        noCompress = ['.unity3d', '.ress', '.resource', '.obb'**STREAMING_ASSETS**] + unityStreamingAssets.tokenize(', ')
        ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~"
    }**SIGN**

    lintOptions {
        abortOnError false
    }

    buildTypes {
        debug {
            minifyEnabled **MINIFY_DEBUG**
            
            proguardFiles getDefaultProguardFile('proguard-android.txt')**SIGNCONFIG**
            jniDebuggable true
        }
        release {
            minifyEnabled **MINIFY_RELEASE**
            
            proguardFiles getDefaultProguardFile('proguard-android.txt')**SIGNCONFIG**
        }
    }**PACKAGING_OPTIONS****SPLITS**
**BUILT_APK_LOCATION**
    bundle {
        language {
            enableSplit = false
        }
        density {
            enableSplit = false
        }
        abi {
            enableSplit = true
        }
    }
}**SPLITS_VERSION_CODE****LAUNCHER_SOURCE_BUILD_SETUP**

And the settings in Unity:

image

image

image

from hms-unity-plugin.

Andronovo-bit avatar Andronovo-bit commented on June 24, 2024

We put your settings through their paces on several devices. We will keep you updated on the outcome.

from hms-unity-plugin.

Andronovo-bit avatar Andronovo-bit commented on June 24, 2024

Hello,

Following our testing, we did not encounter the Reason:$3 error; however, we did come across various other errors.

It is possible that these errors are due to a change in the testID. The error we encountered may differ from error code 3.

  • Could you please login the AppGallery store with your Huawei ID? (for Region change)
  • Could you please perform a test using the provided IDs and share the APK with us?

This will allow us to determine if the error corresponds to the one we encountered, and if so, we can provide a solution. If not, we will continue our investigation.

from hms-unity-plugin.

flashmandv avatar flashmandv commented on June 24, 2024

Hello @Andronovo-bit ,
The "Use Test Ads" apk I've sent is using exactly these default IDs from the SDK.
I'm also logging in with huawei ID and still no ad is shown.

from hms-unity-plugin.

Andronovo-bit avatar Andronovo-bit commented on June 24, 2024

I got it @flashmandv. Could the error you get be different when you use default test ids and when you say "Use Test Ads" ?

For example, before you were getting Reason:$3 error for Interstitial ads, could you be getting network error or Reason:$2 error now?

If the error has changed, you may probably not be able to see the ads due to another problem.

Did you try to change the region in AppGallery after using the default test ids and checking the ""Use Test Ads"" checkbox?

The application you gave in this app link contains the following ids and "Use Test Ads" is checked. Is this is right?

from hms-unity-plugin.

salman714 avatar salman714 commented on June 24, 2024

I just tested it with a Samsung phone and it is working for me. If you want, we can investigate the problem together. You can reopen this issue

can you share the sdk which is working on samsung phone if yes
reply me on [email protected]

from hms-unity-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.