com.azerion.bluestack 3.1.2 → 3.1.4

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.
@@ -47,16 +47,26 @@ namespace Azerion.BlueStack.Editor
47
47
  EditorApplication.ExecuteMenuItem("Window/General/Inspector");
48
48
  }
49
49
  }
50
+
51
+ // This is Required when updating the SDK.
52
+ // Initialize and Sync dependencies when project loaded in Unity Editor.
53
+ [InitializeOnLoadMethod]
54
+ static void OnProjectLoadedInEditor()
55
+ {
56
+ Initialize();
57
+ }
50
58
 
51
59
  void OnEnable()
60
+ {
61
+ Initialize();
62
+ }
63
+
64
+ static void Initialize()
52
65
  {
53
66
  BlueStackSettings.Instance.IOSMediationNetworks.Clear();
54
67
 
55
68
  // Sync/Copy base mediation dependency xml file from Package to Assets directory
56
69
  DependencyProvider.SyncMediationDependencies();
57
-
58
- iOSAdmobAppIdProperty = serializedObject.FindProperty("admobAppIdIOS");
59
- androidAdmobAppIdProperty = serializedObject.FindProperty("admobAppIdAndroid");
60
70
 
61
71
  var iOSMediationNetworkDependencies = DependencyProvider.GetAllMediationNetworkDependencies(new IOSDependencyParser());
62
72
 
@@ -75,6 +85,9 @@ namespace Azerion.BlueStack.Editor
75
85
  EditorGUI.BeginChangeCheck();
76
86
  // serializedObject.Update();
77
87
 
88
+ iOSAdmobAppIdProperty = serializedObject.FindProperty("admobAppIdIOS");
89
+ androidAdmobAppIdProperty = serializedObject.FindProperty("admobAppIdAndroid");
90
+
78
91
  EditorGUILayout.PropertyField(iOSAdmobAppIdProperty, new GUIContent("Admob AppId IOS: "));
79
92
  EditorGUILayout.PropertyField(androidAdmobAppIdProperty, new GUIContent("Admob AppId Android: "));
80
93
  EditorGUILayout.Separator();
@@ -12,10 +12,10 @@
12
12
 
13
13
  NS_ASSUME_NONNULL_BEGIN
14
14
 
15
- - (instancetype)initWithInterstitialClientReference:(BSUTypeInterstitialClientRef *)interstitialClient placementId:(NSString *_Nullable)placementId;
15
+ - (instancetype)initWithInterstitialClientReference:(BSUTypeInterstitialClientRef _Nonnull *_Nonnull)interstitialClient placementId:(NSString *_Nullable)placementId;
16
16
 
17
17
 
18
- @property(nonatomic, assign) BSUTypeInterstitialClientRef * _Nonnull interstitialClient;
18
+ @property(nonatomic, assign) BSUTypeInterstitialClientRef _Nonnull * _Nonnull interstitialClient;
19
19
 
20
20
  @property(nonatomic, assign) BSUOnInterstitialDidLoadedCallback onDidLoadedCallback;
21
21
 
@@ -31,7 +31,7 @@ NS_ASSUME_NONNULL_END
31
31
 
32
32
  - (void)loadAd;
33
33
 
34
- - (void)loadAdWithPreference:(BSUTypePreferenceRef)preferenceRef;
34
+ - (void)loadAdWithPreference:(BSUTypePreferenceRef _Nonnull )preferenceRef;
35
35
 
36
36
  - (void)show;
37
37
 
@@ -10,12 +10,11 @@
10
10
 
11
11
  @interface BSURewardedVideoAd : NSObject
12
12
 
13
+ NS_ASSUME_NONNULL_BEGIN
13
14
 
14
- - (instancetype)initWithRewardedClientReference:(BSUTypeRewardedVideoAdClientRef *)rewardedClient placementId:(NSString *_Nonnull)placementId;
15
-
16
- @property(nonatomic, assign) BSUTypeRewardedVideoAdClientRef * _Nonnull rewardedVideoAdClient;
15
+ - (instancetype)initWithRewardedClientReference:(BSUTypeRewardedVideoAdClientRef _Nonnull *_Nonnull)rewardedClient placementId:(NSString *_Nonnull)placementId;
17
16
 
18
- NS_ASSUME_NONNULL_BEGIN
17
+ @property(nonatomic, assign) BSUTypeRewardedVideoAdClientRef _Nonnull * _Nonnull rewardedVideoAdClient;
19
18
 
20
19
  @property(nonatomic, assign) BSUOnRewardedVideoLoadedCallback onLoadedCallback;
21
20
  @property(nonatomic, assign) BSUOnRewardedVideoErrorCallback onErrorCallback;
@@ -28,7 +27,7 @@ NS_ASSUME_NONNULL_END
28
27
 
29
28
  - (void)loadAd;
30
29
 
31
- - (void)loadAdWithPreference:(BSUTypePreferenceRef)preferenceRef;
30
+ - (void)loadAdWithPreference:(BSUTypePreferenceRef _Nonnull )preferenceRef;
32
31
 
33
32
  - (void)show;
34
33
 
@@ -84,7 +84,10 @@
84
84
 
85
85
  - (void)adsAdapterRewardedVideoAd:(MNGAdsAdapter *)adsAdapter withReward:(MAdvertiseReward *)reward {
86
86
  if (self.onRewardEarnedCallback != nil) {
87
- self.onRewardEarnedCallback(self.rewardedVideoAdClient, reward.amount != nil ? [reward.amount intValue] : 0);
87
+ self.onRewardEarnedCallback(self.rewardedVideoAdClient,
88
+ reward.type != nil ? [reward.type UTF8String] : "unknown",
89
+ reward.amount != nil ? [reward.amount intValue] : 0
90
+ );
88
91
  }
89
92
  }
90
93
 
@@ -45,7 +45,7 @@ typedef void (*BSUOnRewardedVideoClosedCallback)(BSUTypeRewardedVideoAdClientRef
45
45
  typedef void (*BSUOnRewardedVideoAppearedCallback)(BSUTypeRewardedVideoAdClientRef *rewardedVideoAdClient);
46
46
 
47
47
  typedef void (*BSUOnUserRewardEarnedCallback)(
48
- BSUTypeRewardedVideoAdClientRef *rewardedVideoAdClient, int rewardAmount);
48
+ BSUTypeRewardedVideoAdClientRef *rewardedVideoAdClient, const char* rewardType, int rewardAmount);
49
49
 
50
50
 
51
51
 
@@ -3,10 +3,12 @@ namespace Azerion.BlueStack.API.Rewarded
3
3
  public class RewardedItem
4
4
  {
5
5
  public double Amount { get; }
6
-
7
- public RewardedItem(double amount)
6
+ public string Type { get; }
7
+
8
+ public RewardedItem(double amount = 0, string type = "unknown")
8
9
  {
9
10
  this.Amount = amount;
11
+ this.Type = type;
10
12
  }
11
13
  }
12
14
  }
