com.puzzlescapegames.admob_native 1.0.2 → 1.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.
- package/Runtime/NativeAdMob.cs +9 -25
- package/package.json +1 -1
package/Runtime/NativeAdMob.cs
CHANGED
|
@@ -22,7 +22,7 @@ namespace PuzzlescapeGames.AdMobNative
|
|
|
22
22
|
{
|
|
23
23
|
DestroyAd();
|
|
24
24
|
|
|
25
|
-
Debug.Log( "Loading native overlay ad." );
|
|
25
|
+
Debug.Log( "[Native] AdMob Loading native overlay ad." );
|
|
26
26
|
|
|
27
27
|
var adRequest = new AdRequest();
|
|
28
28
|
var options = new NativeAdOptions { AdChoicesPlacement = AdChoicesPlacement.TopRightCorner, MediaAspectRatio = MediaAspectRatio.Any, };
|
|
@@ -31,7 +31,7 @@ namespace PuzzlescapeGames.AdMobNative
|
|
|
31
31
|
{
|
|
32
32
|
if ( error != null )
|
|
33
33
|
{
|
|
34
|
-
Debug.LogError( "Native Overlay ad failed to load an ad " + " with error: " + error );
|
|
34
|
+
Debug.LogError( "[Native] AdMob Native Overlay ad failed to load an ad " + " with error: " + error );
|
|
35
35
|
callback?.Invoke();
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
@@ -40,40 +40,24 @@ namespace PuzzlescapeGames.AdMobNative
|
|
|
40
40
|
// double-check to avoid a crash.
|
|
41
41
|
if ( ad == null )
|
|
42
42
|
{
|
|
43
|
-
Debug.LogError( "Unexpected error: Native Overlay ad load event " + " fired with null ad and null error." );
|
|
43
|
+
Debug.LogError( "[Native] AdMob Unexpected error: Native Overlay ad load event " + " fired with null ad and null error." );
|
|
44
44
|
callback?.Invoke();
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
// The operation completed successfully.
|
|
49
|
-
Debug.Log( "Native Overlay ad loaded with response : " + ad.GetResponseInfo() );
|
|
49
|
+
Debug.Log( "[Native] AdMob Native Overlay ad loaded with response : " + ad.GetResponseInfo() );
|
|
50
50
|
_nativeOverlayAd = ad;
|
|
51
|
-
|
|
52
|
-
// Register to ad events to extend functionality.
|
|
53
|
-
// RegisterEventHandlers( ad );
|
|
54
51
|
|
|
55
52
|
callback?.Invoke();
|
|
56
53
|
} );
|
|
57
54
|
}
|
|
58
55
|
|
|
59
|
-
public void RenderAd()
|
|
56
|
+
public void RenderAd( NativeTemplateStyle style )
|
|
60
57
|
{
|
|
61
58
|
if ( _nativeOverlayAd != null )
|
|
62
59
|
{
|
|
63
|
-
Debug.Log( "Rendering Native Overlay ad." );
|
|
64
|
-
|
|
65
|
-
var style = new NativeTemplateStyle
|
|
66
|
-
{
|
|
67
|
-
TemplateId = NativeTemplateId.Medium,
|
|
68
|
-
MainBackgroundColor = Color.red,
|
|
69
|
-
CallToActionText = new NativeTemplateTextStyle
|
|
70
|
-
{
|
|
71
|
-
BackgroundColor = Color.green,
|
|
72
|
-
TextColor = Color.white,
|
|
73
|
-
FontSize = 9,
|
|
74
|
-
Style = NativeTemplateFontStyle.Bold
|
|
75
|
-
}
|
|
76
|
-
};
|
|
60
|
+
Debug.Log( "[Native] AdMob Rendering Native Overlay ad." );
|
|
77
61
|
|
|
78
62
|
_nativeOverlayAd.RenderTemplate( style, AdPosition.Bottom );
|
|
79
63
|
}
|
|
@@ -83,7 +67,7 @@ namespace PuzzlescapeGames.AdMobNative
|
|
|
83
67
|
{
|
|
84
68
|
if ( _nativeOverlayAd != null )
|
|
85
69
|
{
|
|
86
|
-
Debug.Log( "Showing Native Overlay ad." );
|
|
70
|
+
Debug.Log( "[Native] AdMob Showing Native Overlay ad." );
|
|
87
71
|
_nativeOverlayAd.Show();
|
|
88
72
|
}
|
|
89
73
|
}
|
|
@@ -92,7 +76,7 @@ namespace PuzzlescapeGames.AdMobNative
|
|
|
92
76
|
{
|
|
93
77
|
if ( _nativeOverlayAd != null )
|
|
94
78
|
{
|
|
95
|
-
Debug.Log( "Hiding Native Overlay ad." );
|
|
79
|
+
Debug.Log( "[Native] AdMob Hiding Native Overlay ad." );
|
|
96
80
|
_nativeOverlayAd.Hide();
|
|
97
81
|
}
|
|
98
82
|
}
|
|
@@ -101,7 +85,7 @@ namespace PuzzlescapeGames.AdMobNative
|
|
|
101
85
|
{
|
|
102
86
|
if ( _nativeOverlayAd != null )
|
|
103
87
|
{
|
|
104
|
-
Debug.Log( "Destroying native overlay ad." );
|
|
88
|
+
Debug.Log( "[Native] AdMob Destroying native overlay ad." );
|
|
105
89
|
_nativeOverlayAd.Destroy();
|
|
106
90
|
_nativeOverlayAd = null;
|
|
107
91
|
}
|