com.azerion.bluestack 3.0.2-preview1 → 3.0.3

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.
@@ -1,4 +1,6 @@
1
- using System;
1
+ #if UNITY_ANDROID
2
+
3
+ using System;
2
4
  using System.IO;
3
5
  using System.Linq;
4
6
  using UnityEditor;
@@ -120,4 +122,6 @@ namespace Azerion.BlueStack.Editor.Android
120
122
  ManifestProcessor.Instance.process(manifestFile);
121
123
  }
122
124
  }
123
- }
125
+ }
126
+
127
+ #endif
@@ -3,6 +3,6 @@
3
3
  <androidPackage spec="com.azerion:bluestack-sdk-core:4.3.0" />
4
4
  </androidPackages>
5
5
  <iosPods>
6
- <iosPod name="BlueStack-SDK" version="4.4.0-preview.1" bitcodeEnabled="false" addToAllTargets="false"/>
6
+ <iosPod name="BlueStack-SDK" version="4.4.0" bitcodeEnabled="false" addToAllTargets="false" subspecs="['Google-Mobile-Ads-SDK']"/>
7
7
  </iosPods>
8
8
  </dependencies>
@@ -1,4 +1,4 @@
1
- //#if UNITY_IOS
1
+ #if UNITY_IOS
2
2
 
3
3
  using System.Collections.Generic;
4
4
  using UnityEditor;
@@ -43,6 +43,7 @@ namespace Azerion.BlueStack.Editor.iOS
43
43
  AddSKAdNetworkIdentifier(pathToBuildProject);
44
44
  AddAppTransportSecurity(pathToBuildProject);
45
45
  project.AddBuildProperty(unityFrameworkGuid, "ENABLE_BITCODE", "NO");
46
+ project.AddBuildProperty(unityFrameworkGuid, "OTHER_LDFLAGS", "-ld64");
46
47
  OverWriteMainProject(target, pathToBuildProject);
47
48
  DebugHelper.Log("Custom post process build script finished executing!");
48
49
  }
@@ -139,4 +140,4 @@ namespace Azerion.BlueStack.Editor.iOS
139
140
  }
140
141
  }
141
142
 
142
- //#endif
143
+ #endif
@@ -1,3 +1,4 @@
1
+ using System;
1
2
  using System.Collections;
2
3
  using System.Collections.Generic;
3
4
  using UnityEngine;
@@ -20,7 +21,7 @@ namespace Azerion.BlueStack.Example
20
21
  get