@@ -85,7 +85,7 @@ namespace Azerion.BlueStack.Platforms.Android
85
85
  RewardedItem rewardedItem = null;
86
86
  if (mAdvertiseVideoReward != null)
87
87
  {
88
- rewardedItem = new RewardedItem(mAdvertiseVideoReward.Call<double>("getAmount"));
88
+ rewardedItem = new RewardedItem(mAdvertiseVideoReward.Call<double>("getAmount"), mAdvertiseVideoReward.Call<string>("getType"));
89
89
  }
90
90
 
91
91
  OnUserRewardEarned?.Invoke(this, rewardedItem);
@@ -53,7 +53,7 @@ namespace Azerion.BlueStack.Platforms.UnityEditor
53
53
  else
54
54
  {
55
55
  timerText.text = "Reward earned!";
56
- OnUserRewardEarned?.Invoke(this, new RewardedItem(10));
56
+ OnUserRewardEarned?.Invoke(this, new RewardedItem(10, "coin"));
57
57
  }
58
58
  }
59
59
  }
@@ -24,7 +24,7 @@ namespace Azerion.BlueStack.Platforms.iOS
24
24
 
25
25
  internal delegate void BSUOnRewardedVideoAppearedCallback(IntPtr rewardedClient);
26
26
 
27
- internal delegate void BSUOnUserRewardEarnedCallback(IntPtr rewardedClient, int rewardAmount);
27
+ internal delegate void BSUOnUserRewardEarnedCallback(IntPtr rewardedClient, string rewardType, int rewardAmount);
28
28
 
29
29
  #endregion
30
30
 
@@ -152,12 +152,12 @@ namespace Azerion.BlueStack.Platforms.iOS
152
152
  }
153
153
 
154
154
  [AOT.MonoPInvokeCallback(typeof(BSUOnUserRewardEarnedCallback))]
155
- private static void OnUserRewardEarnedCallback(IntPtr rewardedClient, int rewardAmount)
155
+ private static void OnUserRewardEarnedCallback(IntPtr rewardedClient, string rewardType, int rewardAmount)
156
156
  {
157
157
  RewardedVideoAdClient client = IntPtrToRewardedVideoAdClient(rewardedClient);
158
158
  if (client.OnUserRewardEarned != null)
159
159
  {
160
- RewardedItem rewardArg = new RewardedItem(rewardAmount);
160
+ RewardedItem rewardArg = new RewardedItem(rewardAmount, rewardType);
161
161
  client.OnUserRewardEarned(client, e: rewardArg);
162
162
  }
163
163
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.azerion.bluestack",
3
- "version": "3.1.2",
3
+ "version": "3.1.4",
4
4
  "displayName": "BlueStack",
5
5
  "description": "BlueStack SDK has been designed to give developers options for showing Ads from different ad networks.",
6
6
  "unity": "2020.3",