com.azerion.bluestack 2.0.1 → 3.0.0-preview2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/Editor/BlueStackDependencies.xml +1 -1
  2. package/Example/Azerion.BlueStack.Example.asmdef +16 -0
  3. package/Example/Azerion.BlueStack.Example.asmdef.meta +7 -0
  4. package/Example/Prefabs/NativeAd.prefab +908 -0
  5. package/Example/Prefabs/NativeAd.prefab.meta +7 -0
  6. package/Example/Prefabs/SmallNativeAd.prefab +739 -0
  7. package/Example/Prefabs/SmallNativeAd.prefab.meta +7 -0
  8. package/Example/Prefabs.meta +8 -0
  9. package/Example/Scripts/NativeAdManager.cs +208 -0
  10. package/Example/Scripts/NativeAdManager.cs.meta +11 -0
  11. package/Example/Scripts/SmallNativeAdManager.cs +181 -0
  12. package/Example/Scripts/SmallNativeAdManager.cs.meta +11 -0
  13. package/Example/Scripts.meta +8 -0
  14. package/Example.meta +8 -0
  15. package/Plugins/Android/{bluestack-unity-android-bridge-1.0.1.aar → bluestack-unity-android-bridge-2.0.0-preview1.aar} +0 -0
  16. package/Plugins/Android/{bluestack-unity-android-bridge-1.0.1.aar.meta → bluestack-unity-android-bridge-2.0.0-preview1.aar.meta} +1 -1
  17. package/Plugins/iOS/BSUInterface.h +14 -0
  18. package/Plugins/iOS/BSUInterface.m +83 -1
  19. package/Plugins/iOS/BSUNativeAd.h +32 -0
  20. package/Plugins/iOS/BSUNativeAd.h.meta +27 -0
  21. package/Plugins/iOS/BSUNativeAd.m +82 -0
  22. package/Plugins/iOS/BSUNativeAd.m.meta +37 -0
  23. package/Plugins/iOS/BSUTypes.h +12 -0
  24. package/Runtime/API/BlueStackAds.cs +4 -2
  25. package/Runtime/API/NativeAd/NativeAd.cs +182 -0
  26. package/Runtime/API/NativeAd/NativeAd.cs.meta +3 -0
  27. package/Runtime/API/NativeAd/NativeAdEventArgs.cs +14 -0
  28. package/Runtime/API/NativeAd/NativeAdEventArgs.cs.meta +11 -0
  29. package/Runtime/API/NativeAd/NativeAdInteractionHandler.cs +157 -0
  30. package/Runtime/API/NativeAd/NativeAdInteractionHandler.cs.meta +11 -0
  31. package/Runtime/API/NativeAd/NativeAdInteractionUtils.cs +122 -0
  32. package/Runtime/API/NativeAd/NativeAdInteractionUtils.cs.meta +11 -0
  33. package/Runtime/API/NativeAd/NativeAdLoader.cs +57 -0
  34. package/Runtime/API/NativeAd/NativeAdLoader.cs.meta +11 -0
  35. package/Runtime/API/NativeAd/NativeAdObject.cs +520 -0
  36. package/Runtime/API/NativeAd/NativeAdObject.cs.meta +11 -0
  37. package/Runtime/API/NativeAd/NativeAdType.cs +8 -0
  38. package/Runtime/API/NativeAd/NativeAdType.cs.meta +11 -0
  39. package/Runtime/API/NativeAd/NativeAssetID.cs +30 -0
  40. package/Runtime/API/NativeAd/NativeAssetID.cs.meta +11 -0
  41. package/Runtime/API/NativeAd/NativeClientFactoryManager.cs +32 -0
  42. package/Runtime/API/NativeAd/NativeClientFactoryManager.cs.meta +11 -0
  43. package/Runtime/API/NativeAd.meta +8 -0
  44. package/Runtime/Common/NativeAd/AdLoaderClientArgs.cs +16 -0
  45. package/Runtime/Common/NativeAd/AdLoaderClientArgs.cs.meta +11 -0
  46. package/Runtime/Common/NativeAd/AdsEventExecutor.cs +84 -0
  47. package/Runtime/Common/NativeAd/AdsEventExecutor.cs.meta +11 -0
  48. package/Runtime/Common/NativeAd/DummyNativeClient.cs +61 -0
  49. package/Runtime/Common/NativeAd/DummyNativeClient.cs.meta +11 -0
  50. package/Runtime/Common/NativeAd/NativeClientEventArgs.cs +10 -0
  51. package/Runtime/Common/NativeAd/NativeClientEventArgs.cs.meta +11 -0
  52. package/Runtime/Common/NativeAd/NativeUtils.cs +117 -0
  53. package/Runtime/Common/NativeAd/NativeUtils.cs.meta +11 -0
  54. package/Runtime/Internal/IClientsFactory.cs +5 -2
  55. package/Runtime/Internal/NativeAd/IAdLoaderClient.cs +24 -0
  56. package/Runtime/Internal/NativeAd/IAdLoaderClient.cs.meta +11 -0
  57. package/Runtime/Internal/NativeAd/INativeAdClient.cs +25 -0
  58. package/Runtime/Internal/NativeAd/INativeAdClient.cs.meta +3 -0
  59. package/Runtime/Internal/NativeAd/INativeAdInteractionHandlerClient.cs +15 -0
  60. package/Runtime/Internal/NativeAd/INativeAdInteractionHandlerClient.cs.meta +11 -0
  61. package/Runtime/Internal/NativeAd/INativeClientFactory.cs +9 -0
  62. package/Runtime/Internal/NativeAd/INativeClientFactory.cs.meta +11 -0
  63. package/Runtime/Internal/NativeAd.meta +8 -0
  64. package/Runtime/Platforms/Android/AndroidJavaObjectFactory.cs +9 -1
  65. package/Runtime/Platforms/Android/BannerAdClient.cs +1 -1
  66. package/Runtime/Platforms/Android/BlueStackClient.cs +1 -1
  67. package/Runtime/Platforms/Android/BlueStackErrorUtils.cs +1 -1
  68. package/Runtime/Platforms/Android/BlueStackNativeClassNames.cs +4 -1
  69. package/Runtime/Platforms/Android/ClientsFactory.cs +12 -1
  70. package/Runtime/Platforms/Android/InitializationStatusClient.cs +1 -1
  71. package/Runtime/Platforms/Android/InterstitialAdClient.cs +1 -1
  72. package/Runtime/Platforms/Android/NativeAdClient.cs +108 -0
  73. package/Runtime/Platforms/Android/NativeAdClient.cs.meta +3 -0
  74. package/Runtime/Platforms/Android/PreferenceClient.cs +1 -1
  75. package/Runtime/Platforms/Android/RewardedVideoAdClient.cs +1 -1
  76. package/Runtime/Platforms/Unity/BannerAdClient.cs +1 -0
  77. package/Runtime/Platforms/Unity/ClientsFactory.cs +6 -1
  78. package/Runtime/Platforms/Unity/NativeAdClient.cs +101 -0
  79. package/Runtime/Platforms/Unity/NativeAdClient.cs.meta +3 -0
  80. package/Runtime/Platforms/Unity/RewardedTimer.cs +2 -2
  81. package/Runtime/Platforms/Unity/Utils.cs +73 -0
  82. package/Runtime/Platforms/Unity/Utils.cs.meta +11 -0
  83. package/Runtime/Platforms/iOS/BannerAdClient.cs +1 -1
  84. package/Runtime/Platforms/iOS/BlueStackClient.cs +1 -1
  85. package/Runtime/Platforms/iOS/BlueStackErrorUtils.cs +1 -1
  86. package/Runtime/Platforms/iOS/ClientsFactory.cs +13 -1
  87. package/Runtime/Platforms/iOS/Externs.cs +49 -1
  88. package/Runtime/Platforms/iOS/InitializationStatusClient.cs +1 -1
  89. package/Runtime/Platforms/iOS/InterstitialAdClient.cs +1 -1
  90. package/Runtime/Platforms/iOS/NativeAdClient.cs +156 -0
  91. package/Runtime/Platforms/iOS/NativeAdClient.cs.meta +3 -0
  92. package/Runtime/Platforms/iOS/PreferenceClient.cs +1 -1
  93. package/Runtime/Platforms/iOS/RewardedVideoAdClient.cs +1 -1
  94. package/Runtime/Platforms/iOS/Utils.cs +1 -1
  95. package/Runtime/Utilities/MiniJSON.cs +581 -0
  96. package/Runtime/Utilities/MiniJSON.cs.meta +11 -0
  97. package/Runtime/Utilities.meta +8 -0
  98. package/package.json +1 -1
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 755720907efeb471ab3564825cbe407c
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: d07f6b5da2f8f497181203b2890f193c
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -0,0 +1,16 @@
1
+ using System.Collections.Generic;
2
+ using Azerion.BlueStack.API;
3
+
4
+ namespace Azerion.BlueStack.Common
5
+ {
6
+ public class AdLoaderClientArgs
7
+ {
8
+ public string AdUnitId { get; set; }
9
+
10
+ public HashSet<NativeAdType> AdTypes { get; set; }
11
+
12
+ internal Dictionary<string, bool> FormatIds { get; set; }
13
+
14
+ internal int NumberOfAdsToLoad { get; set; }
15
+ }
16
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 1dc80e3bbad904bf78075aa748eb202b
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,84 @@
1
+ using System;
2
+ using System.Collections.Generic;
3
+ using UnityEngine;
4
+ using UnityEngine.Events;
5
+
6
+ namespace Azerion.BlueStack.Common
7
+ {
8
+ public class AdsEventExecutor : MonoBehaviour
9
+ {
10
+ public static AdsEventExecutor instance = null;
11
+
12
+ private static System.Collections.Generic.List<System.Action> adEventsQueue = new System.Collections.Generic.List<System.Action>();
13
+
14
+ private static volatile bool adEventsQueueEmpty = true;
15
+
16
+ public static void Initialize()
17
+ {
18
+ if (AdsEventExecutor.IsActive())
19
+ {
20
+ return;
21
+ }
22
+ GameObject gameObject = new GameObject("AdsMainThreadExecuter");
23
+ gameObject.hideFlags = HideFlags.HideAndDontSave;
24
+ UnityEngine.Object.DontDestroyOnLoad(gameObject);
25
+ AdsEventExecutor.instance = gameObject.AddComponent<AdsEventExecutor>();
26
+ }
27
+
28
+ public static bool IsActive()
29
+ {
30
+ return AdsEventExecutor.instance != null;
31
+ }
32
+
33
+ public void Awake()
34
+ {
35
+ UnityEngine.Object.DontDestroyOnLoad(base.gameObject);
36
+ }
37
+
38
+ public static void ExecuteInUpdate(System.Action action)
39
+ {
40
+ object obj = AdsEventExecutor.adEventsQueue;
41
+ lock (obj)
42
+ {
43
+ AdsEventExecutor.adEventsQueue.Add(action);
44
+ AdsEventExecutor.adEventsQueueEmpty = false;
45
+ }
46
+ }
47
+
48
+ public static void InvokeInUpdate(UnityEvent eventParam)
49
+ {
50
+ AdsEventExecutor.ExecuteInUpdate(delegate
51
+ {
52
+ eventParam.Invoke();
53
+ });
54
+ }
55
+
56
+ public void Update()
57
+ {
58
+ if (AdsEventExecutor.adEventsQueueEmpty)
59
+ {
60
+ return;
61
+ }
62
+ System.Collections.Generic.List<System.Action> list = new System.Collections.Generic.List<System.Action>();
63
+ object obj = AdsEventExecutor.adEventsQueue;
64
+ lock (obj)
65
+ {
66
+ list.AddRange(AdsEventExecutor.adEventsQueue);
67
+ AdsEventExecutor.adEventsQueue.Clear();
68
+ AdsEventExecutor.adEventsQueueEmpty = true;
69
+ }
70
+ foreach (System.Action current in list)
71
+ {
72
+ if (current.Target != null)
73
+ {
74
+ current();
75
+ }
76
+ }
77
+ }
78
+
79
+ public void OnDisable()
80
+ {
81
+ AdsEventExecutor.instance = null;
82
+ }
83
+ }
84
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: eb2ca4e1574654aedb9b41ce44387311
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,61 @@
1
+ using System;
2
+ using System.Collections.Generic;
3
+ using System.Reflection;
4
+ using Azerion.BlueStack.API;
5
+ using Azerion.BlueStack.Internal;
6
+ using UnityEngine;
7
+
8
+ namespace Azerion.BlueStack.Common
9
+ {
10
+ // public class DummyNativeClient : INativeAdInteractionHandlerClient, IAdLoaderClient
11
+ // {
12
+ // //* public event EventHandler<LoadAdErrorClientEventArgs> OnAdFailedToLoad;
13
+ //
14
+ // public event EventHandler<NativeClientEventArgs> OnNativeAdLoaded;
15
+ //
16
+ // public event EventHandler<EventArgs> OnNativeAdImpression;
17
+ //
18
+ // public event EventHandler<EventArgs> OnNativeAdClicked;
19
+ //
20
+ // public event EventHandler<EventArgs> OnNativeAdOpening;
21
+ //
22
+ // public event EventHandler<EventArgs> OnNativeAdClosed;
23
+ //
24
+ // public DummyNativeClient()
25
+ // {
26
+ // Debug.Log((object)("Dummy " + MethodBase.GetCurrentMethod()!.Name));
27
+ // }
28
+ //
29
+ // //* public void LoadAd(AdRequest request)
30
+ // // {
31
+ // // Debug.Log((object)("Dummy " + MethodBase.GetCurrentMethod()!.Name));
32
+ // // }
33
+ //
34
+ // public void CreateAdLoader(AdLoaderClientArgs args)
35
+ // {
36
+ // Debug.Log((object)("Dummy " + MethodBase.GetCurrentMethod()!.Name));
37
+ // }
38
+ //
39
+ // public Dictionary<string, string> GetAssetIDMappings()
40
+ // {
41
+ // Debug.Log((object)("Dummy " + MethodBase.GetCurrentMethod()!.Name));
42
+ // return null;
43
+ // }
44
+ //
45
+ // public bool RecordImpression(Dictionary<string, object> signal)
46
+ // {
47
+ // Debug.Log((object)("Dummy " + MethodBase.GetCurrentMethod()!.Name));
48
+ // return false;
49
+ // }
50
+ //
51
+ // public void PerformClick(Dictionary<string, object> signal)
52
+ // {
53
+ // Debug.Log((object)("Dummy " + MethodBase.GetCurrentMethod()!.Name));
54
+ // }
55
+ //
56
+ // public void ReportTouchEvent(Dictionary<string, string> signal)
57
+ // {
58
+ // Debug.Log((object)("Dummy " + MethodBase.GetCurrentMethod()!.Name));
59
+ // }
60
+ // }
61
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 61ca55535964a4e2490dd86b4e9c56d3
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,10 @@
1
+ using System;
2
+ using Azerion.BlueStack.Internal;
3
+
4
+ namespace Azerion.BlueStack.Common
5
+ {
6
+ public class NativeClientEventArgs : EventArgs
7
+ {
8
+ internal INativeAdClient nativeAdClient { get; set; }
9
+ }
10
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: c1670c29f79c442529dbc66909fe6a22
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,117 @@
1
+ using System;
2
+ using System.Collections;
3
+ using System.Collections.Generic;
4
+ using System.Diagnostics;
5
+ using Azerion.BlueStack.MiniJSON;
6
+ using UnityEngine;
7
+ using Debug = UnityEngine.Debug;
8
+
9
+ namespace Azerion.BlueStack.Common
10
+ {
11
+ internal class NativeUtils
12
+ {
13
+ public static string Version
14
+ {
15
+ get;
16
+ private set;
17
+ }
18
+
19
+ static NativeUtils()
20
+ {
21
+ Version version = typeof(NativeUtils).Assembly.GetName().Version;
22
+ NativeUtils.Version = string.Format("{0}.{1}.{2}", version.Major, version.Minor, version.Revision);
23
+ }
24
+
25
+ public static bool IsRenderedInScreenSpaceOverlayCanvas(GameObject gameObject)
26
+ {
27
+ Canvas componentInParent = gameObject.GetComponentInParent<Canvas>();
28
+ return !(componentInParent == null) && componentInParent.renderMode == RenderMode.ScreenSpaceOverlay;
29
+ }
30
+
31
+ public static Vector3 GetBoundsMin(GameObject gameObject, Camera cam, Bounds bounds)
32
+ {
33
+ if (!NativeUtils.IsRenderedInScreenSpaceOverlayCanvas(gameObject))
34
+ {
35
+ return cam.WorldToScreenPoint(bounds.min);
36
+ }
37
+ return bounds.min;
38
+ }
39
+
40
+ public static Vector3 GetBoundsMax(GameObject gameObject, Camera cam, Bounds bounds)
41
+ {
42
+ if (!NativeUtils.IsRenderedInScreenSpaceOverlayCanvas(gameObject))
43
+ {
44
+ return cam.WorldToScreenPoint(bounds.max);
45
+ }
46
+ return bounds.max;
47
+ }
48
+
49
+ public static Camera GetCamera()
50
+ {
51
+ Camera[] array = new Camera[Camera.allCamerasCount];
52
+ Camera.GetAllCameras(array);
53
+ Camera camera = null;
54
+ foreach (var camera2 in array)
55
+ {
56
+ if (camera == null || camera2.depth >= camera.depth)
57
+ {
58
+ camera = camera2;
59
+ }
60
+ }
61
+ return camera;
62
+ }
63
+
64
+ public static float ConvertPxToDp(float pixels)
65
+ {
66
+ float num = 160f;
67
+ return pixels / (Screen.dpi / num);
68
+ }
69
+
70
+ public static Dictionary<string, string> CastAssetIDMappings(string jsonMappings)
71
+ {
72
+ Dictionary<string, object> dictionary = Json.Deserialize(jsonMappings) as Dictionary<string, object>;
73
+ Dictionary<string, string> dictionary2 = new Dictionary<string, string>();
74
+ foreach (KeyValuePair<string, object> current in dictionary)
75
+ {
76
+ dictionary2.Add(current.Key, (current.Value != null) ? current.Value.ToString() : string.Empty);
77
+ }
78
+ return dictionary2;
79
+ }
80
+
81
+ [DebuggerHidden]
82
+ public static IEnumerator LoadImage(string url, Action<Texture2D> callback)
83
+ {
84
+ WWW www = new WWW(url);
85
+ float elapsedTime = 0f;
86
+ while (!www.isDone)
87
+ {
88
+ elapsedTime += Time.deltaTime;
89
+ if (elapsedTime >= 10f)
90
+ {
91
+ break;
92
+ }
93
+ yield return null;
94
+ }
95
+ if (!www.isDone || !string.IsNullOrEmpty(www.error))
96
+ {
97
+ callback(null);
98
+ }
99
+ else
100
+ {
101
+ callback(www.texture);
102
+ }
103
+ }
104
+
105
+ public static void CheckInitialization()
106
+ {
107
+ if (!AdsEventExecutor.IsActive())
108
+ AdsEventExecutor.Initialize();
109
+ }
110
+
111
+ public static Texture2D GetTexture2DFromByteArray(byte[] img)
112
+ {
113
+ Texture2D tex = new Texture2D(1, 1);
114
+ return tex.LoadImage(img) ? tex : throw new InvalidOperationException("Could not load custom native template image asset as texture");
115
+ }
116
+ }
117
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 494c3502c269d4d30904c45d4300f5de
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -4,10 +4,13 @@ namespace Azerion.BlueStack.Internal
4
4
  {
5
5
  public IBlueStackClient CreateBlueStackClient();
6
6
 
7
- public IRewardedVideoAdClient CreatRewardedVideoAdClient();
7
+ public IBannerAdClient CreatBannerAdClient();
8
8
 
9
9
  public IInterstitialAdClient CreatInterstitialAdClient();
10
- public IBannerAdClient CreatBannerAdClient();
10
+
11
+ public IRewardedVideoAdClient CreatRewardedVideoAdClient();
12
+
13
+ public INativeAdClient CreateNativeAdClient();
11
14
 
12
15
  public IPreferenceClient CreateIPreferenceClient();
13
16
  }
@@ -0,0 +1,24 @@
1
+ using System;
2
+ using Azerion.BlueStack.API;
3
+ using Azerion.BlueStack.Common;
4
+
5
+ namespace Azerion.BlueStack.Internal
6
+ {
7
+ public interface IAdLoaderClient
8
+ {
9
+ event EventHandler<BlueStackError> OnAdFailedToLoad;
10
+
11
+ event EventHandler<NativeClientEventArgs> OnNativeAdLoaded; //NativeClientEventArgs
12
+
13
+ event EventHandler<EventArgs> OnNativeAdImpression;
14
+
15
+ event EventHandler<EventArgs> OnNativeAdClicked;
16
+
17
+ event EventHandler<EventArgs> OnNativeAdOpening;
18
+
19
+ event EventHandler<EventArgs> OnNativeAdClosed;
20
+
21
+ // void LoadAd(AdRequest request);
22
+ void LoadAd();
23
+ }
24
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: a88a14b4579c347bca0d6783750a7cb2
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,25 @@
1
+ using System;
2
+ using Azerion.BlueStack;
3
+ using Azerion.BlueStack.API;
4
+
5
+ namespace Azerion.BlueStack.Internal
6
+ {
7
+ public interface INativeAdClient
8
+ {
9
+ event EventHandler<EventArgs> OnNativeAdDidLoad;
10
+ event EventHandler<BlueStackError> OnNativeAdDidFail;
11
+
12
+ void Create(string placementId);
13
+ void Load();
14
+ void Load(IPreferenceClient iPreferenceClient);
15
+ string GetTitle();
16
+ string GetBodyText();
17
+ string GetCallToActionText();
18
+ byte[] GetBadgeBytes();
19
+ string GetBadge();
20
+ string GetIconUrl();
21
+ string GetCoverImageUrl();
22
+ string GetClickUrl();
23
+ void Destroy();
24
+ }
25
+ }
@@ -0,0 +1,3 @@
1
+ fileFormatVersion: 2
2
+ guid: 9d543869b69ca49cfa3837735785bc95
3
+ timeCreated: 1670229497
@@ -0,0 +1,15 @@
1
+ using System.Collections.Generic;
2
+
3
+ namespace Azerion.BlueStack.Internal
4
+ {
5
+ public interface INativeAdInteractionHandlerClient
6
+ {
7
+ Dictionary<string, string> GetAssetIDMappings();
8
+
9
+ bool RecordImpression(Dictionary<string, object> signal);
10
+
11
+ void PerformClick(Dictionary<string, object> signal);
12
+
13
+ void ReportTouchEvent(Dictionary<string, string> signal);
14
+ }
15
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 68ca9cc534da44c9bb64f648f5b5f737
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,9 @@
1
+ using Azerion.BlueStack.Common;
2
+
3
+ namespace Azerion.BlueStack.Internal
4
+ {
5
+ public interface INativeClientFactory
6
+ {
7
+ IAdLoaderClient BuildAdLoaderClient(AdLoaderClientArgs args);
8
+ }
9
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 0586cd4f477b74dfe90e955377bd788b
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: a5cf7c19ebd9d404a9c75d57f7fc18f4
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -1,4 +1,4 @@
1
- #if UNITY_ANDROID && !UNITY_EDITOR
1
+ #if UNITY_ANDROID //&& !UNITY_EDITOR
2
2
  using UnityEngine;
3
3
 
4
4
  namespace Azerion.BlueStack.Platforms.Android
@@ -33,6 +33,14 @@ namespace Azerion.BlueStack.Platforms.Android
33
33
  return new AndroidJavaObject(
34
34
  BlueStackNativeClassNames.UnityBannerAdClassName, activity, unityBannerAdListener);
35
35
  }
36
+
37
+ public virtual AndroidJavaObject CreateUnityNativeAdAndroidJavaObject(object unityNativeAdListener)
38
+ {
39
+ AndroidJavaClass playerClass = new AndroidJavaClass(BlueStackNativeClassNames.UnityActivityClassName);
40
+ AndroidJavaObject activity =
41
+ playerClass.GetStatic<AndroidJavaObject>("currentActivity");
42
+ return new AndroidJavaObject(BlueStackNativeClassNames.UnityNativeAd, activity, unityNativeAdListener);
43
+ }
36
44
  }
37
45
  }
38
46
  #endif
@@ -1,4 +1,4 @@
1
- #if UNITY_ANDROID && !UNITY_EDITOR
1
+ #if UNITY_ANDROID //&& !UNITY_EDITOR
2
2
  using System;
3
3
  using Azerion.BlueStack.API;
4
4
  using Azerion.BlueStack.API.Banner;
@@ -1,4 +1,4 @@
1
- #if UNITY_ANDROID && !UNITY_EDITOR
1
+ #if UNITY_ANDROID //&& !UNITY_EDITOR
2
2
  using System;
3
3
  using System.Collections.Generic;
4
4
  using Azerion.BlueStack.API;
@@ -1,4 +1,4 @@
1
- #if UNITY_ANDROID && !UNITY_EDITOR
1
+ #if UNITY_ANDROID //&& !UNITY_EDITOR
2
2
  using Azerion.BlueStack.API;
3
3
  using UnityEngine;
4
4
 
@@ -1,4 +1,4 @@
1
- #if UNITY_ANDROID && !UNITY_EDITOR
1
+ #if UNITY_ANDROID //&& !UNITY_EDITOR
2
2
  namespace Azerion.BlueStack.Platforms.Android
3
3
  {
4
4
  public class BlueStackNativeClassNames
@@ -26,6 +26,9 @@ namespace Azerion.BlueStack.Platforms.Android
26
26
  public const string UnityBannerAdClassName = "com.azerion.bluestack.unity.banner.UnityBannerAd";
27
27
  public const string UnityBannerAdListenerClassName = "com.azerion.bluestack.unity.banner.UnityBannerAdListener";
28
28
 
29
+ public const string UnityNativeAd = "com.azerion.bluestack.unity.native.UnityNativeAd";
30
+ public const string UnityNativeAdListener = "com.azerion.bluestack.unity.native.UnityNativeAdListener";
31
+
29
32
  #endregion
30
33
 
31
34
  #region Unity class names
@@ -1,4 +1,4 @@
1
- #if UNITY_ANDROID && !UNITY_EDITOR
1
+ #if UNITY_ANDROID //&& !UNITY_EDITOR
2
2
  using System;
3
3
  using System.Reflection;
4
4
  using Azerion.BlueStack.Internal;
@@ -62,6 +62,17 @@ namespace Azerion.BlueStack.Platforms.Android
62
62
  throw new InvalidOperationException(@"Called " + MethodBase.GetCurrentMethod()?.Name +
63
63
  " on non-Android runtime");
64
64
  }
65
+
66
+ public INativeAdClient CreateNativeAdClient()
67
+ {
68
+ if (Application.platform == RuntimePlatform.Android)
69
+ {
70
+ return new NativeAdClient(AndroidJavaObjectFactory.Instance, BlueStackErrorUtils.Instance);
71
+ }
72
+
73
+ throw new InvalidOperationException(@"Called " + MethodBase.GetCurrentMethod()?.Name +
74
+ " on non-Android runtime");
75
+ }
65
76
  }
66
77
  }
67
78
  #endif
@@ -1,4 +1,4 @@
1
- #if UNITY_ANDROID && !UNITY_EDITOR
1
+ #if UNITY_ANDROID //&& !UNITY_EDITOR
2
2
  using System.Collections.Generic;
3
3
  using Azerion.BlueStack.API;
4
4
  using Azerion.BlueStack.Internal;
@@ -1,4 +1,4 @@
1
- #if UNITY_ANDROID && !UNITY_EDITOR
1
+ #if UNITY_ANDROID //&& !UNITY_EDITOR
2
2
  using System;
3
3
  using Azerion.BlueStack.API;
4
4
  using Azerion.BlueStack.Internal;