SDK测试
parent
67d513434a
commit
05d3c4efa8
|
|
@ -1,4 +1,5 @@
|
|||
using System.Collections;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.ConstrainedExecution;
|
||||
using UnityEngine;
|
||||
|
|
@ -101,5 +102,22 @@ public class DeviceIdHandle
|
|||
#else
|
||||
Debug.Log("GetDeviceID: Initialized (editor or non-Android). Android call skipped.");
|
||||
#endif
|
||||
|
||||
#if SDK_BYTEDANCE
|
||||
try
|
||||
{
|
||||
AndroidJavaClass bridgeClass = new AndroidJavaClass("com.bytedance.convertunitybridge.ConvertUnityBridge");
|
||||
|
||||
var up = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
|
||||
var activity = up.GetStatic<AndroidJavaObject>("currentActivity");
|
||||
if (activity == null) return;
|
||||
|
||||
bridgeClass.CallStatic("init", activity, true);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError("BYTEDANCE SDK init Error! " + e);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,4 +44,5 @@ TalkingData:
|
|||
|
||||
Packages:
|
||||
- CrashSight@latest
|
||||
- DeviceHelper@0.0.1
|
||||
- DeviceHelper@0.0.1
|
||||
- ByteDanceAds@2.0.0
|
||||
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,2 @@
|
|||
Define_list:
|
||||
- SDK_BYTEDANCE
|
||||
Loading…
Reference in New Issue