21
22
  {
22
23
  #if UNITY_IOS
23
- return "3180317"; //3180317
24
+ return "3180317"; //3180317
24
25
  #elif UNITY_ANDROID
25
26
  return "5180317";
26
27
  #endif
@@ -32,7 +33,7 @@ namespace Azerion.BlueStack.Example
32
33
  get
33
34
  {
34
35
  #if UNITY_IOS
35
- return "/" + AppId + "/nativeadmng";
36
+ return "/" + AppId + "/nativeadmng";
36
37
  #elif UNITY_ANDROID
37
38
  return "/" + AppId + "/nativead";
38
39
  #endif
@@ -180,9 +181,22 @@ namespace Azerion.BlueStack.Example
180
181
  Debug.Log("NativeAdManager: Unified Native Ad Loaded");
181
182
  this.nativeAd = args.nativeAd;
182
183
  this.unifiedNativeAdLoaded = true;
184
+
185
+ this.nativeAd.OnNativeAdImpression += this.HandleNativeAdImpression;
186
+ this.nativeAd.OnNativeAdClicked += this.HandleNativeAdClicked;
187
+
183
188
  // RegisterGameObjects();
184
189
  }
185
190
 
191
+ private void HandleNativeAdImpression(object sender, EventArgs args)
192
+ {
193
+ Debug.Log("NativeAdManager: Native Ad Impression successful");
194
+ }
195
+
196
+ private void HandleNativeAdClicked(object sender, EventArgs args)
197
+ {
198
+ Debug.Log("NativeAdManager: Unified Native Ad click successful");
199
+ }
186
200
 
187
201
  private Preference CreatePreference()
188
202
  {
@@ -1,3 +1,4 @@
1
+ using System;
1
2
  using System.Collections;
2
3
  using System.Collections.Generic;
3
4
  using UnityEngine;
@@ -20,7 +21,7 @@ namespace Azerion.BlueStack.Example
20
21
  get
21
22
  {
22
23
  #if UNITY_IOS
23
- return "3180317"; //3180317
24
+ return "3180317"; //3180317
24
25
  #elif UNITY_ANDROID
25
26
  return "5180317";
26
27
  #endif
@@ -32,7 +33,7 @@ namespace Azerion.BlueStack.Example
32
33
  get
33
34
  {
34
35
  #if UNITY_IOS
35
- return "/" + AppId + "/nativead";
36
+ return "/" + AppId + "/nativead";
36
37
  #elif UNITY_ANDROID
37
38
  return "/" + AppId + "/nativead";
38
39
  #endif
@@ -148,15 +149,28 @@ namespace Azerion.BlueStack.Example
148
149
  Debug.Log("BlueStack NativeAd failed to load: " + "errorCode: " + args.ErrorCode + " message: " +
149
150
  args.Message);
150
151
  }
151
-
152
+
152
153
  private void HandleNativeAdLoaded(object sender, NativeAdEventArgs args)
153
154
  {
154
155
  Debug.Log("NativeAdManager: Unified Native Ad Loaded");
155
156
  this.nativeAd = args.nativeAd;
156
157
  this.unifiedNativeAdLoaded = true;
158
+
159
+ this.nativeAd.OnNativeAdImpression += this.HandleNativeAdImpression;
160
+ this.nativeAd.OnNativeAdClicked += this.HandleNativeAdClicked;
161
+
157
162
  // RegisterGameObjects();
158
163
  }
159
164
 
165
+ private void HandleNativeAdImpression(object sender, EventArgs args)
166
+ {
167
+ Debug.Log("NativeAdManager: Native Ad Impression successful");
168
+ }
169
+
170
+ private void HandleNativeAdClicked(object sender, EventArgs args)
171
+ {
172
+ Debug.Log("NativeAdManager: Unified Native Ad click successful");
173
+ }
160
174
 
161
175
  private Preference CreatePreference()
162
176
  {
@@ -19,6 +19,7 @@ NS_ASSUME_NONNULL_BEGIN
19
19
  @property(nonatomic, assign) BSUOnNativeAdDidPerformClickCallback onPerformClickCallback;
20
20
  @property(nonatomic, assign) BSUOnNativeAdCloseCallback onCloseCallback;
21
21
 
22
+
22
23
  @property (nonatomic, retain) NSString *title;
23
24
  @property (nonatomic, retain) NSString *body;
24
25
  @property (nonatomic, retain) NSString *callToAction;
@@ -4,8 +4,7 @@
4
4
  #import <UIKit/UIKit.h>
5
5
  #import <BlueStackSDK/BlueStackSDK.h>
6
6
 
7
- @interface BSUNativeAd()<MNGAdsAdapterNativeDelegate, MNGClickDelegate>
8
-
7
+ @interface BSUNativeAd()<MNGAdsAdapterNativeDelegate, MNGClickDelegate, MNGNativeAdImpressionListener>
9
8
  @property(nonatomic, strong) MNGAdsSDKFactory *nativeAdsFactory;
10
9
 
11
10
  @end
@@ -40,21 +39,14 @@
40
39
 
41
40
  - (void)recordImpression:(nonnull NSDictionary *)args {
42
41
  if (self.nativeAdsObject) {
43
- // [self.nativeAdsObject recordImpression:args];
44
-
45
- if (self.onRecordImpressionCallback) {
46
- self.onRecordImpressionCallback(self.nativeAdClient); // TODO : Should be verified and triggered from core sdk
47
- }
42
+ [self.nativeAdsObject setNativeAdImpressionListener:self];
43
+ [self.nativeAdsObject recordImpression:args];
48
44
  }
49
45
  }
50
46
 
51
47
  - (void)performClick:(nonnull NSDictionary *)args {
52
48
  if (self.nativeAdsObject) {
53
- // [self.nativeAdsObject performClick:args];
54
-
55
- if (self.onPerformClickCallback) {
56
- self.onPerformClickCallback(self.nativeAdClient); // TODO : Should be verified and triggered from core sdk
57
- }
49
+ [self.nativeAdsObject performClick:args];
58
50
  }
59
51
  }
60
52
 
@@ -71,23 +63,18 @@
71
63
 
72
64
  #pragma mark MNGAdsAdapterNativeDelegate
73
65
 
74
- // - (void)nativeObjectDidLoad:(MNGAdsAdapter *)adsAdapter {
75
- // if (self.onDidLoadCallback != nil) {
76
- // self.onDidLoadCallback(self.nativeAdClient);
77
- // }
78
- // }
79
66
 
80
67
  -(void)adsAdapter:(MNGAdsAdapter *)adsAdapter nativeObjectDidLoad:(MNGNAtiveObject *)nativeObject{
81
- NSLog(@"adsAdapterNativeObjectDidLoad:");
68
+ NSLog(@"BSUNativeAd: adsAdapter: nativeObjectDidLoad!");
82
69
  if (self.onDidLoadCallback != nil) {
83
70
  self.nativeAdsObject = nativeObject;
84
71
  self.title = nativeObject.title;
85
72
  self.body = nativeObject.body;
86
73
  self.badge = @"Ad"; //nativeObject.badge;
87
74
  self.callToAction = nativeObject.callToAction;
88
- self.clickUrl = @"https://developers.bluestack.app/"; //nativeObject.clickUrl;
89
- self.iconUrl = @"https://creative.mng-ads.com/10/10394-15539.jpg"; //nativeObject.iconUrl;
90
- self.coverImageUrl = @"https://creative.mng-ads.com/10/10394-15540.jpg"; //nativeObject.coverImageUrl;
75
+ self.iconUrl = nativeObject.iconUrl;
76
+ self.coverImageUrl = nativeObject.coverImageUrl;
77
+ // self.clickUrl = //nativeObject.clickUrl; @"https://developers.bluestack.app/";
91
78
 
92
79
  self.onDidLoadCallback(self.nativeAdClient);
93
80
  }
@@ -99,6 +86,7 @@
99
86
  }
100
87
 
101
88
  - (void)adsAdapter:(MNGAdsAdapter *)adsAdapter nativeObjectDidFailWithError:(NSError *)error withCover:(BOOL)cover{
89
+ NSLog(@"BSUNativeAd: adsAdapter: nativeObjectDidFailWithError!");
102
90
  if (self.onDidFailCallback != nil) {
103
91
  self.onDidFailCallback(self.nativeAdClient, (__bridge BSUTypeErrorRef)error);
104
92
  }
@@ -113,10 +101,13 @@
113
101
  }
114
102
  }
115
103
 
116
- //- (void)adsAdapterAdWasClicked:(MNGAdsAdapter *)adsAdapter {
117
- // if (self.onAdClickedCallback) {
118
- // self.onAdClickedCallback(self.bannerClient);
119
- // }
120
- //}
104
+ #pragma mark MNGNativeAdImpressionListener
105
+
106
+ - (void)onAdImpression {
107
+ if (self.onRecordImpressionCallback) {
108
+ NSLog(@"BSUNativeAd: MNGNativeAdImpressionListener: onAdImpression!");
109
+ self.onRecordImpressionCallback(self.nativeAdClient);
110
+ }
111
+ }
121
112
 
122
113
  @end
@@ -13,15 +13,19 @@ namespace Azerion.BlueStack.API
13
13
 
14
14
  private int _width;
15
15
  private int _height;
16
-
16
+ private string _size;
17
+
17
18
  public AdSize(int width, int height, string size)
18
19
  {
19
20
  this._width = width;
20
21
  this._height = height;
22
+ this._size = size;
21
23
  }
22
24
 
23
25
  public int Width => _width;
24
26
 
25
27
  public int Height => _height;
28
+
29
+ public string Size => _size;
26
30
  }
27
31
  }
@@ -46,7 +46,7 @@ namespace Azerion.BlueStack.API
46
46
  {
47
47
  LoadTextures();
48
48
  });
