Unity access Youlianghui (Guangdiantong|Tencent Advertising)

Unity access Youlianghui (Guangdiantong|Tencent Advertising)

Download address:
https://adnet.qq.com/resource/sdk
Tencent alliance unity plug-in 2.0.9
As shown in the figure above, the unity version and the Android version are updated on the same day. (Is it so efficient?)
But after downloading, I encountered various problems. No manifest no gradle. Fumbled a bit to finish the basic configuration.
It was also found that the class and method could not be found at all. As follows:

        //原方法已过时
        public static bool Init(string appId)
        {
    
    
            AndroidJavaObject gdtAdManager = new AndroidJavaClass("com.qq.e.comm.managers.GDTADManager").CallStatic<AndroidJavaObject>("getInstance");
            hasInit = gdtAdManager.Call<bool>("initWith", Utils.GetActivity(), appId);
            return hasInit;
        }

Check out the Android version update record and the source code of the Android sample. SDK methods are obsolete. Removed GDTADManager.

[Deleted] Removed the GDTADManager.getInstance().initWith() interface, please use the GDTAdSdk.init() interface;

So change the method of initializing the SDK in unity to GDTAdSdk.init(). As follows:

        public static void Init(string appId)
        {
    
    
            AndroidJavaObject gdtAdSdk = new AndroidJavaClass("com.qq.e.comm.managers.GDTAdSdk");
            gdtAdSdk.CallStatic("init", Utils.GetActivity(), appId);
        }
    private static bool hasInit = true;//旧代码默认为false。但是因为变更了类与方法,新方法没有返回值。先默认true。

The source code is as follows: https://download.csdn.net/download/gaoliang0/71328175

Pay attention to the code related to GDTAction, because there is no conversion attribution related key for the time being.

 GDTAction.Init("转化归因 action set id", "转化归因 secret key");

If you need to access conversion attribution, you can refer to the official document https://developers.adnet.qq.com/doc/android/union/union_conversion_sdk_guide
(You need to find the customer service to open the Media API to obtain the secret key. Then register DMPlatform and use the secret key to create a new priority Quanhui's advertising network. Obtain the id and key required for the above code.)
https://datamixplatform.com/

If you have better opinions or suggestions, and various questions, you can leave a message or contact q+171333547.

Guess you like

Origin blog.csdn.net/gaoliang0/article/details/122156027