49
- SetClickUrl();
49
+ // SetClickUrl();
50
50
  };
51
51
  _nativeAdClient.OnNativeAdDidFail += (sender, args) => { OnNativeAdDidFail?.Invoke(this, args); };
52
52
  _nativeAdClient.OnNativeAdImpression += (sender, args) => { OnNativeAdImpression?.Invoke(this, args); };
@@ -101,7 +101,7 @@ namespace Azerion.BlueStack.API
101
101
 
102
102
  public string GetTitle()
103
103
  {
104
- Debug.Log("GetTitle: " + _nativeAdClient.GetTitle());
104
+ // Debug.Log("GetTitle: " + _nativeAdClient.GetTitle());
105
105
  // LoadTextures();
106
106
  return _nativeAdClient.GetTitle();
107
107
  }
package/package.json CHANGED
@@ -1,9 +1,14 @@
1
1
  {
2
2
  "name": "com.azerion.bluestack",
3
- "version": "3.0.2-preview1",
3
+ "version": "3.0.3",
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",
7
+ "documentationUrl": "https://developers.bluestack.app/unity",
8
+ "changelogUrl": "https://developers.bluestack.app/unity/changelog",
9
+ "dependencies": {
10
+ "com.google.external-dependency-manager": "1.2.178"
11
+ },
7
12
  "author": {
8
13
  "name": "BlueStack",
9
14
  "url": "https://azerion.com/"