diff --git a/Amazon/Amazon.asmdef b/Amazon/Amazon.asmdef index 04ce4ba..7d1153c 100644 --- a/Amazon/Amazon.asmdef +++ b/Amazon/Amazon.asmdef @@ -1,6 +1,6 @@ { "name": "Amazon", - "rootNamespace": "", + "rootNamespace": "AmazonAds", "references": [ "MaxSdk", "MaxSdk.Scripts" diff --git a/Amazon/Plugins/iOS.meta b/Amazon/Plugins/iOS.meta index 103e0d1..ed1612d 100644 --- a/Amazon/Plugins/iOS.meta +++ b/Amazon/Plugins/iOS.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: fd97fc7641615462abc63e027208b9a2 +guid: 24337d8fd6824de408fd642c0e3146b9 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Amazon/Plugins/iOS/Amazon-SDK-Plugin.podspec b/Amazon/Plugins/iOS/Amazon-SDK-Plugin.podspec index c7e21c1..b5c9f9a 100644 --- a/Amazon/Plugins/iOS/Amazon-SDK-Plugin.podspec +++ b/Amazon/Plugins/iOS/Amazon-SDK-Plugin.podspec @@ -11,6 +11,7 @@ Pod::Spec.new do |s| s.dependency 'AmazonPublisherServicesSDK' s.pod_target_xcconfig = { + 'ENABLE_BITCODE' => 'NO', 'OTHER_CPLUSPLUSFLAGS' => '-fcxx-modules', } -end +end \ No newline at end of file diff --git a/Amazon/Plugins/iOS/Amazon-SDK-Plugin.podspec.meta b/Amazon/Plugins/iOS/Amazon-SDK-Plugin.podspec.meta index 2ab557c..193c093 100644 --- a/Amazon/Plugins/iOS/Amazon-SDK-Plugin.podspec.meta +++ b/Amazon/Plugins/iOS/Amazon-SDK-Plugin.podspec.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ce7a667caa6f64752b219fe8edd61617 +guid: ef1aca82fadf5594c9294472e9a39a60 DefaultImporter: externalObjects: {} userData: diff --git a/Amazon/Plugins/iOS/AmazonBinding.m b/Amazon/Plugins/iOS/AmazonBinding.m index eb30853..7ad920b 100644 --- a/Amazon/Plugins/iOS/AmazonBinding.m +++ b/Amazon/Plugins/iOS/AmazonBinding.m @@ -162,10 +162,6 @@ void _addSlotGroup(DTBSlotGroup* slot){ [[AmazonManager sharedManager] addSlotGroup:slot]; } -const char* _fetchMoPubKeywords(DTBAdResponse* response){ - return amazonStringCopy([[AmazonManager sharedManager] fetchMoPubKeywords:response]); -} - const char* _fetchAmznSlots(DTBAdResponse* response){ return amazonStringCopy([[AmazonManager sharedManager] fetchAmznSlots:response]); } diff --git a/Amazon/Plugins/iOS/AmazonBinding.m.meta b/Amazon/Plugins/iOS/AmazonBinding.m.meta index bd71100..5903014 100644 --- a/Amazon/Plugins/iOS/AmazonBinding.m.meta +++ b/Amazon/Plugins/iOS/AmazonBinding.m.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: bc75c2542fbb6469798f0dc4baf0100e +guid: 9d97bf664a8fcf944992cbb98d7bc72c PluginImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Plugins/iOS/AmazonManager.h b/Amazon/Plugins/iOS/AmazonManager.h index 7735ac4..bcadcb0 100755 --- a/Amazon/Plugins/iOS/AmazonManager.h +++ b/Amazon/Plugins/iOS/AmazonManager.h @@ -46,7 +46,6 @@ -(DTBSlotGroup*)createSlotGroup:(NSString*)slotGroupName; -(void)addSlot:(DTBSlotGroup*)slot size:(DTBAdSize*)size; -(void)addSlotGroup:(DTBSlotGroup*)group; --(NSString*)fetchMoPubKeywords:(DTBAdResponse*)response; -(NSString*)fetchAmznSlots:(DTBAdResponse*)response; -(int)fetchAdWidth:(DTBAdResponse*)response; -(int)fetchAdHeight:(DTBAdResponse*)response; diff --git a/Amazon/Plugins/iOS/AmazonManager.h.meta b/Amazon/Plugins/iOS/AmazonManager.h.meta index dd4b61d..64384be 100644 --- a/Amazon/Plugins/iOS/AmazonManager.h.meta +++ b/Amazon/Plugins/iOS/AmazonManager.h.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 9d0a8448aa0c147e8a0225de1609f269 +guid: 2e1cac3d96762d449875050ca121f4da PluginImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Plugins/iOS/AmazonManager.mm b/Amazon/Plugins/iOS/AmazonManager.mm index 075dc1e..96ef36d 100644 --- a/Amazon/Plugins/iOS/AmazonManager.mm +++ b/Amazon/Plugins/iOS/AmazonManager.mm @@ -1,5 +1,7 @@ #import "AmazonManager.h" +static NSString * const SKADNETWORK_PARAM = @"skadn_params"; + @implementation AmazonManager #pragma mark NSObject @@ -182,9 +184,6 @@ [DTBAds.sharedInstance addSlotGroup:group]; } --(NSString*)fetchMoPubKeywords:(DTBAdResponse*)response { - return [response keywordsForMopub]; -} -(NSString*)fetchAmznSlots:(DTBAdResponse *)response { return [response amznSlots]; @@ -209,6 +208,27 @@ [dateFormatter setDateFormat:@"dd-MM-yyyy"]; NSString *stringDate = [dateFormatter stringFromDate:myDate]; [mHint setValue:stringDate forKey:@"load_start"]; + + if (mHint[SKADNETWORK_PARAM]) { + @try { + NSMutableDictionary *skadn_dict = [[NSMutableDictionary alloc] initWithDictionary:[mHint objectForKey:SKADNETWORK_PARAM]]; + for(id key in skadn_dict) { + if ([[skadn_dict objectForKey:key] isKindOfClass:NSDate.class]) { + NSString *FormatedDate = [dateFormatter stringFromDate:[skadn_dict objectForKey:key]]; + [skadn_dict setValue:FormatedDate forKey:key]; + [mHint setValue:skadn_dict forKey:SKADNETWORK_PARAM ]; + } + } + } @catch (NSException *exception) { + NSLog(@"Exception :%@",exception.reason); + } + } + + if (![NSJSONSerialization isValidJSONObject:mHint]) { + NSLog(@"Invalid JSON Object"); + return nil; + } + NSData * jsonData = [NSJSONSerialization dataWithJSONObject:mHint options:0 error:&err]; NSString * mediationHints = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; return mediationHints; diff --git a/Amazon/Plugins/iOS/AmazonManager.mm.meta b/Amazon/Plugins/iOS/AmazonManager.mm.meta index 41eacc2..c2cbd68 100644 --- a/Amazon/Plugins/iOS/AmazonManager.mm.meta +++ b/Amazon/Plugins/iOS/AmazonManager.mm.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 65a7bcd4e95cc47c88cd2b6280e00c17 +guid: 3eda61770afc43b42aa9ec92fea59924 PluginImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Plugins/iOS/AmazonUnityCallback.h.meta b/Amazon/Plugins/iOS/AmazonUnityCallback.h.meta index b0ae32f..43ad9cd 100644 --- a/Amazon/Plugins/iOS/AmazonUnityCallback.h.meta +++ b/Amazon/Plugins/iOS/AmazonUnityCallback.h.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4ab68d8321afe4cca8177a404f816891 +guid: eccfcb2b937138c48b44c7208b81ff98 PluginImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Plugins/iOS/AmazonUnityCallback.mm.meta b/Amazon/Plugins/iOS/AmazonUnityCallback.mm.meta index e2a421d..b7b060f 100644 --- a/Amazon/Plugins/iOS/AmazonUnityCallback.mm.meta +++ b/Amazon/Plugins/iOS/AmazonUnityCallback.mm.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ab36449d445ac4544afe77c7c0539ec0 +guid: 459e879fe800355479f460f15ae3f34a PluginImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Plugins/iOS/DTBBannerDelegate.h.meta b/Amazon/Plugins/iOS/DTBBannerDelegate.h.meta index 64b2f50..3e0b42c 100644 --- a/Amazon/Plugins/iOS/DTBBannerDelegate.h.meta +++ b/Amazon/Plugins/iOS/DTBBannerDelegate.h.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: a58dbc723902c4dd6a148f77e0845a3c +guid: 48b2839701f014a86bce37c62ac4c698 PluginImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Plugins/iOS/DTBBannerDelegate.mm.meta b/Amazon/Plugins/iOS/DTBBannerDelegate.mm.meta index b00cb27..c56f819 100644 --- a/Amazon/Plugins/iOS/DTBBannerDelegate.mm.meta +++ b/Amazon/Plugins/iOS/DTBBannerDelegate.mm.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 64f2586d9fb3549848bbd34f6f8085d2 +guid: ddf46b748d5ca4bd1b52a59e051346a5 PluginImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Plugins/iOS/DTBInterstitialDelegate.h.meta b/Amazon/Plugins/iOS/DTBInterstitialDelegate.h.meta index e89a3e0..fcadea6 100644 --- a/Amazon/Plugins/iOS/DTBInterstitialDelegate.h.meta +++ b/Amazon/Plugins/iOS/DTBInterstitialDelegate.h.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ec64dc94f39894ffba7e39a14f3b2102 +guid: 23a35b63b9ca64f63ac1e624f7ec73d4 PluginImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Plugins/iOS/DTBInterstitialDelegate.mm.meta b/Amazon/Plugins/iOS/DTBInterstitialDelegate.mm.meta index d22315a..9d415a0 100644 --- a/Amazon/Plugins/iOS/DTBInterstitialDelegate.mm.meta +++ b/Amazon/Plugins/iOS/DTBInterstitialDelegate.mm.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4f43b5dc42cf54011b96f66d261f2619 +guid: f6abf5beb5efe42ad88f270ed8f412e1 PluginImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Sample/APSMaxMediation.unity b/Amazon/Sample/APSMaxMediation.unity index 70c896f..d34851a 100644 --- a/Amazon/Sample/APSMaxMediation.unity +++ b/Amazon/Sample/APSMaxMediation.unity @@ -387,7 +387,7 @@ RectTransform: m_Children: - {fileID: 491590228} m_Father: {fileID: 640056004} - m_RootOrder: 2 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -576,11 +576,12 @@ RectTransform: m_LocalScale: {x: 0, y: 0, z: 0} m_Children: - {fileID: 1889519549} + - {fileID: 1477954961} - {fileID: 820223061} - {fileID: 620422002} - {fileID: 735603278} - {fileID: 739627434} - - {fileID: 1477954961} + - {fileID: 929227399} m_Father: {fileID: 0} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -621,7 +622,7 @@ RectTransform: m_Children: - {fileID: 1079672022} m_Father: {fileID: 640056004} - m_RootOrder: 3 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -751,7 +752,7 @@ RectTransform: m_Children: - {fileID: 1682398784} m_Father: {fileID: 640056004} - m_RootOrder: 4 + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -849,6 +850,84 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 739627433} m_CullTransparentMesh: 0 +--- !u!1 &795246048 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 795246049} + - component: {fileID: 795246051} + - component: {fileID: 795246050} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &795246049 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 795246048} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 929227399} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 160, y: 30} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &795246050 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 795246048} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Go Back +--- !u!222 &795246051 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 795246048} + m_CullTransparentMesh: 0 --- !u!1 &820223060 GameObject: m_ObjectHideFlags: 0 @@ -881,7 +960,7 @@ RectTransform: m_Children: - {fileID: 1290993690} m_Father: {fileID: 640056004} - m_RootOrder: 1 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -979,6 +1058,136 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 820223060} m_CullTransparentMesh: 0 +--- !u!1 &929227398 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 929227399} + - component: {fileID: 929227402} + - component: {fileID: 929227401} + - component: {fileID: 929227400} + m_Layer: 5 + m_Name: Go Back + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &929227399 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 929227398} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 795246049} + m_Father: {fileID: 640056004} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: -144} + m_SizeDelta: {x: 160, y: 30} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &929227400 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 929227398} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Highlighted + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 929227401} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 946867261} + m_MethodName: goBack + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!114 &929227401 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 929227398} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &929227402 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 929227398} + m_CullTransparentMesh: 0 --- !u!1 &946867260 GameObject: m_ObjectHideFlags: 0 @@ -1360,7 +1569,7 @@ RectTransform: m_Children: - {fileID: 499681495} m_Father: {fileID: 640056004} - m_RootOrder: 5 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} diff --git a/Amazon/Sample/APSMaxMediation.unity.meta b/Amazon/Sample/APSMaxMediation.unity.meta index 143fe30..2e7bdf6 100644 --- a/Amazon/Sample/APSMaxMediation.unity.meta +++ b/Amazon/Sample/APSMaxMediation.unity.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: fb8e1477d33cb4076b8aa247ae7dd237 +guid: 2024bb7799cb45c489867a78c4ef889c DefaultImporter: externalObjects: {} userData: diff --git a/Amazon/Sample/AmazonMaxDemo.cs b/Amazon/Sample/AmazonMaxDemo.cs index a2c8167..49cf40e 100644 --- a/Amazon/Sample/AmazonMaxDemo.cs +++ b/Amazon/Sample/AmazonMaxDemo.cs @@ -3,6 +3,7 @@ using System; using AmazonAds; using UnityEngine; using System.Collections.Generic; +using UnityEngine.SceneManagement; public class AmazonMaxDemo : MonoBehaviour { @@ -47,6 +48,7 @@ public class AmazonMaxDemo : MonoBehaviour { Amazon.EnableTesting(true); Amazon.EnableLogging(true); Amazon.UseGeoLocation(true); + Amazon.IsLocationEnabled(); Amazon.SetMRAIDPolicy(Amazon.MRAIDPolicy.CUSTOM); Amazon.SetAdNetworkInfo(new AdNetworkInfo(DTBAdNetwork.MAX)); Amazon.SetMRAIDSupportedVersions(new string[] { "1.0", "2.0", "3.0" }); @@ -121,17 +123,18 @@ public class AmazonMaxDemo : MonoBehaviour { const int width = 320; const int height = 50; - if (bannerAdRequest != null) bannerAdRequest.DestroyFetchManager(); bannerAdRequest = new APSBannerAdRequest(width, height, amazonBannerSlotId); bannerAdRequest.onFailedWithError += (adError) => { MaxSdk.SetBannerLocalExtraParameter(maxBannerAdId, "amazon_ad_error", adError.GetAdError()); CreateMaxBannerAd(); + bannerAdRequest.Dispose(); }; bannerAdRequest.onSuccess += (adResponse) => { MaxSdk.SetBannerLocalExtraParameter(maxBannerAdId, "amazon_ad_response", adResponse.GetResponse()); CreateMaxBannerAd(); + bannerAdRequest.Dispose(); }; bannerAdRequest.LoadAd(); } @@ -294,4 +297,10 @@ public class AmazonMaxDemo : MonoBehaviour { { Debug.Log("OnRewardedAdRevenuePaidEvent"); } + + public void goBack() + { + MaxSdk.DestroyBanner(maxBannerAdId); + SceneManager.LoadScene(0); + } } \ No newline at end of file diff --git a/Amazon/Sample/AmazonMaxDemo.cs.meta b/Amazon/Sample/AmazonMaxDemo.cs.meta index f63575d..5da3891 100644 --- a/Amazon/Sample/AmazonMaxDemo.cs.meta +++ b/Amazon/Sample/AmazonMaxDemo.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 34ed58385e8924837ad87a1f2966e16b +guid: 312c0b7796265224ca6bd13197a7d5d6 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Amazon.cs b/Amazon/Scripts/Amazon.cs index 56a6544..555d95d 100644 --- a/Amazon/Scripts/Amazon.cs +++ b/Amazon/Scripts/Amazon.cs @@ -45,14 +45,18 @@ namespace AmazonAds { api.SetMRAIDPolicy (policy); } + + [Obsolete("APS no longer supports this API. For GDPR, we support TCFv2 strings. Implementation instructions can be found on the APS Portal under Resources > Privacy", false)] public static void SetCMPFlavor(Amazon.CMPFlavor cFlavor){ api.SetCMPFlavor(cFlavor); } + [Obsolete("APS no longer supports this API. For GDPR, we support TCFv2 strings. Implementation instructions can be found on the APS Portal under Resources > Privacy", false)] public static void SetConsentStatus(Amazon.ConsentStatus consentStatus){ api.SetConsentStatus(consentStatus); } + [Obsolete("APS no longer supports this API. For GDPR, we support TCFv2 strings. Implementation instructions can be found on the APS Portal under Resources > Privacy", false)] public static void SetVendorList(List vendorList){ api.SetVendorList(vendorList); } diff --git a/Amazon/Scripts/Amazon.cs.meta b/Amazon/Scripts/Amazon.cs.meta index d0579ef..9ad617c 100644 --- a/Amazon/Scripts/Amazon.cs.meta +++ b/Amazon/Scripts/Amazon.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d5987cccc71fa4c51877e7c22d2d5f56 +guid: 8b51dd1c8083d0a43b10a2507d7c4077 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/AmazonConstants.cs b/Amazon/Scripts/AmazonConstants.cs index 8e29fee..2a655f4 100644 --- a/Amazon/Scripts/AmazonConstants.cs +++ b/Amazon/Scripts/AmazonConstants.cs @@ -1,8 +1,8 @@ -using System; +using System; public static class AmazonConstants { - public const string VERSION = "1.4.3"; + public const string VERSION = "1.9.0"; public const string RELEASE_NOTES_URL = "https://ams.amazon.com/webpublisher/uam/docs/aps-mobile/resources"; //TODO : add Unity Release Notes link public const string titleAboutDialog = "About Amazon SDK"; diff --git a/Amazon/Scripts/AmazonConstants.cs.meta b/Amazon/Scripts/AmazonConstants.cs.meta index 178d6b3..858c89c 100644 --- a/Amazon/Scripts/AmazonConstants.cs.meta +++ b/Amazon/Scripts/AmazonConstants.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: a4c36066dbdad415b978c38a01a2b675 +guid: b7f4b6635633144c4a35f2a254c0cca2 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Common.meta b/Amazon/Scripts/Common.meta index 400da0c..4bda34d 100644 --- a/Amazon/Scripts/Common.meta +++ b/Amazon/Scripts/Common.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 8c45974962ec542baad78d4c30cd0056 +guid: 822aefd58f1740341957f448c17e0527 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Amazon/Scripts/Common/IAdInterstitial.cs.meta b/Amazon/Scripts/Common/IAdInterstitial.cs.meta index b43ecab..9b8c7da 100644 --- a/Amazon/Scripts/Common/IAdInterstitial.cs.meta +++ b/Amazon/Scripts/Common/IAdInterstitial.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d4da15e7be3dc455d97abce962533892 +guid: ed7d5de51284c48cb8938e48e74c1b48 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Common/IAdRequest.cs b/Amazon/Scripts/Common/IAdRequest.cs index 2aa4bcf..61154a4 100644 --- a/Amazon/Scripts/Common/IAdRequest.cs +++ b/Amazon/Scripts/Common/IAdRequest.cs @@ -3,7 +3,7 @@ using System.Collections; using System.Runtime.InteropServices; using UnityEngine; namespace AmazonAds { - public abstract class IAdRequest { + public abstract class IAdRequest : IDisposable { protected int refreshTime = 60; protected string autoRefreshID = "0"; //FetchManageerUniqueID protected bool isAutoRefreshAdMob = false; @@ -38,6 +38,9 @@ namespace AmazonAds { public abstract void StartFetchManager(); public abstract void SetRefreshFlag(bool flag); + public void Dispose() { + } + protected static class Schedule { private class Runner : MonoBehaviour { } private static Runner _backer; diff --git a/Amazon/Scripts/Common/IAdRequest.cs.meta b/Amazon/Scripts/Common/IAdRequest.cs.meta index 5740c6e..a341cf8 100644 --- a/Amazon/Scripts/Common/IAdRequest.cs.meta +++ b/Amazon/Scripts/Common/IAdRequest.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ba13283bbee174961b809f3b9e502094 +guid: 7168c7b8916657b40b6a8e4f32705497 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Common/IAdSize.cs.meta b/Amazon/Scripts/Common/IAdSize.cs.meta index 56bd287..4d5ae54 100644 --- a/Amazon/Scripts/Common/IAdSize.cs.meta +++ b/Amazon/Scripts/Common/IAdSize.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 33e37a43420f84a408938af12117ff08 +guid: ac582b3e4345e494ca3609440fc4fe2b MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Common/IAdView.cs b/Amazon/Scripts/Common/IAdView.cs index 2c9a617..e1eb286 100644 --- a/Amazon/Scripts/Common/IAdView.cs +++ b/Amazon/Scripts/Common/IAdView.cs @@ -7,5 +7,7 @@ using UnityEngine; namespace AmazonAds { public abstract class IAdView { public abstract void FetchAd (AdResponse adResponse); + public void Dispose() { + } } } \ No newline at end of file diff --git a/Amazon/Scripts/Common/IAdView.cs.meta b/Amazon/Scripts/Common/IAdView.cs.meta index 3497cce..800cc5a 100644 --- a/Amazon/Scripts/Common/IAdView.cs.meta +++ b/Amazon/Scripts/Common/IAdView.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: adeba99c4a0f04b54b8af9623665e2d5 +guid: 48d4f5afa2a1440c29ea78d8f33885dc MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Common/IFetchManager.cs.meta b/Amazon/Scripts/Common/IFetchManager.cs.meta index 38b4b40..ee75f59 100644 --- a/Amazon/Scripts/Common/IFetchManager.cs.meta +++ b/Amazon/Scripts/Common/IFetchManager.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: dec92b206e59e400c8706ec073e326d1 +guid: 9145340011b3e427dbfe964d0bf59f55 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Common/ISlotGroup.cs.meta b/Amazon/Scripts/Common/ISlotGroup.cs.meta index b11a657..9e1de7b 100644 --- a/Amazon/Scripts/Common/ISlotGroup.cs.meta +++ b/Amazon/Scripts/Common/ISlotGroup.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 2b1f29380367c47c6a1c112ddc47ad84 +guid: 53a2d09f4898f244c84722134fc51501 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Editor.meta b/Amazon/Scripts/Editor.meta index bc42966..01e6165 100644 --- a/Amazon/Scripts/Editor.meta +++ b/Amazon/Scripts/Editor.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 60916135eefd74087bcd8ca80bd94ddc +guid: 43367e8560d848a4da8a31062731720b folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Amazon/Scripts/Editor/Amazon.Editor.asmdef.meta b/Amazon/Scripts/Editor/Amazon.Editor.asmdef.meta index ce8fb75..15a429f 100644 --- a/Amazon/Scripts/Editor/Amazon.Editor.asmdef.meta +++ b/Amazon/Scripts/Editor/Amazon.Editor.asmdef.meta @@ -1,3 +1,7 @@ fileFormatVersion: 2 -guid: 59f42bdf21710439a90f93e01e1f8984 -timeCreated: 1700190285 \ No newline at end of file +guid: 2bfb493dbc0ec40a29dde187397eb936 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Amazon/Scripts/Editor/AmazonAboutDialog.cs.meta b/Amazon/Scripts/Editor/AmazonAboutDialog.cs.meta index 6ff607b..9f0e6c4 100644 --- a/Amazon/Scripts/Editor/AmazonAboutDialog.cs.meta +++ b/Amazon/Scripts/Editor/AmazonAboutDialog.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 431a6434bfc0a47e8a2c936e434c3d3b +guid: 59ff8b0c895196d4bbec7aad4098ab3d MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Editor/AmazonBuildScript.cs b/Amazon/Scripts/Editor/AmazonBuildScript.cs index a27cfd2..5c31840 100644 --- a/Amazon/Scripts/Editor/AmazonBuildScript.cs +++ b/Amazon/Scripts/Editor/AmazonBuildScript.cs @@ -14,6 +14,8 @@ public class AmazonBuildScript string[] scenes = EditorBuildSettings.scenes.Where(s => s.enabled).Select(s => s.path).ToArray(); EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup.iOS, BuildTarget.iOS); string outputFileName = GetArg("-output", DEFAULT_IOS_BUILD_DIR); + PlayerSettings.iOS.appleDeveloperTeamID = "P78AXXW29G"; + PlayerSettings.iOS.appleEnableAutomaticSigning = true; BuildPipeline.BuildPlayer(scenes, outputFileName, BuildTarget.iOS, BuildOptions.Development); } diff --git a/Amazon/Scripts/Editor/AmazonBuildScript.cs.meta b/Amazon/Scripts/Editor/AmazonBuildScript.cs.meta index 8fe0170..959f709 100644 --- a/Amazon/Scripts/Editor/AmazonBuildScript.cs.meta +++ b/Amazon/Scripts/Editor/AmazonBuildScript.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c1378b372e98d4b56a16725bf370ae6c +guid: e80f7a57e62ab4edabfda12a4e7b34fe MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Editor/AmazonCoroutineExtensions.cs.meta b/Amazon/Scripts/Editor/AmazonCoroutineExtensions.cs.meta index e05f050..fcacf02 100644 --- a/Amazon/Scripts/Editor/AmazonCoroutineExtensions.cs.meta +++ b/Amazon/Scripts/Editor/AmazonCoroutineExtensions.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: aae61b43441904bbcbf7f24ff05e20d2 +guid: fb7213131ee033443bc8caa6cf8201aa MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Editor/AmazonCoroutines.cs.meta b/Amazon/Scripts/Editor/AmazonCoroutines.cs.meta index 0e52197..6b4cd3e 100644 --- a/Amazon/Scripts/Editor/AmazonCoroutines.cs.meta +++ b/Amazon/Scripts/Editor/AmazonCoroutines.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: dcee96832dc4141299f36d8b10b10467 +guid: 768de77ca8c7ccc47b233b0b09a42d9c MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Editor/AmazonDependencies.xml b/Amazon/Scripts/Editor/AmazonDependencies.xml index 979a6f6..d37d05f 100644 --- a/Amazon/Scripts/Editor/AmazonDependencies.xml +++ b/Amazon/Scripts/Editor/AmazonDependencies.xml @@ -1,16 +1,16 @@ - - - + + + https://aws.oss.sonatype.org/content/repositories/releases/ - - + + - \ No newline at end of file + diff --git a/Amazon/Scripts/Editor/AmazonDependencies.xml.meta b/Amazon/Scripts/Editor/AmazonDependencies.xml.meta index ad2f0f9..68aa041 100644 --- a/Amazon/Scripts/Editor/AmazonDependencies.xml.meta +++ b/Amazon/Scripts/Editor/AmazonDependencies.xml.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c9bc3db2384e74f03ae6d3b496e9fdc9 +guid: 54e062f8003d00e469680f856f94a517 TextScriptImporter: externalObjects: {} userData: diff --git a/Amazon/Scripts/Editor/AmazonPostBuildiOS.cs b/Amazon/Scripts/Editor/AmazonPostBuildiOS.cs index be5be2b..c920c2d 100644 --- a/Amazon/Scripts/Editor/AmazonPostBuildiOS.cs +++ b/Amazon/Scripts/Editor/AmazonPostBuildiOS.cs @@ -6,49 +6,25 @@ using UnityEditor.iOS.Xcode; using UnityEngine; namespace AmazonInternal.Editor.Postbuild { public static class AmazonPostBuildiOS { - [PostProcessBuild( 45 )] - public static void OnPostprocessBuild(BuildTarget buildTarget, string path) - { + [PostProcessBuildAttribute(1)] + public static void OnPostprocessBuild(BuildTarget buildTarget, string path) { if (buildTarget != BuildTarget.iOS) return; - - string pbxProjectPath = PBXProject.GetPBXProjectPath(path); - PBXProject project = new PBXProject(); - - project.ReadFromFile(pbxProjectPath); - -#if UNITY_2019_3_OR_NEWER - string targetGuid = project.GetUnityFrameworkTargetGuid(); -#else - string targetGuid = project.TargetGuidByName(PBXProject.GetUnityTargetName()); -#endif - project.SetBuildProperty(targetGuid, "LD_RUNPATH_SEARCH_PATHS", "$(inherited)"); - project.SetBuildProperty(targetGuid, "CLANG_ENABLE_MODULES", "YES"); - project.AddBuildProperty(targetGuid, "LD_RUNPATH_SEARCH_PATHS", "@executable_path/Frameworks"); - project.WriteToFile(pbxProjectPath); + string projPath = path + "/Unity-iPhone.xcodeproj/project.pbxproj"; + string pbxProjectPath = PBXProject.GetPBXProjectPath(path); + PBXProject pbxProject = new PBXProject(); -#if UNITY_2019_3_OR_NEWER - if (buildTarget == BuildTarget.iOS) - { - bool iPhoneExist = false; - using (StreamReader sr = new StreamReader(path + "/Podfile")) - { - string contents = sr.ReadToEnd(); - if (contents.Contains("Unity-iPhone")) - { - iPhoneExist = true; - } - } - if ( !iPhoneExist ){ - using (StreamWriter sw = File.AppendText(path + "/Podfile")) - { - sw.WriteLine("\ntarget 'Unity-iPhone' do\nend"); - } - } - } -#endif - } + pbxProject.ReadFromFile(pbxProjectPath); + + string[] targetGuids = new string[2] { + pbxProject.GetUnityMainTargetGuid(), + pbxProject.GetUnityFrameworkTargetGuid() + }; + pbxProject.SetBuildProperty(targetGuids, "ENABLE_BITCODE", "NO"); + + pbxProject.WriteToFile(pbxProjectPath); + } } } #endif \ No newline at end of file diff --git a/Amazon/Scripts/Editor/AmazonPostBuildiOS.cs.meta b/Amazon/Scripts/Editor/AmazonPostBuildiOS.cs.meta index 52e2e0e..d96c2f0 100644 --- a/Amazon/Scripts/Editor/AmazonPostBuildiOS.cs.meta +++ b/Amazon/Scripts/Editor/AmazonPostBuildiOS.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: f7474cff9dfc144e89f4e7696b4b8d9c +guid: ddd7aae4d9bd0644485bb967a9d9d838 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Editor/AmazonSDKManager.cs b/Amazon/Scripts/Editor/AmazonSDKManager.cs index 2de5da2..6cbf3bf 100644 --- a/Amazon/Scripts/Editor/AmazonSDKManager.cs +++ b/Amazon/Scripts/Editor/AmazonSDKManager.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Generic; using System.IO; @@ -31,17 +31,17 @@ public class AmazonSDKManager : EditorWindow { } } -// [MenuItem ("Amazon/About Amazon SDK", false, 0)] + [MenuItem ("Amazon/About Amazon SDK", false, 0)] public static void About () { AmazonAboutDialog.ShowDialog (); } -// [MenuItem ("Amazon/Documentation...", false, 1)] + [MenuItem ("Amazon/Documentation...", false, 1)] public static void Documentation () { Application.OpenURL (AmazonConstants.docUrl); } -// [MenuItem ("Amazon/Manage SDKs...", false, 4)] + [MenuItem ("Amazon/Manage SDKs...", false, 4)] public static void SdkManagerProd () { AmazonSDKManager.ShowSDKManager (); } @@ -397,4 +397,4 @@ public class AmazonSDKManager : EditorWindow { downloader = null; coroutine = null; } -} +} \ No newline at end of file diff --git a/Amazon/Scripts/Editor/AmazonSDKManager.cs.meta b/Amazon/Scripts/Editor/AmazonSDKManager.cs.meta index ad401dd..78b1b8e 100644 --- a/Amazon/Scripts/Editor/AmazonSDKManager.cs.meta +++ b/Amazon/Scripts/Editor/AmazonSDKManager.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 9436cb85e61464fbb8e7434090ec1af2 +guid: 970ae7f36073f3f4fb04767c1223a840 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Editor/Tests.meta b/Amazon/Scripts/Editor/Tests.meta index 86157cb..889342c 100644 --- a/Amazon/Scripts/Editor/Tests.meta +++ b/Amazon/Scripts/Editor/Tests.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: e64d0b097e7e04e59b22cd2d61ff42a5 +guid: d58a19dba1752614fb20bbe8420899e5 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Amazon/Scripts/Editor/Tests/AmazonSDKTests.cs.meta b/Amazon/Scripts/Editor/Tests/AmazonSDKTests.cs.meta index 88df821..f480b21 100644 --- a/Amazon/Scripts/Editor/Tests/AmazonSDKTests.cs.meta +++ b/Amazon/Scripts/Editor/Tests/AmazonSDKTests.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 8b00fb31f302f4b26a43151fd12cffbc +guid: ebb19576a0bf36a4faa016a9fb7a88ee MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Editor/Tests/AmazonTest.cs.meta b/Amazon/Scripts/Editor/Tests/AmazonTest.cs.meta index 372fa7c..74bb6e7 100644 --- a/Amazon/Scripts/Editor/Tests/AmazonTest.cs.meta +++ b/Amazon/Scripts/Editor/Tests/AmazonTest.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: fe3a64de565fa4daa9ac26c80cdb1f6e +guid: c6db4e2f03cecbf4c83eb7416ebbd623 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Editor/Tests/AmazonUtilsTests.cs.meta b/Amazon/Scripts/Editor/Tests/AmazonUtilsTests.cs.meta index de0683f..95ceb6d 100644 --- a/Amazon/Scripts/Editor/Tests/AmazonUtilsTests.cs.meta +++ b/Amazon/Scripts/Editor/Tests/AmazonUtilsTests.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: e4a38f41a15b0444380ccd4a74a12ac2 +guid: 84c1ddf10f083ef4ab7614bd9a8edd62 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal.meta b/Amazon/Scripts/Internal.meta index 105edc6..04868f4 100644 --- a/Amazon/Scripts/Internal.meta +++ b/Amazon/Scripts/Internal.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 3eac84282b79049f0bbadc32296d7b29 +guid: 2dba0aed518058e42959ba3e629b0bb6 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Amazon/Scripts/Internal/APSAdDelegate.cs.meta b/Amazon/Scripts/Internal/APSAdDelegate.cs.meta index e2c3bdb..e72c3ff 100644 --- a/Amazon/Scripts/Internal/APSAdDelegate.cs.meta +++ b/Amazon/Scripts/Internal/APSAdDelegate.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d06f90422ce794d848656240f4d00aae +guid: 6d2b55178eeb0496e9d81c6a3ddb8d3d MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/APSAdRequestExtra.cs b/Amazon/Scripts/Internal/APSAdRequestExtra.cs new file mode 100644 index 0000000..7ece90a --- /dev/null +++ b/Amazon/Scripts/Internal/APSAdRequestExtra.cs @@ -0,0 +1,145 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace AmazonAds +{ + public class APSAdRequestExtra + { + private static readonly string ADMOB_SLOTUUID_KEY = "amazon_custom_event_slot_uuid"; + private static readonly string ADMOB_REQUEST_ID_KEY = "amazon_custom_event_request_id"; + private static readonly string APS_ADAPTER_VERSION = "amazon_custom_event_adapter_version"; + private static readonly string ADMOB_ISVIDEO_KEY = "amazon_custom_event_is_video"; + private static readonly string ADMOB_WIDTH_KEY = "amazon_custom_event_width"; + private static readonly string ADMOB_HEIGHT_KEY = "amazon_custom_event_height"; + private static readonly string APS_ADMOB_CONST_CCPA_APS_PRIVACY = "aps_privacy"; + private static readonly string APS_ADMOB_CONST_CCPA_US_PRIVACY = "us_privacy"; + private static readonly AndroidJavaClass dtbAdUtil = new AndroidJavaClass ("com.amazon.device.ads.DTBAdUtil"); + + private APSAdRequestExtra (Builder builder) { + this.SlotUUID = builder.SlotUUID; + this.BannerAdHeight = builder.AdHeight; + this.BannerAdWidth = builder.AdWidth; + this.CCPAPrivacy = builder.CCPAPrivacy; + } + + public string SlotUUID { get; private set; } + public int BannerAdHeight { get; private set; } + public int BannerAdWidth { get; private set; } + public Dictionary CCPAPrivacy { private get; set; } + + public Dictionary GetAdMobInterstitialRequestExtras () + { + Dictionary AdMobRequestExtras = createExtras (); + if (SlotUUID == null) + { + return AdMobRequestExtras; + } + +#if UNITY_ANDROID + AndroidJavaObject bundle = dtbAdUtil.CallStatic("createAdMobInterstitialVideoRequestBundle", SlotUUID); + AdMobRequestExtras.Add (ADMOB_SLOTUUID_KEY, bundle.Call("getString", ADMOB_SLOTUUID_KEY)); + AdMobRequestExtras.Add (ADMOB_REQUEST_ID_KEY, bundle.Call("getString", ADMOB_REQUEST_ID_KEY)); + AdMobRequestExtras.Add (APS_ADAPTER_VERSION, bundle.Call("getString", APS_ADAPTER_VERSION)); +#else + AdMobRequestExtras.Add (ADMOB_SLOTUUID_KEY, SlotUUID); +#endif + return AdMobRequestExtras; + + } + + public Dictionary GetAdMobBannerRequestExtras () + { + Dictionary AdMobRequestExtras = createExtras(); + if (SlotUUID == null || BannerAdWidth == 0 || BannerAdHeight == 0) + { + return AdMobRequestExtras; + } + +#if UNITY_ANDROID + AndroidJavaObject bundle = dtbAdUtil.CallStatic ("createAdMobBannerRequestBundle", SlotUUID, BannerAdWidth, BannerAdHeight); + AdMobRequestExtras.Add (ADMOB_SLOTUUID_KEY, bundle.Call("getString", ADMOB_SLOTUUID_KEY)); + AdMobRequestExtras.Add (ADMOB_HEIGHT_KEY, bundle.Call("getInt", ADMOB_HEIGHT_KEY).ToString()); + AdMobRequestExtras.Add (ADMOB_WIDTH_KEY, bundle.Call("getInt", ADMOB_WIDTH_KEY).ToString()); + AdMobRequestExtras.Add (ADMOB_REQUEST_ID_KEY, bundle.Call("getString", ADMOB_REQUEST_ID_KEY)); + AdMobRequestExtras.Add (APS_ADAPTER_VERSION, bundle.Call("getString", APS_ADAPTER_VERSION)); +#else + + AdMobRequestExtras.Add (ADMOB_SLOTUUID_KEY, SlotUUID); + AdMobRequestExtras.Add (ADMOB_WIDTH_KEY, BannerAdWidth.ToString()); + AdMobRequestExtras.Add (ADMOB_HEIGHT_KEY, BannerAdHeight.ToString()); + +#endif + + return AdMobRequestExtras; + } + + private Dictionary createExtras() + { + Dictionary extrasMap = new Dictionary(); + if (CCPAPrivacy != null) + { + if (CCPAPrivacy.TryGetValue (APS_ADMOB_CONST_CCPA_APS_PRIVACY, out string ccpa_aps_privacy)) + { + extrasMap.Add (APS_ADMOB_CONST_CCPA_APS_PRIVACY, ccpa_aps_privacy); + } + if (CCPAPrivacy.TryGetValue (APS_ADMOB_CONST_CCPA_US_PRIVACY, out string ccpa_us_privacy)) + { + extrasMap.Add (APS_ADMOB_CONST_CCPA_US_PRIVACY, ccpa_us_privacy); + } + + } + return extrasMap; + + } + + + public class Builder + { + public Builder() + { + this.SlotUUID = null; + this.AdHeight = 0; + this.AdWidth = 0; + this.CCPAPrivacy = new Dictionary(); + } + + internal string SlotUUID { get; private set; } + internal int AdHeight { get; private set; } + internal int AdWidth { get; private set; } + internal Dictionary CCPAPrivacy { get; private set; } + + public Builder AddSlotUUID(string SlotUUID) + { + this.SlotUUID = SlotUUID; + return this; + } + + public Builder AddHeight(int AdHeight) + { + this.AdHeight = AdHeight; + return this; + } + + public Builder AddWidth(int AdWidth) + { + this.AdWidth = AdWidth; + return this; + } + + public Builder AddCCPAPrivacy(Dictionary CCPAPrivacy) + { + this.CCPAPrivacy = CCPAPrivacy; + return this; + } + + public APSAdRequestExtra Build() + { + return new APSAdRequestExtra(this); + } + } + } + +} + + diff --git a/Amazon/Scripts/Internal/IOS/IOSAdResponce.cs.meta b/Amazon/Scripts/Internal/APSAdRequestExtra.cs.meta similarity index 83% rename from Amazon/Scripts/Internal/IOS/IOSAdResponce.cs.meta rename to Amazon/Scripts/Internal/APSAdRequestExtra.cs.meta index 99f191e..2fe393f 100644 --- a/Amazon/Scripts/Internal/IOS/IOSAdResponce.cs.meta +++ b/Amazon/Scripts/Internal/APSAdRequestExtra.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 9111bf37862934342b4a39f926faa2b7 +guid: 75f392fb260fb45329f6b11ae4a21e9b MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/APSBannerAdRequest.cs b/Amazon/Scripts/Internal/APSBannerAdRequest.cs index 2499c4c..ab645c4 100644 --- a/Amazon/Scripts/Internal/APSBannerAdRequest.cs +++ b/Amazon/Scripts/Internal/APSBannerAdRequest.cs @@ -1,23 +1,22 @@ -namespace AmazonAds { +using System; +using UnityEngine; + +namespace AmazonAds { public class APSBannerAdRequest : AdRequest { - public APSBannerAdRequest () : base() { - Amazon.OnApplicationPause += OnApplicationPause; + public APSBannerAdRequest () : base() { } public APSBannerAdRequest (string slotGroupName) : base() { - Amazon.OnApplicationPause += OnApplicationPause; client.SetSlotGroup (slotGroupName); } public APSBannerAdRequest (int width, int height, string uid) : base() { - Amazon.OnApplicationPause += OnApplicationPause; AdSize size = new AdSize (width, height, uid); client.SetSizes (size.GetInstance ()); } public APSBannerAdRequest (AdSize size) { - Amazon.OnApplicationPause += OnApplicationPause; client.SetSizes (size.GetInstance ()); } @@ -42,47 +41,47 @@ client.SetSlotGroup (slotGroupName); } + [Obsolete("This API has been deprecated", false)] public void SetAutoRefreshAdMob (bool flag, bool isSmartBanner = false) { - client.SetAutoRefreshAdMob (flag, isSmartBanner); + Debug.LogError("This API has been deprecated"); } + [Obsolete("This API has been deprecated", false)] public void SetAutoRefreshMoPub (bool flag, int refreshTime) { - client.SetAutoRefreshMoPub (flag, refreshTime); + Debug.LogError("This API has been deprecated"); } + [Obsolete("This API has been deprecated", false)] public void DisposeAd () { - client.DisposeAd (); + Debug.LogError("This API has been deprecated"); } + [Obsolete("This API has been deprecated", false)] public void IsAutoRefreshAdMob () { - client.IsAutoRefreshAdMob (); + Debug.LogError("This API has been deprecated"); } + [Obsolete("This API has been deprecated", false)] public void IsAutoRefreshMoPub () { - client.IsAutoRefreshMoPub (); + Debug.LogError("This API has been deprecated"); } public string AutoRefreshID () { return client.AutoRefreshID (); } + [Obsolete("This API has been deprecated", false)] public void CreateFetchManager (bool isSmartBanner = false) { - client.CreateFetchManager (isSmartBanner); + Debug.LogError("This API has been deprecated"); } + [Obsolete("This API has been deprecated", false)] public void DestroyFetchManager () { - client.DestroyFetchManager (); + Debug.LogError("The API has been deprecated"); } + [Obsolete("This API has been deprecated", false)] public void OnApplicationPause (bool isPaused) { - if (isPaused) { - if( client.IsAutoRefreshAdMob() ){ - client.StopFetchManager(); - } - } else { - if( client.IsAutoRefreshAdMob() ){ - client.StartFetchManager(); - } - } + Debug.LogError("This API has been deprecated"); } } } \ No newline at end of file diff --git a/Amazon/Scripts/Internal/APSBannerAdRequest.cs.meta b/Amazon/Scripts/Internal/APSBannerAdRequest.cs.meta index a0d7ff0..722fa2d 100644 --- a/Amazon/Scripts/Internal/APSBannerAdRequest.cs.meta +++ b/Amazon/Scripts/Internal/APSBannerAdRequest.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 62abdd252c1aa49beb917ca0a7b4d3b3 +guid: 93f096fe94c739c42bd555fff7f57571 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/APSInterstitialAdRequest.cs.meta b/Amazon/Scripts/Internal/APSInterstitialAdRequest.cs.meta index 95fc792..3a7d8e6 100644 --- a/Amazon/Scripts/Internal/APSInterstitialAdRequest.cs.meta +++ b/Amazon/Scripts/Internal/APSInterstitialAdRequest.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: a60589c70736841a6b26fa39087d8e98 +guid: 5e132029d7bab2d4684faf398279497b MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/APSMediationUtils.cs b/Amazon/Scripts/Internal/APSMediationUtils.cs index 4ef747a..4151994 100644 --- a/Amazon/Scripts/Internal/APSMediationUtils.cs +++ b/Amazon/Scripts/Internal/APSMediationUtils.cs @@ -5,33 +5,99 @@ namespace AmazonAds { public class APSMediationUtils { public static string APS_IRON_SOURCE_NETWORK_KEY = "APS"; + private static string APS_REWARDED_VIDEO_KEY = "rewardedvideo"; + private static string APS_INTERSTITIAL_KEY = "interstitial"; - public static string GetInterstitialNetworkData(string amazonSlotId, string bidInfo, string pricePoint) + public static string GetInterstitialNetworkData(string amazonSlotId, AmazonAds.AdResponse adResponse) { - APSIronSourceNetworkBaseInputData ironSourceInputData = new APSIronSourceNetworkBaseInputData(); - ironSourceInputData.bidInfo = bidInfo; - ironSourceInputData.pricePointEncoded = pricePoint; - ironSourceInputData.uuid = amazonSlotId; + return GetNetworkData(amazonSlotId, adResponse, APS_INTERSTITIAL_KEY); - APSIronSourceInterstitialNetworkData networkData = new APSIronSourceInterstitialNetworkData(); - networkData.interstitial = ironSourceInputData; - - string jsonData = "{ \"interstitial\" :" + JsonUtility.ToJson(ironSourceInputData) + "}"; - return jsonData; - - //return JsonUtility.ToJson(networkData); } - public class APSIronSourceNetworkBaseInputData + public static string GetRewardedNetworkData(string amazonSlotId, AmazonAds.AdResponse adResponse) { + return GetNetworkData(amazonSlotId, adResponse, APS_REWARDED_VIDEO_KEY); + } + + private static string GetNetworkData(string amazonSlotId, AmazonAds.AdResponse adResponse , string adInventoryType) + { + APSIronSourceNetworkInputData ironSourceInputData = new APSIronSourceNetworkInputData(); +#if UNITY_ANDROID + ironSourceInputData.bidInfo = adResponse.GetBidInfo(); + +#endif + ironSourceInputData.pricePointEncoded = adResponse.GetPricePoint(); + ironSourceInputData.uuid = amazonSlotId; + APSIronSourceNetworkData networkData = new APSIronSourceNetworkData(); + networkData.networkInputData = ironSourceInputData; + +#if UNITY_IOS + string mediationHints = "\"mediationHints\" :" + adResponse.GetMediationHints(); + string jsonData = "{\""+adInventoryType+"\" :" + JsonUtility.ToJson(ironSourceInputData); + jsonData = jsonData.Remove(jsonData.Length - 1); + jsonData = jsonData + ", " + mediationHints + "}}"; +#else + string jsonData = "{\""+adInventoryType+"\" :" + JsonUtility.ToJson(ironSourceInputData) + "}"; +#endif + return jsonData; + } + + + public static string GetBannerNetworkData(string amazonSlotId, AmazonAds.AdResponse adResponse) + { + APSIronSourceNetworkBannerInputData ironSourceInputData = new APSIronSourceNetworkBannerInputData(); +#if UNITY_ANDROID + ironSourceInputData.bidInfo = adResponse.GetBidInfo(); +#endif + ironSourceInputData.pricePointEncoded = adResponse.GetPricePoint(); + ironSourceInputData.uuid = amazonSlotId; + ironSourceInputData.width = adResponse.GetWidth(); + ironSourceInputData.height = adResponse.GetHeight(); + + APSIronSourceBannerNetworkData networkData = new APSIronSourceBannerNetworkData(); + networkData.banner = ironSourceInputData; + +#if UNITY_IOS + string mediationHints = "\"mediationHints\" :" + adResponse.GetMediationHints(); + string jsonData = "{ \"banner\" :" + JsonUtility.ToJson(ironSourceInputData); + jsonData = jsonData.Remove(jsonData.Length - 1); + jsonData = jsonData + ", " + mediationHints + "}}"; +#else + string jsonData = "{ \"banner\" :" + JsonUtility.ToJson(ironSourceInputData) + "}"; +#endif + return jsonData; + } + + public class APSIronSourceNetworkInputData + { + public string uuid; + public string pricePointEncoded; +#if UNITY_ANDROID public string bidInfo; + +#endif + } + + public class APSIronSourceNetworkBannerInputData + { +#if UNITY_ANDROID + public string bidInfo; + +#endif public string pricePointEncoded; public string uuid; + public int width; + public int height; } - public class APSIronSourceInterstitialNetworkData + public class APSIronSourceBannerNetworkData { - public APSIronSourceNetworkBaseInputData interstitial; + public APSIronSourceNetworkBannerInputData banner; + } + + public class APSIronSourceNetworkData + { + public APSIronSourceNetworkInputData networkInputData; } private APSMediationUtils() diff --git a/Amazon/Scripts/Internal/APSMediationUtils.cs.meta b/Amazon/Scripts/Internal/APSMediationUtils.cs.meta index e90afa5..a343531 100644 --- a/Amazon/Scripts/Internal/APSMediationUtils.cs.meta +++ b/Amazon/Scripts/Internal/APSMediationUtils.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: a9a84a300e9084005845d7561b5941de +guid: 6462f49a627cd4380aecc9aff2a008ae MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/APSVideoAdRequest.cs.meta b/Amazon/Scripts/Internal/APSVideoAdRequest.cs.meta index 6891e4f..a117066 100644 --- a/Amazon/Scripts/Internal/APSVideoAdRequest.cs.meta +++ b/Amazon/Scripts/Internal/APSVideoAdRequest.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: f887445d62a094bdcaeba6843c76de52 +guid: 0116cf1c62b814514ac6cca1ac619af8 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/AdError.cs.meta b/Amazon/Scripts/Internal/AdError.cs.meta index 870b541..7c2dc64 100644 --- a/Amazon/Scripts/Internal/AdError.cs.meta +++ b/Amazon/Scripts/Internal/AdError.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 56cbe6c6e32004910b2c76cefbf4e0c6 +guid: 3215ade8b363a427891857ff10c3981f MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/AdInterstitial.cs.meta b/Amazon/Scripts/Internal/AdInterstitial.cs.meta index de5b71b..1d416ef 100644 --- a/Amazon/Scripts/Internal/AdInterstitial.cs.meta +++ b/Amazon/Scripts/Internal/AdInterstitial.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b6b4a1dc9a6eb4aac89ddfeb50a829a5 +guid: a03e9d205385f4937b8627db76ac71a4 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/AdNetworkInfo.cs b/Amazon/Scripts/Internal/AdNetworkInfo.cs index 574f126..d2bf3fe 100644 --- a/Amazon/Scripts/Internal/AdNetworkInfo.cs +++ b/Amazon/Scripts/Internal/AdNetworkInfo.cs @@ -3,7 +3,6 @@ using System; namespace AmazonAds { public enum DTBAdNetwork { GOOGLE_AD_MANAGER, - MOPUB_AD_SERVER, ADMOB, AD_GENERATION, IRON_SOURCE, diff --git a/Amazon/Scripts/Internal/AdNetworkInfo.cs.meta b/Amazon/Scripts/Internal/AdNetworkInfo.cs.meta index 95b41e8..66c4c26 100644 --- a/Amazon/Scripts/Internal/AdNetworkInfo.cs.meta +++ b/Amazon/Scripts/Internal/AdNetworkInfo.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 86929efe844004ce4a245fed201d6f9b +guid: 06e9bcca68bcd4c268eaf4d0dbd27002 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/AdRequest.cs b/Amazon/Scripts/Internal/AdRequest.cs index 3e340a1..14e6153 100644 --- a/Amazon/Scripts/Internal/AdRequest.cs +++ b/Amazon/Scripts/Internal/AdRequest.cs @@ -16,6 +16,12 @@ namespace AmazonAds { #endif } + public void Dispose() { + #if UNITY_ANDROID + client.Dispose(); + #endif + } + public AdRequest (IAdRequest adRequest) { client = adRequest; } diff --git a/Amazon/Scripts/Internal/AdRequest.cs.meta b/Amazon/Scripts/Internal/AdRequest.cs.meta index 9dd12d2..3f52327 100644 --- a/Amazon/Scripts/Internal/AdRequest.cs.meta +++ b/Amazon/Scripts/Internal/AdRequest.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 470ce0a8c403f4531ac94b5ebe2ea5f4 +guid: b9e5b4e4e1cabfc4c85b094dd97956b5 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/AdResponce.cs b/Amazon/Scripts/Internal/AdResponce.cs deleted file mode 100644 index c02e32c..0000000 --- a/Amazon/Scripts/Internal/AdResponce.cs +++ /dev/null @@ -1,4 +0,0 @@ -namespace AmazonAds { - public abstract class AdResponseObsolete { - } -} diff --git a/Amazon/Scripts/Internal/AdResponce.cs.meta b/Amazon/Scripts/Internal/AdResponce.cs.meta deleted file mode 100644 index 928912a..0000000 --- a/Amazon/Scripts/Internal/AdResponce.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 07d84938416874bbb97e941098b24279 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Amazon/Scripts/Internal/AdResponse.cs.meta b/Amazon/Scripts/Internal/AdResponse.cs.meta index 8003906..49d5fca 100644 --- a/Amazon/Scripts/Internal/AdResponse.cs.meta +++ b/Amazon/Scripts/Internal/AdResponse.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 80115d4cd111a4902804a0557a637367 +guid: ddb5dd3e28b574a74b676b9a456bdb41 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/AdSize.cs.meta b/Amazon/Scripts/Internal/AdSize.cs.meta index 3ac671a..30f546a 100644 --- a/Amazon/Scripts/Internal/AdSize.cs.meta +++ b/Amazon/Scripts/Internal/AdSize.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 6669e9284e4b5497fb351ae7bcb28436 +guid: 3fe91a7e44a1a364e8bfaa45f0af5a48 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/AdView.cs b/Amazon/Scripts/Internal/AdView.cs index fbf3c39..6421ce5 100644 --- a/Amazon/Scripts/Internal/AdView.cs +++ b/Amazon/Scripts/Internal/AdView.cs @@ -15,6 +15,12 @@ namespace AmazonAds { #endif } + public void Dispose() { + #if UNITY_ANDROID + adView.Dispose(); + #endif + } + public void fetchAd (AdResponse adResponse) { adView.FetchAd(adResponse); } diff --git a/Amazon/Scripts/Internal/AdView.cs.meta b/Amazon/Scripts/Internal/AdView.cs.meta index 575a4d3..ec7044f 100644 --- a/Amazon/Scripts/Internal/AdView.cs.meta +++ b/Amazon/Scripts/Internal/AdView.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ae0729fd51c4548638665a625582c64e +guid: 3c1cdb4ad102d47eab59e8df1f917c4d MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/AmazonPackageConfig.cs.meta b/Amazon/Scripts/Internal/AmazonPackageConfig.cs.meta index 29bd54c..0ffff8e 100644 --- a/Amazon/Scripts/Internal/AmazonPackageConfig.cs.meta +++ b/Amazon/Scripts/Internal/AmazonPackageConfig.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c289908250a174f72824418c6968e5f6 +guid: 732f6afbd1c571441bdc86f6f48e847e MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/AmazonUtils.cs.meta b/Amazon/Scripts/Internal/AmazonUtils.cs.meta index 2d7d7c4..8096851 100644 --- a/Amazon/Scripts/Internal/AmazonUtils.cs.meta +++ b/Amazon/Scripts/Internal/AmazonUtils.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 8472e80d0d208414880cdcf4c8b6889f +guid: dd98afcb8352e134ab09ab54c5c8b844 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/Android.meta b/Amazon/Scripts/Internal/Android.meta index eafc62e..6c6459f 100644 --- a/Amazon/Scripts/Internal/Android.meta +++ b/Amazon/Scripts/Internal/Android.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 7b3522bb34b494fbfac3a4d58f6de400 +guid: 56389f93bf97fcd4e97d5360316491c1 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Amazon/Scripts/Internal/Android/AdRegistration.cs b/Amazon/Scripts/Internal/Android/AdRegistration.cs index 1f65d82..b1c4de7 100644 --- a/Amazon/Scripts/Internal/Android/AdRegistration.cs +++ b/Amazon/Scripts/Internal/Android/AdRegistration.cs @@ -83,7 +83,7 @@ namespace AmazonAds.Android { } public bool IsLocationEnabled () { - return adRegistration.CallStatic ("іsLocationEnabled"); + return adRegistration.CallStatic ("isLocationEnabled"); } public String GetVersion () { diff --git a/Amazon/Scripts/Internal/Android/AdRegistration.cs.meta b/Amazon/Scripts/Internal/Android/AdRegistration.cs.meta index 0dd61fd..7953f22 100644 --- a/Amazon/Scripts/Internal/Android/AdRegistration.cs.meta +++ b/Amazon/Scripts/Internal/Android/AdRegistration.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 211753c343932487aaf8fa3e3f23a237 +guid: b8e246fc101d65e4e8ee19eb598fcbf8 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/Android/AndroidAdInterstitial.cs b/Amazon/Scripts/Internal/Android/AndroidAdInterstitial.cs index 8939514..869256c 100644 --- a/Amazon/Scripts/Internal/Android/AndroidAdInterstitial.cs +++ b/Amazon/Scripts/Internal/Android/AndroidAdInterstitial.cs @@ -8,15 +8,24 @@ namespace AmazonAds.Android { private AndroidJavaObject dtbAdInterstitial = null; private static readonly AndroidJavaClass SDKUtilitiesClass = new AndroidJavaClass(AmazonConstants.sdkUtilitiesClass); + UnityEngine.AndroidJavaClass playerClass; + UnityEngine.AndroidJavaObject currentActivityObject; + public AndroidAdInterstitial (APSAdDelegate delegates) { - UnityEngine.AndroidJavaClass playerClass = new UnityEngine.AndroidJavaClass(AmazonConstants.unityPlayerClass); - UnityEngine.AndroidJavaObject currentActivityObject = playerClass.GetStatic ("currentActivity"); + playerClass = new UnityEngine.AndroidJavaClass(AmazonConstants.unityPlayerClass); + currentActivityObject = playerClass.GetStatic ("currentActivity"); DTBAdInterstitialListener adInterstitialListener = new DTBAdInterstitialListener(); adInterstitialListener.adDelegate = delegates; dtbAdInterstitial = new AndroidJavaObject(AmazonConstants.dtbAdInterstitialClass, currentActivityObject, adInterstitialListener); } + public void Dispose() { + playerClass.Dispose(); + currentActivityObject.Dispose(); + dtbAdInterstitial.Dispose(); + } + public override void FetchAd (AdResponse adResponse) { if (dtbAdInterstitial != null) { AndroidJavaObject response = adResponse.GetAndroidResponseObject(); diff --git a/Amazon/Scripts/Internal/Android/AndroidAdInterstitial.cs.meta b/Amazon/Scripts/Internal/Android/AndroidAdInterstitial.cs.meta index ae80685..c5a90b4 100644 --- a/Amazon/Scripts/Internal/Android/AndroidAdInterstitial.cs.meta +++ b/Amazon/Scripts/Internal/Android/AndroidAdInterstitial.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ec1e99cd2191f4570bda447b3e0b031b +guid: d75f31e61413f4531ad341980cb0056d MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/Android/AndroidAdResponce.cs b/Amazon/Scripts/Internal/Android/AndroidAdResponce.cs deleted file mode 100644 index ef1a130..0000000 --- a/Amazon/Scripts/Internal/Android/AndroidAdResponce.cs +++ /dev/null @@ -1,4 +0,0 @@ -namespace AmazonAds.Android { - public class AndroidAdResponceObsolete { - } -} diff --git a/Amazon/Scripts/Internal/Android/AndroidAdResponse.cs.meta b/Amazon/Scripts/Internal/Android/AndroidAdResponse.cs.meta index 911a717..ee517f1 100644 --- a/Amazon/Scripts/Internal/Android/AndroidAdResponse.cs.meta +++ b/Amazon/Scripts/Internal/Android/AndroidAdResponse.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ea64b8dd761b64dc48d3963f41d7c964 +guid: 225ce61c153884d2498752934b9e5e02 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/Android/AndroidAdView.cs b/Amazon/Scripts/Internal/Android/AndroidAdView.cs index d067f9b..859bb54 100644 --- a/Amazon/Scripts/Internal/Android/AndroidAdView.cs +++ b/Amazon/Scripts/Internal/Android/AndroidAdView.cs @@ -7,16 +7,24 @@ namespace AmazonAds.Android { public class AndroidAdView : IAdView { private AndroidJavaObject dtbAdView = null; private static readonly AndroidJavaClass SDKUtilitiesClass = new AndroidJavaClass(AmazonConstants.sdkUtilitiesClass); + UnityEngine.AndroidJavaClass playerClass; + UnityEngine.AndroidJavaObject currentActivityObject; public AndroidAdView (APSAdDelegate delegates) { - UnityEngine.AndroidJavaClass playerClass = new UnityEngine.AndroidJavaClass(AmazonConstants.unityPlayerClass); - UnityEngine.AndroidJavaObject currentActivityObject = playerClass.GetStatic ("currentActivity"); + playerClass = new UnityEngine.AndroidJavaClass(AmazonConstants.unityPlayerClass); + currentActivityObject = playerClass.GetStatic ("currentActivity"); DTBAdBannerListener adBannerListener = new DTBAdBannerListener(); adBannerListener.adDelegate = delegates; dtbAdView = new AndroidJavaObject(AmazonConstants.dtbAdViewClass, currentActivityObject, adBannerListener); } + public void Dispose() { + playerClass.Dispose(); + currentActivityObject.Dispose(); + dtbAdView.Dispose(); + } + public override void FetchAd (AdResponse adResponse) { if (dtbAdView != null) { AndroidJavaObject response = adResponse.GetAndroidResponseObject(); diff --git a/Amazon/Scripts/Internal/Android/AndroidAdView.cs.meta b/Amazon/Scripts/Internal/Android/AndroidAdView.cs.meta index 3beb77e..8790e51 100644 --- a/Amazon/Scripts/Internal/Android/AndroidAdView.cs.meta +++ b/Amazon/Scripts/Internal/Android/AndroidAdView.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d65a0f0dd42564508aa82269ce06336f +guid: 915f068be076545579598f0e166613b1 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/Android/AndroidPlatform.cs b/Amazon/Scripts/Internal/Android/AndroidPlatform.cs index 739b5ba..a6f3978 100644 --- a/Amazon/Scripts/Internal/Android/AndroidPlatform.cs +++ b/Amazon/Scripts/Internal/Android/AndroidPlatform.cs @@ -49,16 +49,19 @@ namespace AmazonAds.Android { adRegistration.EnableLogging (flag); } + [Obsolete("APS no longer supports this API. For GDPR, we support TCFv2 strings. Implementation instructions can be found on the APS Portal under Resources > Privacy", false)] public override void SetCMPFlavor(Amazon.CMPFlavor cFlavor) { adRegistration.SetCMPFlavor(cFlavor); } + [Obsolete("APS no longer supports this API. For GDPR, we support TCFv2 strings. Implementation instructions can be found on the APS Portal under Resources > Privacy", false)] public override void SetConsentStatus(Amazon.ConsentStatus consentStatus) { adRegistration.SetConsentStatus(consentStatus); } + [Obsolete("APS no longer supports this API. For GDPR, we support TCFv2 strings. Implementation instructions can be found on the APS Portal under Resources > Privacy", false)] public override void SetVendorList(List vendorList) { adRegistration.SetVendorList(vendorList); diff --git a/Amazon/Scripts/Internal/Android/AndroidPlatform.cs.meta b/Amazon/Scripts/Internal/Android/AndroidPlatform.cs.meta index cc1b0f0..c27a542 100644 --- a/Amazon/Scripts/Internal/Android/AndroidPlatform.cs.meta +++ b/Amazon/Scripts/Internal/Android/AndroidPlatform.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 5b2de7cfcde534331acecd109d027803 +guid: c21cb058ae626f248833fdab8d85aa44 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/Android/DTBAdBannerListener.cs.meta b/Amazon/Scripts/Internal/Android/DTBAdBannerListener.cs.meta index 81ce259..4844012 100644 --- a/Amazon/Scripts/Internal/Android/DTBAdBannerListener.cs.meta +++ b/Amazon/Scripts/Internal/Android/DTBAdBannerListener.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 38ecf85701e30431f9c29008f398e51b +guid: 96eb7e2874b874e7e9f4045bb0ea4db9 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/Android/DTBAdInterstitialListener.cs.meta b/Amazon/Scripts/Internal/Android/DTBAdInterstitialListener.cs.meta index 769558a..2377af5 100644 --- a/Amazon/Scripts/Internal/Android/DTBAdInterstitialListener.cs.meta +++ b/Amazon/Scripts/Internal/Android/DTBAdInterstitialListener.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: a7709955494bd4212a25ccc336841875 +guid: 453e75923c4e54a16b77e815a3df9e76 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/Android/DTBAdRequest.cs b/Amazon/Scripts/Internal/Android/DTBAdRequest.cs index d277728..6c7d9ec 100644 --- a/Amazon/Scripts/Internal/Android/DTBAdRequest.cs +++ b/Amazon/Scripts/Internal/Android/DTBAdRequest.cs @@ -9,12 +9,21 @@ namespace AmazonAds.Android { private IInterstitialAdSize _interstitialAdSize = null; private IVideo _videoAdSize = null; + UnityEngine.AndroidJavaClass playerClass; + UnityEngine.AndroidJavaObject currentActivityObject; + public DTBAdRequest () { - UnityEngine.AndroidJavaClass playerClass = new UnityEngine.AndroidJavaClass ("com.unity3d.player.UnityPlayer"); - UnityEngine.AndroidJavaObject currentActivityObject = playerClass.GetStatic ("currentActivity"); + playerClass = new UnityEngine.AndroidJavaClass ("com.unity3d.player.UnityPlayer"); + currentActivityObject = playerClass.GetStatic ("currentActivity"); dTBAdRequest = new AndroidJavaObject ("com.amazon.device.ads.DTBAdRequest", currentActivityObject); } + public void Dispose() { + playerClass.Dispose(); + currentActivityObject.Dispose(); + dTBAdRequest.Dispose(); + } + public DTBAdRequest (AndroidJavaObject dtbRequest) { dTBAdRequest = dtbRequest; } diff --git a/Amazon/Scripts/Internal/Android/DTBAdRequest.cs.meta b/Amazon/Scripts/Internal/Android/DTBAdRequest.cs.meta index de7d3db..159cfdd 100644 --- a/Amazon/Scripts/Internal/Android/DTBAdRequest.cs.meta +++ b/Amazon/Scripts/Internal/Android/DTBAdRequest.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 02bd534875030442a8c3a9f1bedc6967 +guid: e75f3eee6b627e647979f4f3680abc47 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/Android/DTBAdSize.cs b/Amazon/Scripts/Internal/Android/DTBAdSize.cs index 486711a..e5fd9ce 100644 --- a/Amazon/Scripts/Internal/Android/DTBAdSize.cs +++ b/Amazon/Scripts/Internal/Android/DTBAdSize.cs @@ -8,6 +8,7 @@ namespace AmazonAds.Android { public DTBAdSize (int width, int height, String slotUUID) { client = new AndroidJavaObject ("com.amazon.device.ads.DTBAdSize", width, height, slotUUID); } + public int GetWidth () { return client.Call ("getWidth"); } @@ -41,6 +42,10 @@ namespace AmazonAds.Android { client = new AndroidJavaObject ("com.amazon.device.ads.DTBAdSize$DTBVideo", playerWidth, playerHeight, slotUUID); } + public void Dispose() { + client.Dispose(); + } + public AndroidJavaObject GetInstance () { return client; } diff --git a/Amazon/Scripts/Internal/Android/DTBAdSize.cs.meta b/Amazon/Scripts/Internal/Android/DTBAdSize.cs.meta index 0137b71..e2faed6 100644 --- a/Amazon/Scripts/Internal/Android/DTBAdSize.cs.meta +++ b/Amazon/Scripts/Internal/Android/DTBAdSize.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 0707e98bd8f7c449fbaf05500bee828d +guid: 9bbbe93960b89b6438d564bfd823f31e MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/Android/DTBCallback.cs.meta b/Amazon/Scripts/Internal/Android/DTBCallback.cs.meta index e8c6ff2..5916fa8 100644 --- a/Amazon/Scripts/Internal/Android/DTBCallback.cs.meta +++ b/Amazon/Scripts/Internal/Android/DTBCallback.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 97d96cb6052c247b88fb71963517d15f +guid: f2cd9fa644ad3814086bbdb888b07e52 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/Android/DTBFetchFactory.cs.meta b/Amazon/Scripts/Internal/Android/DTBFetchFactory.cs.meta index 9aa0979..c9967df 100644 --- a/Amazon/Scripts/Internal/Android/DTBFetchFactory.cs.meta +++ b/Amazon/Scripts/Internal/Android/DTBFetchFactory.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d8f17e173b3b34003b573efeaef83dce +guid: 2da86b5f7de549f408cd7ab478b815bf MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/Android/DTBFetchManager.cs b/Amazon/Scripts/Internal/Android/DTBFetchManager.cs index 36bd868..f1bf5c7 100644 --- a/Amazon/Scripts/Internal/Android/DTBFetchManager.cs +++ b/Amazon/Scripts/Internal/Android/DTBFetchManager.cs @@ -11,6 +11,10 @@ namespace AmazonAds.Android { dTBFetchManager = client; } + public void Dispose() { + dTBFetchManager.Dispose(); + } + public void dispense () { AndroidJavaObject dTBAdResponse = dTBFetchManager.Call ("dispense"); } diff --git a/Amazon/Scripts/Internal/Android/DTBFetchManager.cs.meta b/Amazon/Scripts/Internal/Android/DTBFetchManager.cs.meta index 96b7c9b..5aed60d 100644 --- a/Amazon/Scripts/Internal/Android/DTBFetchManager.cs.meta +++ b/Amazon/Scripts/Internal/Android/DTBFetchManager.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 2bf648a3f472141fdbc550ad18e55ac1 +guid: 6228100cb30e98a469a061dc74986b1b MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/Android/DTBSlotGroup.cs.meta b/Amazon/Scripts/Internal/Android/DTBSlotGroup.cs.meta index a5a07cc..ead264c 100644 --- a/Amazon/Scripts/Internal/Android/DTBSlotGroup.cs.meta +++ b/Amazon/Scripts/Internal/Android/DTBSlotGroup.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: f997d4f0e62c14fcdb460c08b05ef913 +guid: bae541bcf584e3a429eb2478625aba9a MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/IOS.meta b/Amazon/Scripts/Internal/IOS.meta index eea68d4..321c01a 100644 --- a/Amazon/Scripts/Internal/IOS.meta +++ b/Amazon/Scripts/Internal/IOS.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: cf23c2530685c4a709003ad1faddfd1c +guid: 78340eb4238a9eb47b38ebebf20f97a1 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Amazon/Scripts/Internal/IOS/DTBAdBannerDispatcher.cs.meta b/Amazon/Scripts/Internal/IOS/DTBAdBannerDispatcher.cs.meta index 4768117..56fe4b7 100644 --- a/Amazon/Scripts/Internal/IOS/DTBAdBannerDispatcher.cs.meta +++ b/Amazon/Scripts/Internal/IOS/DTBAdBannerDispatcher.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 1b2d2d02538c84466afc24234497484c +guid: 1b160c1031c0c41c9940ad06e7e764d0 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/IOS/DTBAdInterstitialDispatcher.cs.meta b/Amazon/Scripts/Internal/IOS/DTBAdInterstitialDispatcher.cs.meta index 27cbc4c..08b050b 100644 --- a/Amazon/Scripts/Internal/IOS/DTBAdInterstitialDispatcher.cs.meta +++ b/Amazon/Scripts/Internal/IOS/DTBAdInterstitialDispatcher.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c027d873469c4440fbfdd1b55353f520 +guid: 4fecb6b1807da47d5bb9abfcc7cf0069 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/IOS/DTBAdRequest.cs b/Amazon/Scripts/Internal/IOS/DTBAdRequest.cs index cbd17a7..0faae00 100644 --- a/Amazon/Scripts/Internal/IOS/DTBAdRequest.cs +++ b/Amazon/Scripts/Internal/IOS/DTBAdRequest.cs @@ -105,13 +105,7 @@ namespace AmazonAds.IOS { } public override void SetAutoRefreshAdMob (bool flag, bool isSmartBanner = false) { - isAutoRefreshAdMob = flag; - if(flag){ - CreateFetchManager(isSmartBanner); - StartFetchManager(); - } else { - StopFetchManager(); - } + Debug.LogError("The API has been deprecated"); } public override void SetRefreshFlag (bool flag) { diff --git a/Amazon/Scripts/Internal/IOS/DTBAdRequest.cs.meta b/Amazon/Scripts/Internal/IOS/DTBAdRequest.cs.meta index 64cd525..0a2a0aa 100644 --- a/Amazon/Scripts/Internal/IOS/DTBAdRequest.cs.meta +++ b/Amazon/Scripts/Internal/IOS/DTBAdRequest.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 028c059572c3540cb8f18d6eb4f6c4be +guid: ebf50a9b3c931b648bc9277418a4dbc5 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/IOS/DTBAdSize.cs.meta b/Amazon/Scripts/Internal/IOS/DTBAdSize.cs.meta index 1a04a63..1f288cc 100644 --- a/Amazon/Scripts/Internal/IOS/DTBAdSize.cs.meta +++ b/Amazon/Scripts/Internal/IOS/DTBAdSize.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b34576138f1bd4ced980dee0fd2996b0 +guid: 67c47e784fa3fbc45ad25c4461a43688 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/IOS/DTBCallback.cs.meta b/Amazon/Scripts/Internal/IOS/DTBCallback.cs.meta index d8d784b..8236964 100644 --- a/Amazon/Scripts/Internal/IOS/DTBCallback.cs.meta +++ b/Amazon/Scripts/Internal/IOS/DTBCallback.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 53febdb10cdf24c24ab963454803ad53 +guid: 8b79a8d648aadcd4880893d68bbd1df4 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/IOS/DTBFetchManager.cs.meta b/Amazon/Scripts/Internal/IOS/DTBFetchManager.cs.meta index fc4f76f..9e7e97e 100644 --- a/Amazon/Scripts/Internal/IOS/DTBFetchManager.cs.meta +++ b/Amazon/Scripts/Internal/IOS/DTBFetchManager.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 7d527c1c887004853918e03dc2f5c5c8 +guid: e33ebaf4702974a869c73077eb9e667d MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/IOS/DTBSlotGroup.cs.meta b/Amazon/Scripts/Internal/IOS/DTBSlotGroup.cs.meta index 3ff304b..e9a569d 100644 --- a/Amazon/Scripts/Internal/IOS/DTBSlotGroup.cs.meta +++ b/Amazon/Scripts/Internal/IOS/DTBSlotGroup.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 734ab7005315a4ab1a6e683e7e864e28 +guid: a19e18b833a07e14699ced94129f1886 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/IOS/Externs.cs b/Amazon/Scripts/Internal/IOS/Externs.cs index f483b01..79f6ec6 100644 --- a/Amazon/Scripts/Internal/IOS/Externs.cs +++ b/Amazon/Scripts/Internal/IOS/Externs.cs @@ -47,7 +47,6 @@ namespace AmazonAds.IOS public static void _addSlotGroup(IntPtr group) {} public static string _fetchMediationHints(IntPtr resp, bool isSmartBanner) { return null; } public static string _fetchAmznSlots(IntPtr resp) { return null; } - public static string _fetchMoPubKeywords(IntPtr resp) { return null; } public static void _setCMPFlavor(int cFlavor) {} public static void _setConsentStatus(int consentStatus) {} public static IntPtr _createArray() { return IntPtr.Zero; } @@ -162,8 +161,6 @@ namespace AmazonAds.IOS [DllImport("__Internal")] public static extern int _fetchAdHeight(IntPtr resp); [DllImport("__Internal")] - public static extern string _fetchMoPubKeywords(IntPtr resp); - [DllImport("__Internal")] public static extern void _setCMPFlavor(int cFlavor); [DllImport("__Internal")] public static extern void _setConsentStatus(int consentStatus); diff --git a/Amazon/Scripts/Internal/IOS/Externs.cs.meta b/Amazon/Scripts/Internal/IOS/Externs.cs.meta index 3561351..943622b 100644 --- a/Amazon/Scripts/Internal/IOS/Externs.cs.meta +++ b/Amazon/Scripts/Internal/IOS/Externs.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 1708dd63a5c574f8db8866d86b2fb232 +guid: 7560a92bf670b4446a5eb8b200ab4ec5 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/IOS/IOSAdInterstitial.cs.meta b/Amazon/Scripts/Internal/IOS/IOSAdInterstitial.cs.meta index b117149..c089c1f 100644 --- a/Amazon/Scripts/Internal/IOS/IOSAdInterstitial.cs.meta +++ b/Amazon/Scripts/Internal/IOS/IOSAdInterstitial.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 0d4d502223b4a4092b39024b38722b89 +guid: 239d104edcd92469cbe77af18fd7649b MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/IOS/IOSAdResponce.cs b/Amazon/Scripts/Internal/IOS/IOSAdResponce.cs deleted file mode 100644 index 914704f..0000000 --- a/Amazon/Scripts/Internal/IOS/IOSAdResponce.cs +++ /dev/null @@ -1,4 +0,0 @@ -namespace AmazonAds.IOS { - public class IOSAdResponceObsolete { - } -} diff --git a/Amazon/Scripts/Internal/IOS/IOSAdResponse.cs b/Amazon/Scripts/Internal/IOS/IOSAdResponse.cs index d627c43..4602164 100644 --- a/Amazon/Scripts/Internal/IOS/IOSAdResponse.cs +++ b/Amazon/Scripts/Internal/IOS/IOSAdResponse.cs @@ -22,10 +22,6 @@ namespace AmazonAds.IOS { return Externs._fetchAdWidth(resp); } - public override string GetMoPubKeywords () { - return Externs._fetchMoPubKeywords(resp); - } - public override IntPtr GetIosResponseObject() { return resp; @@ -88,5 +84,10 @@ namespace AmazonAds.IOS { internal override void SetAdLoader(AdRequest adRequest) { adLoader = adRequest; } + + public override string GetMoPubKeywords() + { + throw new NotImplementedException(); + } } } \ No newline at end of file diff --git a/Amazon/Scripts/Internal/IOS/IOSAdResponse.cs.meta b/Amazon/Scripts/Internal/IOS/IOSAdResponse.cs.meta index f1d95d5..2167783 100644 --- a/Amazon/Scripts/Internal/IOS/IOSAdResponse.cs.meta +++ b/Amazon/Scripts/Internal/IOS/IOSAdResponse.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 9fdebaea51295482fb17caa1dfcb2fd9 +guid: 486f74d5ee3fc47c29510ae4417e3d8d MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/IOS/IOSAdView.cs.meta b/Amazon/Scripts/Internal/IOS/IOSAdView.cs.meta index 4bfb326..5dd5c8a 100644 --- a/Amazon/Scripts/Internal/IOS/IOSAdView.cs.meta +++ b/Amazon/Scripts/Internal/IOS/IOSAdView.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: a23b0b9ff70c443cbbb45c959a58503d +guid: ee954c4db1b07425a951092e9ea875cb MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/IOS/IOSPlatform.cs b/Amazon/Scripts/Internal/IOS/IOSPlatform.cs index 8618062..a409f99 100644 --- a/Amazon/Scripts/Internal/IOS/IOSPlatform.cs +++ b/Amazon/Scripts/Internal/IOS/IOSPlatform.cs @@ -52,6 +52,7 @@ namespace AmazonAds.IOS { Externs._addSlotGroup(ptr.GetInstance()); } + [Obsolete("This API has been deprecated", false)] public override void SetCMPFlavor(Amazon.CMPFlavor cFlavor) { int fla = 0; @@ -70,6 +71,7 @@ namespace AmazonAds.IOS { Externs._setCMPFlavor(fla); } + [Obsolete("APS no longer supports this API. For GDPR, we support TCFv2 strings. Implementation instructions can be found on the APS Portal under Resources > Privacy", false)] public override void SetConsentStatus(Amazon.ConsentStatus consentStatus) { int cons = 0; @@ -91,6 +93,7 @@ namespace AmazonAds.IOS { Externs._setConsentStatus(cons); } + [Obsolete("APS no longer supports this API. For GDPR, we support TCFv2 strings. Implementation instructions can be found on the APS Portal under Resources > Privacy", false)] public override void SetVendorList(List vendorList) { IntPtr dictionary = Externs._createArray(); diff --git a/Amazon/Scripts/Internal/IOS/IOSPlatform.cs.meta b/Amazon/Scripts/Internal/IOS/IOSPlatform.cs.meta index a907b99..0d0702f 100644 --- a/Amazon/Scripts/Internal/IOS/IOSPlatform.cs.meta +++ b/Amazon/Scripts/Internal/IOS/IOSPlatform.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ac416f8316ced40589eeba7b04efc627 +guid: 3d45dcbd0fb08ea41a11f185a93dc226 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/MiniJSON.cs.meta b/Amazon/Scripts/Internal/MiniJSON.cs.meta index ac9e379..83ea002 100644 --- a/Amazon/Scripts/Internal/MiniJSON.cs.meta +++ b/Amazon/Scripts/Internal/MiniJSON.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4b235ee00c3e948deaa8d5af245c9318 +guid: 2d0ac6c6632785e44981f12072090ff6 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/PlatformApi.cs.meta b/Amazon/Scripts/Internal/PlatformApi.cs.meta index d4ffe97..382ba55 100644 --- a/Amazon/Scripts/Internal/PlatformApi.cs.meta +++ b/Amazon/Scripts/Internal/PlatformApi.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: a7e4c885c2b514bab912a1d10b93b56b +guid: 51621a2cb798b7e4fb0c63ed614355f9 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Internal/SlotGroup.cs.meta b/Amazon/Scripts/Internal/SlotGroup.cs.meta index 46e9ed3..74c3e92 100644 --- a/Amazon/Scripts/Internal/SlotGroup.cs.meta +++ b/Amazon/Scripts/Internal/SlotGroup.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d0721cd33e88d476385237c2bf17af32 +guid: feb152fb7c07ff145a60fe9ccdb1f37c MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Mediations.meta b/Amazon/Scripts/Mediations.meta index 77042fe..cf3df09 100644 --- a/Amazon/Scripts/Mediations.meta +++ b/Amazon/Scripts/Mediations.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: dc21c213b3887496a9b450a63d014a4b +guid: f6db0da0788fa4dc2830d633ef211025 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Amazon/Scripts/Mediations/AppLovinMediation.meta b/Amazon/Scripts/Mediations/AppLovinMediation.meta index b2fab5b..cbcc8a7 100644 --- a/Amazon/Scripts/Mediations/AppLovinMediation.meta +++ b/Amazon/Scripts/Mediations/AppLovinMediation.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 39980aa183b504d8a8897519535976bf +guid: 5d030096ad5c54ed282a61ebbe5b630e folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Amazon/Scripts/Mediations/AppLovinMediation/Editor.meta b/Amazon/Scripts/Mediations/AppLovinMediation/Editor.meta index d8d55c5..73c8dd7 100644 --- a/Amazon/Scripts/Mediations/AppLovinMediation/Editor.meta +++ b/Amazon/Scripts/Mediations/AppLovinMediation/Editor.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: eb50eb92fd8e241589b99bc4635578a1 +guid: 036570c23900d4fce95f9d1c54cd6417 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Amazon/Scripts/Mediations/AppLovinMediation/Editor/APSAppLovinPackageConfig.cs b/Amazon/Scripts/Mediations/AppLovinMediation/Editor/APSAppLovinPackageConfig.cs index 3c90618..7684fd2 100644 --- a/Amazon/Scripts/Mediations/AppLovinMediation/Editor/APSAppLovinPackageConfig.cs +++ b/Amazon/Scripts/Mediations/AppLovinMediation/Editor/APSAppLovinPackageConfig.cs @@ -1,6 +1,6 @@ -public class APSAppLovinPackageConfig : AmazonPackageConfig +public class APSAppLovinPackageConfig : AmazonPackageConfig { - public const string VERSION = "1.4.3"; + public const string VERSION = "1.9.0"; public override string Name { diff --git a/Amazon/Scripts/Mediations/AppLovinMediation/Editor/APSAppLovinPackageConfig.cs.meta b/Amazon/Scripts/Mediations/AppLovinMediation/Editor/APSAppLovinPackageConfig.cs.meta index 5516962..ad93ce1 100644 --- a/Amazon/Scripts/Mediations/AppLovinMediation/Editor/APSAppLovinPackageConfig.cs.meta +++ b/Amazon/Scripts/Mediations/AppLovinMediation/Editor/APSAppLovinPackageConfig.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 605f6ed8576974f2c9a821be69531aba +guid: 9a9ea2466931546f28de79882e1a5cfd MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Amazon/Scripts/Mediations/AppLovinMediation/Editor/Dependencies.xml b/Amazon/Scripts/Mediations/AppLovinMediation/Editor/Dependencies.xml index 88914bc..b3156b5 100644 --- a/Amazon/Scripts/Mediations/AppLovinMediation/Editor/Dependencies.xml +++ b/Amazon/Scripts/Mediations/AppLovinMediation/Editor/Dependencies.xml @@ -1,9 +1,9 @@ - + - + diff --git a/Amazon/Scripts/Mediations/AppLovinMediation/Editor/Dependencies.xml.meta b/Amazon/Scripts/Mediations/AppLovinMediation/Editor/Dependencies.xml.meta index 0d908f4..57db849 100644 --- a/Amazon/Scripts/Mediations/AppLovinMediation/Editor/Dependencies.xml.meta +++ b/Amazon/Scripts/Mediations/AppLovinMediation/Editor/Dependencies.xml.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b7874141996c14ba4b9b32651bc21d2a +guid: ba572d3f9e0fb4d699d002b783516de6 labels: - al_max - al_max_export_path-MaxSdk/Mediation/AmazonAdMarketplace/Editor/Dependencies.xml diff --git a/Editor/CodeMods/AmazonMod.cs b/Editor/CodeMods/AmazonMod.cs index a9a7fe1..cbf5fb9 100644 --- a/Editor/CodeMods/AmazonMod.cs +++ b/Editor/CodeMods/AmazonMod.cs @@ -23,7 +23,7 @@ namespace Guru.Editor.Max #region 修复依赖 - [Test] + // [Test] public void FixDepsViaPackage() { string path = GetFullPath(TargetPath); diff --git a/Editor/PostProcess.meta b/Editor/PostProcess.meta new file mode 100644 index 0000000..4b40464 --- /dev/null +++ b/Editor/PostProcess.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 9707190b56774bf98ead95dd04616789 +timeCreated: 1718605024 \ No newline at end of file diff --git a/Moloco/Scripts/Editor/MolocoPostProcessBuildiOS.cs b/Editor/PostProcess/MolocoPostProcessBuildiOS.cs similarity index 90% rename from Moloco/Scripts/Editor/MolocoPostProcessBuildiOS.cs rename to Editor/PostProcess/MolocoPostProcessBuildiOS.cs index d2c0610..6e918ad 100644 --- a/Moloco/Scripts/Editor/MolocoPostProcessBuildiOS.cs +++ b/Editor/PostProcess/MolocoPostProcessBuildiOS.cs @@ -1,15 +1,15 @@ -#if UNITY_IOS || UNITY_IPHONE +#if UNITY_IOS|| UNITY_IPHONE -using System.Collections.Generic; -using System.IO; -using UnityEditor; -using UnityEditor.Callbacks; -using UnityEditor.iOS.Xcode; -using UnityEditor.iOS.Xcode.Extensions; - -namespace Moloco.IOS.Scripts.Editor +namespace Guru.Editor { - public class MolocoPostProcessBuildiOS + using System.Collections.Generic; + using System.IO; + using UnityEditor; + using UnityEditor.Callbacks; + using UnityEditor.iOS.Xcode; + using UnityEditor.iOS.Xcode.Extensions; + + public class MolocoPostProcessBuildiOS { #if !UNITY_2019_3_OR_NEWER private const string UnityMainTargetName = "Unity-iPhone"; @@ -67,7 +67,7 @@ namespace Moloco.IOS.Scripts.Editor #endif } - [PostProcessBuildAttribute(int.MaxValue)] + [PostProcessBuild(int.MaxValue)] public static void MolocoPostProcessPbxProject(BuildTarget buildTarget, string buildPath) { var projectPath = PBXProject.GetPBXProjectPath(buildPath); @@ -85,6 +85,7 @@ namespace Moloco.IOS.Scripts.Editor project.WriteToFile(projectPath); } } + } #endif \ No newline at end of file diff --git a/Editor/PostProcess/MolocoPostProcessBuildiOS.cs.meta b/Editor/PostProcess/MolocoPostProcessBuildiOS.cs.meta new file mode 100644 index 0000000..0e0c20a --- /dev/null +++ b/Editor/PostProcess/MolocoPostProcessBuildiOS.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 936e2d412b5342df98345c07fdf68c66 +timeCreated: 1718605026 \ No newline at end of file diff --git a/MaxSdk/AppLovin/Editor/Dependencies.xml b/MaxSdk/AppLovin/Editor/Dependencies.xml index e94d30e..07b3ecf 100644 --- a/MaxSdk/AppLovin/Editor/Dependencies.xml +++ b/MaxSdk/AppLovin/Editor/Dependencies.xml @@ -1,9 +1,9 @@ - + - + diff --git a/MaxSdk/AppLovin/Plugins/Android/applovin-max-unity-plugin.aar b/MaxSdk/AppLovin/Plugins/Android/applovin-max-unity-plugin.aar index 7575a83..a9d7ad8 100644 Binary files a/MaxSdk/AppLovin/Plugins/Android/applovin-max-unity-plugin.aar and b/MaxSdk/AppLovin/Plugins/Android/applovin-max-unity-plugin.aar differ diff --git a/MaxSdk/AppLovin/Plugins/iOS/MAUnityAdManager.h b/MaxSdk/AppLovin/Plugins/iOS/MAUnityAdManager.h index 4af5531..f5a250e 100644 --- a/MaxSdk/AppLovin/Plugins/iOS/MAUnityAdManager.h +++ b/MaxSdk/AppLovin/Plugins/iOS/MAUnityAdManager.h @@ -49,14 +49,6 @@ typedef void (*ALUnityBackgroundCallback)(const char* args); - (void)updateMRecPosition:(CGFloat)xOffset y:(CGFloat)yOffset forAdUnitIdentifier:(nullable NSString *)adUnitIdentifier; - (NSString *)mrecLayoutForAdUnitIdentifier:(nullable NSString *)adUnitIdentifier; -- (void)createCrossPromoAdWithAdUnitIdentifier:(nullable NSString *)adUnitIdentifier x:(CGFloat)xOffset y:(CGFloat)yOffset width:(CGFloat)width height:(CGFloat)height rotation:(CGFloat)rotation; -- (void)setCrossPromoAdPlacement:(nullable NSString *)placement forAdUnitIdentifier:(nullable NSString *)adUnitIdentifier; -- (void)showCrossPromoAdWithAdUnitIdentifier:(nullable NSString *)adUnitIdentifier; -- (void)destroyCrossPromoAdWithAdUnitIdentifier:(nullable NSString *)adUnitIdentifier; -- (void)hideCrossPromoAdWithAdUnitIdentifier:(nullable NSString *)adUnitIdentifier; -- (void)updateCrossPromoAdPositionForAdUnitIdentifier:(nullable NSString *)adUnitIdentifier x:(CGFloat)xOffset y:(CGFloat)yOffset width:(CGFloat)width height:(CGFloat)height rotation:(CGFloat)rotation; -- (NSString *)crossPromoAdLayoutForAdUnitIdentifier:(nullable NSString *)adUnitIdentifier; - - (void)loadInterstitialWithAdUnitIdentifier:(nullable NSString *)adUnitIdentifier; - (BOOL)isInterstitialReadyWithAdUnitIdentifier:(nullable NSString *)adUnitIdentifier; - (void)showInterstitialWithAdUnitIdentifier:(nullable NSString *)adUnitIdentifier placement:(nullable NSString *)placement customData:(nullable NSString *)customData; diff --git a/MaxSdk/AppLovin/Plugins/iOS/MAUnityAdManager.m b/MaxSdk/AppLovin/Plugins/iOS/MAUnityAdManager.m index eb874ac..36c28d2 100644 --- a/MaxSdk/AppLovin/Plugins/iOS/MAUnityAdManager.m +++ b/MaxSdk/AppLovin/Plugins/iOS/MAUnityAdManager.m @@ -5,7 +5,7 @@ #import "MAUnityAdManager.h" -#define VERSION @"6.1.2" +#define VERSION @"6.5.2" #define KEY_WINDOW [UIApplication sharedApplication].keyWindow #define DEVICE_SPECIFIC_ADVIEW_AD_FORMAT ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) ? MAAdFormat.leader : MAAdFormat.banner @@ -21,8 +21,8 @@ extern "C" { UIWindow* UnityGetMainWindow(void); // life cycle management + int UnityIsPaused(void); void UnityPause(int pause); - void UnitySendMessage(const char* obj, const char* method, const char* msg); void max_unity_dispatch_on_main_thread(dispatch_block_t block) { @@ -59,8 +59,6 @@ extern "C" { @property (nonatomic, strong) NSMutableDictionary *adViewPositions; @property (nonatomic, strong) NSMutableDictionary *adViewOffsets; @property (nonatomic, strong) NSMutableDictionary *adViewWidths; -@property (nonatomic, strong) NSMutableDictionary *crossPromoAdViewHeights; -@property (nonatomic, strong) NSMutableDictionary *crossPromoAdViewRotations; @property (nonatomic, strong) NSMutableDictionary *verticalAdViewFormats; @property (nonatomic, strong) NSMutableDictionary *> *adViewConstraints; @property (nonatomic, strong) NSMutableDictionary *> *adViewExtraParametersToSetAfterCreate; @@ -75,6 +73,9 @@ extern "C" { @property (nonatomic, strong) NSMutableDictionary *adInfoDict; @property (nonatomic, strong) NSObject *adInfoDictLock; +@property (nonatomic, strong) NSOperationQueue *backgroundCallbackEventsQueue; +@property (nonatomic, assign) BOOL resumeUnityAfterApplicationBecomesActive; + @end // Internal @@ -117,8 +118,6 @@ static ALUnityBackgroundCallback backgroundCallback; self.adViewPositions = [NSMutableDictionary dictionaryWithCapacity: 2]; self.adViewOffsets = [NSMutableDictionary dictionaryWithCapacity: 2]; self.adViewWidths = [NSMutableDictionary dictionaryWithCapacity: 2]; - self.crossPromoAdViewHeights = [NSMutableDictionary dictionaryWithCapacity: 2]; - self.crossPromoAdViewRotations = [NSMutableDictionary dictionaryWithCapacity: 2]; self.verticalAdViewFormats = [NSMutableDictionary dictionaryWithCapacity: 2]; self.adViewConstraints = [NSMutableDictionary dictionaryWithCapacity: 2]; self.adViewExtraParametersToSetAfterCreate = [NSMutableDictionary dictionaryWithCapacity: 1]; @@ -130,6 +129,9 @@ static ALUnityBackgroundCallback backgroundCallback; self.adInfoDict = [NSMutableDictionary dictionary]; self.adInfoDictLock = [[NSObject alloc] init]; + self.backgroundCallbackEventsQueue = [[NSOperationQueue alloc] init]; + self.backgroundCallbackEventsQueue.maxConcurrentOperationCount = 1; + max_unity_dispatch_on_main_thread(^{ self.safeAreaBackground = [[UIView alloc] init]; self.safeAreaBackground.hidden = YES; @@ -152,6 +154,31 @@ static ALUnityBackgroundCallback backgroundCallback; [self positionAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: self.verticalAdViewFormats[adUnitIdentifier]]; } }]; + + [[NSNotificationCenter defaultCenter] addObserver: self + selector: @selector(applicationPaused:) + name: UIApplicationDidEnterBackgroundNotification + object: nil]; + + [[NSNotificationCenter defaultCenter] addObserver: self + selector: @selector(applicationResumed:) + name: UIApplicationDidBecomeActiveNotification + object: nil]; + + [[NSNotificationCenter defaultCenter] addObserverForName: UIApplicationDidBecomeActiveNotification + object: nil + queue: [NSOperationQueue mainQueue] + usingBlock:^(NSNotification *notification) { + +#if !IS_TEST_APP + if ( self.resumeUnityAfterApplicationBecomesActive && UnityIsPaused() ) + { + UnityPause(NO); + } +#endif + + self.backgroundCallbackEventsQueue.suspended = NO; + }]; } return self; } @@ -188,19 +215,21 @@ static ALUnityBackgroundCallback backgroundCallback; self.sdk.mediationProvider = @"max"; [self.sdk initializeSdkWithCompletionHandler:^(ALSdkConfiguration *configuration) { - // Note: internal state should be updated first - completionHandler( configuration ); - - NSString *consentFlowUserGeographyStr = @(configuration.consentFlowUserGeography).stringValue; - NSString *consentDialogStateStr = @(configuration.consentDialogState).stringValue; - NSString *appTrackingStatus = @(configuration.appTrackingTransparencyStatus).stringValue; // Deliberately name it `appTrackingStatus` to be a bit more generic (in case Android introduces a similar concept) - [MAUnityAdManager forwardUnityEventWithArgs: @{@"name" : @"OnSdkInitializedEvent", - @"consentFlowUserGeography" : consentFlowUserGeographyStr, - @"consentDialogState" : consentDialogStateStr, - @"countryCode" : configuration.countryCode, - @"appTrackingStatus" : appTrackingStatus, - @"isSuccessfullyInitialized" : @([self.sdk isInitialized]), - @"isTestModeEnabled" : @([configuration isTestModeEnabled])}]; + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + // Note: internal state should be updated first + completionHandler( configuration ); + + NSString *consentFlowUserGeographyStr = @(configuration.consentFlowUserGeography).stringValue; + NSString *consentDialogStateStr = @(configuration.consentDialogState).stringValue; + NSString *appTrackingStatus = @(configuration.appTrackingTransparencyStatus).stringValue; // Deliberately name it `appTrackingStatus` to be a bit more generic (in case Android introduces a similar concept) + [self forwardUnityEventWithArgs: @{@"name" : @"OnSdkInitializedEvent", + @"consentFlowUserGeography" : consentFlowUserGeographyStr, + @"consentDialogState" : consentDialogStateStr, + @"countryCode" : configuration.countryCode, + @"appTrackingStatus" : appTrackingStatus, + @"isSuccessfullyInitialized" : @([self.sdk isInitialized]), + @"isTestModeEnabled" : @([configuration isTestModeEnabled])}]; + }); }]; return self.sdk; @@ -218,7 +247,7 @@ static ALUnityBackgroundCallback backgroundCallback; [self createAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: [self adViewAdFormatForAdUnitIdentifier: adUnitIdentifier] atPosition: DEFAULT_AD_VIEW_POSITION withOffset: CGPointMake(xOffset, yOffset)]; } -- (void)loadBannerWithAdUnitIdentifier:(nullable NSString *)adUnitIdentifier +- (void)loadBannerWithAdUnitIdentifier:(nullable NSString *)adUnitIdentifier { [self loadAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: [self adViewAdFormatForAdUnitIdentifier: adUnitIdentifier]]; } @@ -387,49 +416,6 @@ static ALUnityBackgroundCallback backgroundCallback; return [self adViewLayoutForAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec]; } -#pragma mark - Cross Promo Ads - -- (void)createCrossPromoAdWithAdUnitIdentifier:(nullable NSString *)adUnitIdentifier x:(CGFloat)xOffset y:(CGFloat)yOffset width:(CGFloat)width height:(CGFloat)height rotation:(CGFloat)rotation -{ - self.adViewWidths[adUnitIdentifier] = @(width); - self.crossPromoAdViewHeights[adUnitIdentifier] = @(height); - self.crossPromoAdViewRotations[adUnitIdentifier] = @(rotation); - [self createAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.crossPromo atPosition: DEFAULT_AD_VIEW_POSITION withOffset: CGPointMake(xOffset, yOffset)]; -} - -- (void)setCrossPromoAdPlacement:(nullable NSString *)placement forAdUnitIdentifier:(nullable NSString *)adUnitIdentifier -{ - [self setAdViewPlacement: placement forAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.crossPromo]; -} - -- (void)updateCrossPromoAdPositionForAdUnitIdentifier:(nullable NSString *)adUnitIdentifier x:(CGFloat)xOffset y:(CGFloat)yOffset width:(CGFloat)width height:(CGFloat)height rotation:(CGFloat)rotation -{ - self.adViewWidths[adUnitIdentifier] = @(width); - self.crossPromoAdViewHeights[adUnitIdentifier] = @(height); - self.crossPromoAdViewRotations[adUnitIdentifier] = @(rotation); - [self updateAdViewPosition: DEFAULT_AD_VIEW_POSITION withOffset: CGPointMake(xOffset, yOffset) forAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.crossPromo]; -} - -- (void)showCrossPromoAdWithAdUnitIdentifier:(nullable NSString *)adUnitIdentifier -{ - [self showAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.crossPromo]; -} - -- (void)destroyCrossPromoAdWithAdUnitIdentifier:(nullable NSString *)adUnitIdentifier -{ - [self destroyAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.crossPromo]; -} - -- (void)hideCrossPromoAdWithAdUnitIdentifier:(nullable NSString *)adUnitIdentifier -{ - [self hideAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.crossPromo]; -} - -- (NSString *)crossPromoAdLayoutForAdUnitIdentifier:(nullable NSString *)adUnitIdentifier -{ - return [self adViewLayoutForAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.crossPromo]; -} - #pragma mark - Interstitials - (void)loadInterstitialWithAdUnitIdentifier:(nullable NSString *)adUnitIdentifier @@ -594,7 +580,7 @@ static ALUnityBackgroundCallback backgroundCallback; - (NSString *)adInfoForAdUnitIdentifier:(nullable NSString *)adUnitIdentifier { - if ( [adUnitIdentifier al_isValidString] ) return @""; + if ( ![adUnitIdentifier al_isValidString] ) return @""; MAAd *ad = [self adWithAdUnitIdentifier: adUnitIdentifier]; if ( !ad ) return @""; @@ -613,6 +599,7 @@ static ALUnityBackgroundCallback backgroundCallback; @"revenue" : [@(ad.revenue) stringValue], @"revenuePrecision" : ad.revenuePrecision, @"waterfallInfo" : [self createAdWaterfallInfo: ad.waterfall], + @"latencyMillis" : [self requestLatencyMillisFromRequestLatency: ad.requestLatency], @"dspName" : ad.DSPName ?: @""}; } @@ -631,11 +618,9 @@ static ALUnityBackgroundCallback backgroundCallback; { [networkResponsesArray addObject: [self createNetworkResponseInfo: response]]; } - waterfallInfoDict[@"networkResponses"] = networkResponsesArray; - // Convert latency from seconds to milliseconds to match Android. - long latencyMillis = waterfallInfo.latency * 1000; - waterfallInfoDict[@"latencyMillis"] = @(latencyMillis).stringValue; + waterfallInfoDict[@"networkResponses"] = networkResponsesArray; + waterfallInfoDict[@"latencyMillis"] = [self requestLatencyMillisFromRequestLatency: waterfallInfo.latency]; return waterfallInfoDict; } @@ -668,13 +653,12 @@ static ALUnityBackgroundCallback backgroundCallback; errorObject[@"errorMessage"] = error.message; errorObject[@"adLoadFailure"] = error.adLoadFailureInfo; errorObject[@"errorCode"] = @(error.code).stringValue; + errorObject[@"latencyMillis"] = [self requestLatencyMillisFromRequestLatency: error.requestLatency]; networkResponseDict[@"error"] = errorObject; } - // Convert latency from seconds to milliseconds to match Android. - long latencySeconds = response.latency * 1000; - networkResponseDict[@"latencyMillis"] = @(latencySeconds).stringValue; + networkResponseDict[@"latencyMillis"] = [self requestLatencyMillisFromRequestLatency: response.latency]; return networkResponseDict; } @@ -708,10 +692,6 @@ static ALUnityBackgroundCallback backgroundCallback; { name = @"OnMRecAdLoadedEvent"; } - else if ( MAAdFormat.crossPromo == adFormat ) - { - name = @"OnCrossPromoAdLoadedEvent"; - } else { name = @"OnBannerAdLoadedEvent"; @@ -747,115 +727,117 @@ static ALUnityBackgroundCallback backgroundCallback; return; } - @synchronized ( self.adInfoDictLock ) - { - self.adInfoDict[ad.adUnitIdentifier] = ad; - } - - NSDictionary *args = [self defaultAdEventParametersForName: name withAd: ad]; - [MAUnityAdManager forwardUnityEventWithArgs: args]; + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + + @synchronized ( self.adInfoDictLock ) + { + self.adInfoDict[ad.adUnitIdentifier] = ad; + } + + NSDictionary *args = [self defaultAdEventParametersForName: name withAd: ad]; + [self forwardUnityEventWithArgs: args]; + }); } - (void)didFailToLoadAdForAdUnitIdentifier:(NSString *)adUnitIdentifier withError:(MAError *)error { - if ( !adUnitIdentifier ) - { - [self log: @"adUnitIdentifier cannot be nil from %@", [NSThread callStackSymbols]]; - return; - } - - NSString *name; - if ( self.adViews[adUnitIdentifier] ) - { - MAAdFormat *adFormat = self.adViewAdFormats[adUnitIdentifier]; - if ( MAAdFormat.mrec == adFormat ) + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + + if ( !adUnitIdentifier ) { - name = @"OnMRecAdLoadFailedEvent"; + [self log: @"adUnitIdentifier cannot be nil from %@", [NSThread callStackSymbols]]; + return; } - else if ( MAAdFormat.crossPromo == adFormat ) + + NSString *name; + if ( self.adViews[adUnitIdentifier] ) { - name = @"OnCrossPromoAdLoadFailedEvent"; + MAAdFormat *adFormat = self.adViewAdFormats[adUnitIdentifier]; + if ( MAAdFormat.mrec == adFormat ) + { + name = @"OnMRecAdLoadFailedEvent"; + } + else + { + name = @"OnBannerAdLoadFailedEvent"; + } + } + else if ( self.interstitials[adUnitIdentifier] ) + { + name = @"OnInterstitialLoadFailedEvent"; + } + else if ( self.appOpenAds[adUnitIdentifier] ) + { + name = @"OnAppOpenAdLoadFailedEvent"; + } + else if ( self.rewardedAds[adUnitIdentifier] ) + { + name = @"OnRewardedAdLoadFailedEvent"; + } + else if ( self.rewardedInterstitialAds[adUnitIdentifier] ) + { + name = @"OnRewardedInterstitialAdLoadFailedEvent"; } else { - name = @"OnBannerAdLoadFailedEvent"; + [self log: @"invalid adUnitId from %@", [NSThread callStackSymbols]]; + return; } - } - else if ( self.interstitials[adUnitIdentifier] ) - { - name = @"OnInterstitialLoadFailedEvent"; - } - else if ( self.appOpenAds[adUnitIdentifier] ) - { - name = @"OnAppOpenAdLoadFailedEvent"; - } - else if ( self.rewardedAds[adUnitIdentifier] ) - { - name = @"OnRewardedAdLoadFailedEvent"; - } - else if ( self.rewardedInterstitialAds[adUnitIdentifier] ) - { - name = @"OnRewardedInterstitialAdLoadFailedEvent"; - } - else - { - [self log: @"invalid adUnitId from %@", [NSThread callStackSymbols]]; - return; - } - - @synchronized ( self.adInfoDictLock ) - { - [self.adInfoDict removeObjectForKey: adUnitIdentifier]; - } - - [MAUnityAdManager forwardUnityEventWithArgs: @{@"name" : name, - @"adUnitId" : adUnitIdentifier, - @"errorCode" : [@(error.code) stringValue], - @"errorMessage" : error.message, - @"waterfallInfo" : [self createAdWaterfallInfo: error.waterfall], - @"adLoadFailureInfo" : error.adLoadFailureInfo ?: @""}]; + + @synchronized ( self.adInfoDictLock ) + { + [self.adInfoDict removeObjectForKey: adUnitIdentifier]; + } + + [self forwardUnityEventWithArgs: @{@"name" : name, + @"adUnitId" : adUnitIdentifier, + @"errorCode" : [@(error.code) stringValue], + @"errorMessage" : error.message, + @"waterfallInfo" : [self createAdWaterfallInfo: error.waterfall], + @"adLoadFailureInfo" : error.adLoadFailureInfo ?: @"", + @"latencyMillis" : [self requestLatencyMillisFromRequestLatency: error.requestLatency]}]; + }); } - (void)didClickAd:(MAAd *)ad { - NSString *name; - MAAdFormat *adFormat = ad.format; - if ( MAAdFormat.banner == adFormat || MAAdFormat.leader == adFormat ) - { - name = @"OnBannerAdClickedEvent"; - } - else if ( MAAdFormat.mrec == adFormat ) - { - name = @"OnMRecAdClickedEvent"; - } - else if ( MAAdFormat.crossPromo == adFormat ) - { - name = @"OnCrossPromoAdClickedEvent"; - } - else if ( MAAdFormat.interstitial == adFormat ) - { - name = @"OnInterstitialClickedEvent"; - } - else if ( MAAdFormat.appOpen == adFormat ) - { - name = @"OnAppOpenAdClickedEvent"; - } - else if ( MAAdFormat.rewarded == adFormat ) - { - name = @"OnRewardedAdClickedEvent"; - } - else if ( MAAdFormat.rewardedInterstitial == adFormat ) - { - name = @"OnRewardedInterstitialAdClickedEvent"; - } - else - { - [self logInvalidAdFormat: adFormat]; - return; - } - - NSDictionary *args = [self defaultAdEventParametersForName: name withAd: ad]; - [MAUnityAdManager forwardUnityEventWithArgs: args]; + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + + NSString *name; + MAAdFormat *adFormat = ad.format; + if ( MAAdFormat.banner == adFormat || MAAdFormat.leader == adFormat ) + { + name = @"OnBannerAdClickedEvent"; + } + else if ( MAAdFormat.mrec == adFormat ) + { + name = @"OnMRecAdClickedEvent"; + } + else if ( MAAdFormat.interstitial == adFormat ) + { + name = @"OnInterstitialClickedEvent"; + } + else if ( MAAdFormat.appOpen == adFormat ) + { + name = @"OnAppOpenAdClickedEvent"; + } + else if ( MAAdFormat.rewarded == adFormat ) + { + name = @"OnRewardedAdClickedEvent"; + } + else if ( MAAdFormat.rewardedInterstitial == adFormat ) + { + name = @"OnRewardedInterstitialAdClickedEvent"; + } + else + { + [self logInvalidAdFormat: adFormat]; + return; + } + + NSDictionary *args = [self defaultAdEventParametersForName: name withAd: ad]; + [self forwardUnityEventWithArgs: args]; + }); } - (void)didDisplayAd:(MAAd *)ad @@ -865,62 +847,70 @@ static ALUnityBackgroundCallback backgroundCallback; if ( ![adFormat isFullscreenAd] ) return; #if !IS_TEST_APP - UnityPause(1); + // UnityPause needs to be called on the main thread. + UnityPause(YES); #endif - NSString *name; - if ( MAAdFormat.interstitial == adFormat ) - { - name = @"OnInterstitialDisplayedEvent"; - } - else if ( MAAdFormat.appOpen == adFormat ) - { - name = @"OnAppOpenAdDisplayedEvent"; - } - else if ( MAAdFormat.rewarded == adFormat ) - { - name = @"OnRewardedAdDisplayedEvent"; - } - else // rewarded inters - { - name = @"OnRewardedInterstitialAdDisplayedEvent"; - } - - NSDictionary *args = [self defaultAdEventParametersForName: name withAd: ad]; - [MAUnityAdManager forwardUnityEventWithArgs: args]; + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + + NSString *name; + if ( MAAdFormat.interstitial == adFormat ) + { + name = @"OnInterstitialDisplayedEvent"; + } + else if ( MAAdFormat.appOpen == adFormat ) + { + name = @"OnAppOpenAdDisplayedEvent"; + } + else if ( MAAdFormat.rewarded == adFormat ) + { + name = @"OnRewardedAdDisplayedEvent"; + } + else // rewarded inters + { + name = @"OnRewardedInterstitialAdDisplayedEvent"; + } + + NSDictionary *args = [self defaultAdEventParametersForName: name withAd: ad]; + [self forwardUnityEventWithArgs: args]; + }); } - (void)didFailToDisplayAd:(MAAd *)ad withError:(MAError *)error { - // BMLs do not support [DISPLAY] events in Unity - MAAdFormat *adFormat = ad.format; - if ( ![adFormat isFullscreenAd] ) return; - - NSString *name; - if ( MAAdFormat.interstitial == adFormat ) - { - name = @"OnInterstitialAdFailedToDisplayEvent"; - } - else if ( MAAdFormat.appOpen == adFormat ) - { - name = @"OnAppOpenAdFailedToDisplayEvent"; - } - else if ( MAAdFormat.rewarded == adFormat ) - { - name = @"OnRewardedAdFailedToDisplayEvent"; - } - else // rewarded inters - { - name = @"OnRewardedInterstitialAdFailedToDisplayEvent"; - } - - NSMutableDictionary *args = [self defaultAdEventParametersForName: name withAd: ad]; - args[@"errorCode"] = [@(error.code) stringValue]; - args[@"errorMessage"] = error.message; - args[@"mediatedNetworkErrorCode"] = [@(error.mediatedNetworkErrorCode) stringValue]; - args[@"mediatedNetworkErrorMessage"] = error.mediatedNetworkErrorMessage; - args[@"waterfallInfo"] = [self createAdWaterfallInfo: error.waterfall]; - [MAUnityAdManager forwardUnityEventWithArgs: args]; + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + + // BMLs do not support [DISPLAY] events in Unity + MAAdFormat *adFormat = ad.format; + if ( ![adFormat isFullscreenAd] ) return; + + NSString *name; + if ( MAAdFormat.interstitial == adFormat ) + { + name = @"OnInterstitialAdFailedToDisplayEvent"; + } + else if ( MAAdFormat.appOpen == adFormat ) + { + name = @"OnAppOpenAdFailedToDisplayEvent"; + } + else if ( MAAdFormat.rewarded == adFormat ) + { + name = @"OnRewardedAdFailedToDisplayEvent"; + } + else // rewarded inters + { + name = @"OnRewardedInterstitialAdFailedToDisplayEvent"; + } + + NSMutableDictionary *args = [self defaultAdEventParametersForName: name withAd: ad]; + args[@"errorCode"] = [@(error.code) stringValue]; + args[@"errorMessage"] = error.message; + args[@"mediatedNetworkErrorCode"] = [@(error.mediatedNetworkErrorCode) stringValue]; + args[@"mediatedNetworkErrorMessage"] = error.mediatedNetworkErrorMessage; + args[@"waterfallInfo"] = [self createAdWaterfallInfo: error.waterfall]; + args[@"latencyMillis"] = [self requestLatencyMillisFromRequestLatency: error.requestLatency]; + [self forwardUnityEventWithArgs: args]; + }); } - (void)didHideAd:(MAAd *)ad @@ -930,29 +920,42 @@ static ALUnityBackgroundCallback backgroundCallback; if ( ![adFormat isFullscreenAd] ) return; #if !IS_TEST_APP - UnityPause(0); + extern bool _didResignActive; + if ( _didResignActive ) + { + // If the application is not active, we should wait until application becomes active to resume unity. + self.resumeUnityAfterApplicationBecomesActive = YES; + } + else + { + // UnityPause needs to be called on the main thread. + UnityPause(NO); + } #endif - NSString *name; - if ( MAAdFormat.interstitial == adFormat ) - { - name = @"OnInterstitialHiddenEvent"; - } - else if ( MAAdFormat.appOpen == adFormat ) - { - name = @"OnAppOpenAdHiddenEvent"; - } - else if ( MAAdFormat.rewarded == adFormat ) - { - name = @"OnRewardedAdHiddenEvent"; - } - else // rewarded inters - { - name = @"OnRewardedInterstitialAdHiddenEvent"; - } - - NSDictionary *args = [self defaultAdEventParametersForName: name withAd: ad]; - [MAUnityAdManager forwardUnityEventWithArgs: args]; + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + + NSString *name; + if ( MAAdFormat.interstitial == adFormat ) + { + name = @"OnInterstitialHiddenEvent"; + } + else if ( MAAdFormat.appOpen == adFormat ) + { + name = @"OnAppOpenAdHiddenEvent"; + } + else if ( MAAdFormat.rewarded == adFormat ) + { + name = @"OnRewardedAdHiddenEvent"; + } + else // rewarded inters + { + name = @"OnRewardedInterstitialAdHiddenEvent"; + } + + NSDictionary *args = [self defaultAdEventParametersForName: name withAd: ad]; + [self forwardUnityEventWithArgs: args]; + }); } - (void)didExpandAd:(MAAd *)ad @@ -965,25 +968,25 @@ static ALUnityBackgroundCallback backgroundCallback; } #if !IS_TEST_APP - UnityPause(1); + // UnityPause needs to be called on the main thread. + UnityPause(YES); #endif - NSString *name; - if ( MAAdFormat.mrec == adFormat ) - { - name = @"OnMRecAdExpandedEvent"; - } - else if ( MAAdFormat.crossPromo == adFormat ) - { - name = @"OnCrossPromoAdExpandedEvent"; - } - else - { - name = @"OnBannerAdExpandedEvent"; - } - - NSDictionary *args = [self defaultAdEventParametersForName: name withAd: ad]; - [MAUnityAdManager forwardUnityEventWithArgs: args]; + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + + NSString *name; + if ( MAAdFormat.mrec == adFormat ) + { + name = @"OnMRecAdExpandedEvent"; + } + else + { + name = @"OnBannerAdExpandedEvent"; + } + + NSDictionary *args = [self defaultAdEventParametersForName: name withAd: ad]; + [self forwardUnityEventWithArgs: args]; + }); } - (void)didCollapseAd:(MAAd *)ad @@ -996,25 +999,34 @@ static ALUnityBackgroundCallback backgroundCallback; } #if !IS_TEST_APP - UnityPause(0); -#endif - - NSString *name; - if ( MAAdFormat.mrec == adFormat ) + extern bool _didResignActive; + if ( _didResignActive ) { - name = @"OnMRecAdCollapsedEvent"; - } - else if ( MAAdFormat.crossPromo == adFormat ) - { - name = @"OnCrossPromoAdCollapsedEvent"; + // If the application is not active, we should wait until application becomes active to resume unity. + self.resumeUnityAfterApplicationBecomesActive = YES; } else { - name = @"OnBannerAdCollapsedEvent"; + // UnityPause needs to be called on the main thread. + UnityPause(NO); } +#endif - NSDictionary *args = [self defaultAdEventParametersForName: name withAd: ad]; - [MAUnityAdManager forwardUnityEventWithArgs: args]; + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + + NSString *name; + if ( MAAdFormat.mrec == adFormat ) + { + name = @"OnMRecAdCollapsedEvent"; + } + else + { + name = @"OnBannerAdCollapsedEvent"; + } + + NSDictionary *args = [self defaultAdEventParametersForName: name withAd: ad]; + [self forwardUnityEventWithArgs: args]; + }); } - (void)didStartRewardedVideoForAd:(MAAd *)ad @@ -1029,103 +1041,110 @@ static ALUnityBackgroundCallback backgroundCallback; - (void)didRewardUserForAd:(MAAd *)ad withReward:(MAReward *)reward { - MAAdFormat *adFormat = ad.format; - if ( adFormat != MAAdFormat.rewarded && adFormat != MAAdFormat.rewardedInterstitial ) - { - [self logInvalidAdFormat: adFormat]; - return; - } - - NSString *rewardLabel = reward ? reward.label : @""; - NSInteger rewardAmountInt = reward ? reward.amount : 0; - NSString *rewardAmount = [@(rewardAmountInt) stringValue]; - - NSString *name = (adFormat == MAAdFormat.rewarded) ? @"OnRewardedAdReceivedRewardEvent" : @"OnRewardedInterstitialAdReceivedRewardEvent"; - - - NSMutableDictionary *args = [self defaultAdEventParametersForName: name withAd: ad]; - args[@"rewardLabel"] = rewardLabel; - args[@"rewardAmount"] = rewardAmount; - [MAUnityAdManager forwardUnityEventWithArgs: args]; + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + + MAAdFormat *adFormat = ad.format; + if ( adFormat != MAAdFormat.rewarded && adFormat != MAAdFormat.rewardedInterstitial ) + { + [self logInvalidAdFormat: adFormat]; + return; + } + + NSString *rewardLabel = reward ? reward.label : @""; + NSInteger rewardAmountInt = reward ? reward.amount : 0; + NSString *rewardAmount = [@(rewardAmountInt) stringValue]; + + NSString *name = (adFormat == MAAdFormat.rewarded) ? @"OnRewardedAdReceivedRewardEvent" : @"OnRewardedInterstitialAdReceivedRewardEvent"; + + + NSMutableDictionary *args = [self defaultAdEventParametersForName: name withAd: ad]; + args[@"rewardLabel"] = rewardLabel; + args[@"rewardAmount"] = rewardAmount; + [self forwardUnityEventWithArgs: args]; + }); } - (void)didPayRevenueForAd:(MAAd *)ad { - NSString *name; - MAAdFormat *adFormat = ad.format; - if ( MAAdFormat.banner == adFormat || MAAdFormat.leader == adFormat ) - { - name = @"OnBannerAdRevenuePaidEvent"; - } - else if ( MAAdFormat.mrec == adFormat ) - { - name = @"OnMRecAdRevenuePaidEvent"; - } - else if ( MAAdFormat.crossPromo == adFormat ) - { - name = @"OnCrossPromoAdRevenuePaidEvent"; - } - else if ( MAAdFormat.interstitial == adFormat ) - { - name = @"OnInterstitialAdRevenuePaidEvent"; - } - else if ( MAAdFormat.appOpen == adFormat ) - { - name = @"OnAppOpenAdRevenuePaidEvent"; - } - else if ( MAAdFormat.rewarded == adFormat ) - { - name = @"OnRewardedAdRevenuePaidEvent"; - } - else if ( MAAdFormat.rewardedInterstitial == adFormat ) - { - name = @"OnRewardedInterstitialAdRevenuePaidEvent"; - } - else - { - [self logInvalidAdFormat: adFormat]; - return; - } - - NSDictionary *args = [self defaultAdEventParametersForName: name withAd: ad]; - [MAUnityAdManager forwardUnityEventWithArgs: args forwardInBackground: [adFormat isFullscreenAd]]; + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + + NSString *name; + MAAdFormat *adFormat = ad.format; + if ( MAAdFormat.banner == adFormat || MAAdFormat.leader == adFormat ) + { + name = @"OnBannerAdRevenuePaidEvent"; + } + else if ( MAAdFormat.mrec == adFormat ) + { + name = @"OnMRecAdRevenuePaidEvent"; + } + else if ( MAAdFormat.interstitial == adFormat ) + { + name = @"OnInterstitialAdRevenuePaidEvent"; + } + else if ( MAAdFormat.appOpen == adFormat ) + { + name = @"OnAppOpenAdRevenuePaidEvent"; + } + else if ( MAAdFormat.rewarded == adFormat ) + { + name = @"OnRewardedAdRevenuePaidEvent"; + } + else if ( MAAdFormat.rewardedInterstitial == adFormat ) + { + name = @"OnRewardedInterstitialAdRevenuePaidEvent"; + } + else + { + [self logInvalidAdFormat: adFormat]; + return; + } + + NSMutableDictionary *args = [self defaultAdEventParametersForName: name withAd: ad]; + args[@"keepInBackground"] = @([adFormat isFullscreenAd]); + [self forwardUnityEventWithArgs: args]; + }); } - (void)didGenerateCreativeIdentifier:(NSString *)creativeIdentifier forAd:(MAAd *)ad { - NSString *name; - MAAdFormat *adFormat = ad.format; - if ( MAAdFormat.banner == adFormat || MAAdFormat.leader == adFormat ) - { - name = @"OnBannerAdReviewCreativeIdGeneratedEvent"; - } - else if ( MAAdFormat.mrec == adFormat ) - { - name = @"OnMRecAdReviewCreativeIdGeneratedEvent"; - } - else if ( MAAdFormat.interstitial == adFormat ) - { - name = @"OnInterstitialAdReviewCreativeIdGeneratedEvent"; - } - else if ( MAAdFormat.rewarded == adFormat ) - { - name = @"OnRewardedAdReviewCreativeIdGeneratedEvent"; - } - else if ( MAAdFormat.rewardedInterstitial == adFormat ) - { - name = @"OnRewardedInterstitialAdReviewCreativeIdGeneratedEvent"; - } - else - { - [self logInvalidAdFormat: adFormat]; - return; - } - - NSMutableDictionary *args = [self defaultAdEventParametersForName: name withAd: ad]; - args[@"adReviewCreativeId"] = creativeIdentifier; - - // Forward the event in background for fullscreen ads so that the user gets the callback even while the ad is playing. - [MAUnityAdManager forwardUnityEventWithArgs: args forwardInBackground: [adFormat isFullscreenAd]]; + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + + NSString *name; + MAAdFormat *adFormat = ad.format; + if ( MAAdFormat.banner == adFormat || MAAdFormat.leader == adFormat ) + { + name = @"OnBannerAdReviewCreativeIdGeneratedEvent"; + } + else if ( MAAdFormat.mrec == adFormat ) + { + name = @"OnMRecAdReviewCreativeIdGeneratedEvent"; + } + else if ( MAAdFormat.interstitial == adFormat ) + { + name = @"OnInterstitialAdReviewCreativeIdGeneratedEvent"; + } + else if ( MAAdFormat.rewarded == adFormat ) + { + name = @"OnRewardedAdReviewCreativeIdGeneratedEvent"; + } + else if ( MAAdFormat.rewardedInterstitial == adFormat ) + { + name = @"OnRewardedInterstitialAdReviewCreativeIdGeneratedEvent"; + } + else + { + [self logInvalidAdFormat: adFormat]; + return; + } + + NSMutableDictionary *args = [self defaultAdEventParametersForName: name withAd: ad]; + args[@"adReviewCreativeId"] = creativeIdentifier; + args[@"keepInBackground"] = @([adFormat isFullscreenAd]); + + // Forward the event in background for fullscreen ads so that the user gets the callback even while the ad is playing. + [self forwardUnityEventWithArgs: args]; + }); } - (NSMutableDictionary *)defaultAdEventParametersForName:(NSString *)name withAd:(MAAd *)ad @@ -1537,8 +1556,6 @@ static ALUnityBackgroundCallback backgroundCallback; [self.adViewPositions removeObjectForKey: adUnitIdentifier]; [self.adViewOffsets removeObjectForKey: adUnitIdentifier]; [self.adViewWidths removeObjectForKey: adUnitIdentifier]; - [self.crossPromoAdViewHeights removeObjectForKey: adUnitIdentifier]; - [self.crossPromoAdViewRotations removeObjectForKey: adUnitIdentifier]; [self.verticalAdViewFormats removeObjectForKey: adUnitIdentifier]; [self.disabledAdaptiveBannerAdUnitIdentifiers removeObject: adUnitIdentifier]; }); @@ -1678,8 +1695,6 @@ static ALUnityBackgroundCallback backgroundCallback; CGPoint adViewOffset = [adViewPositionValue CGPointValue]; BOOL isAdaptiveBannerDisabled = [self.disabledAdaptiveBannerAdUnitIdentifiers containsObject: adUnitIdentifier]; BOOL isWidthPtsOverridden = self.adViewWidths[adUnitIdentifier] != nil; - BOOL isCrossPromoHeightPtsOverridden = self.crossPromoAdViewHeights[adUnitIdentifier] != nil; - BOOL isCrossPromoRotationOverridden = self.crossPromoAdViewRotations[adUnitIdentifier] != nil; UIView *superview = adView.superview; if ( !superview ) return; @@ -1727,11 +1742,7 @@ static ALUnityBackgroundCallback backgroundCallback; // CGFloat adViewHeight; - if ( isCrossPromoHeightPtsOverridden ) - { - adViewHeight = self.crossPromoAdViewHeights[adUnitIdentifier].floatValue; - } - else if ( (adFormat == MAAdFormat.banner || adFormat == MAAdFormat.leader) && !isAdaptiveBannerDisabled ) + if ( (adFormat == MAAdFormat.banner || adFormat == MAAdFormat.leader) && !isAdaptiveBannerDisabled ) { adViewHeight = [adFormat adaptiveSizeForWidth: adViewWidth].height; } @@ -1959,11 +1970,6 @@ static ALUnityBackgroundCallback backgroundCallback; } } - if ( isCrossPromoRotationOverridden ) - { - adView.transform = CGAffineTransformRotate(CGAffineTransformIdentity, DEGREES_TO_RADIANS(self.crossPromoAdViewRotations[adUnitIdentifier].floatValue)); - } - self.adViewConstraints[adUnitIdentifier] = constraints; [NSLayoutConstraint activateConstraints: constraints]; @@ -1976,24 +1982,19 @@ static ALUnityBackgroundCallback backgroundCallback; return UnityGetGLViewController() ?: UnityGetMainWindow().rootViewController ?: [KEY_WINDOW rootViewController]; } -+ (void)forwardUnityEventWithArgs:(NSDictionary *)args -{ - [MAUnityAdManager forwardUnityEventWithArgs: args forwardInBackground: NO]; -} - -+ (void)forwardUnityEventWithArgs:(NSDictionary *)args forwardInBackground:(BOOL)forwardInBackground +- (void)forwardUnityEventWithArgs:(NSDictionary *)args { #if !IS_TEST_APP - char *serializedParameters = [self serializeParameters: args].UTF8String; - if ( forwardInBackground ) - { - backgroundCallback(serializedParameters); - } - else - { - UnitySendMessage("MaxSdkCallbacks", "ForwardEvent", serializedParameters); - } + extern bool _didResignActive; + // We should not call any script callbacks when application is not active. Suspend the callback queue if resign is active. + // We'll resume the queue once the application becomes active again. + self.backgroundCallbackEventsQueue.suspended = _didResignActive; #endif + + [self.backgroundCallbackEventsQueue addOperationWithBlock:^{ + NSString *serializedParameters = [MAUnityAdManager serializeParameters: args]; + backgroundCallback(serializedParameters.UTF8String); + }]; } + (NSString *)serializeParameters:(NSDictionary *)dict @@ -2036,11 +2037,20 @@ static ALUnityBackgroundCallback backgroundCallback; } } +- (NSString *)requestLatencyMillisFromRequestLatency:(NSTimeInterval)requestLatency +{ + // Convert latency from seconds to milliseconds to match Android. + long requestLatencyMillis = requestLatency * 1000; + return @(requestLatencyMillis).stringValue; +} + #pragma mark - User Service - (void)didDismissUserConsentDialog { - [MAUnityAdManager forwardUnityEventWithArgs: @{@"name" : @"OnSdkConsentDialogDismissedEvent"}]; + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + [self forwardUnityEventWithArgs: @{@"name" : @"OnSdkConsentDialogDismissedEvent"}]; + }); } #pragma mark - CMP Service @@ -2049,21 +2059,44 @@ static ALUnityBackgroundCallback backgroundCallback; { [self.sdk.cmpService showCMPForExistingUserWithCompletion:^(ALCMPError * _Nullable error) { - NSMutableDictionary *args = [NSMutableDictionary dictionaryWithCapacity: 2]; - args[@"name"] = @"OnCmpCompletedEvent"; - - if ( error ) - { - args[@"error"] = @{@"code": @(error.code), - @"message": error.message, - @"cmpCode": @(error.cmpCode), - @"cmpMessage": error.cmpMessage}; - } - - [MAUnityAdManager forwardUnityEventWithArgs: args forwardInBackground: YES]; + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + NSMutableDictionary *args = [NSMutableDictionary dictionaryWithCapacity: 2]; + args[@"name"] = @"OnCmpCompletedEvent"; + + if ( error ) + { + args[@"error"] = @{@"code": @(error.code), + @"message": error.message, + @"cmpCode": @(error.cmpCode), + @"cmpMessage": error.cmpMessage, + @"keepInBackground": @(YES)}; + } + + [self forwardUnityEventWithArgs: args]; + }); }]; } +#pragma mark - Application + +- (void)applicationPaused:(NSNotification *)notification +{ + [self notifyApplicationStateChangedEventForPauseState: YES]; +} + +- (void)applicationResumed:(NSNotification *)notification +{ + [self notifyApplicationStateChangedEventForPauseState: NO]; +} + +- (void)notifyApplicationStateChangedEventForPauseState:(BOOL)isPaused +{ + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + [self forwardUnityEventWithArgs: @{@"name": @"OnApplicationStateChanged", + @"isPaused": @(isPaused)}]; + }); +} + - (MAAd *)adWithAdUnitIdentifier:(NSString *)adUnitIdentifier { @synchronized ( self.adInfoDictLock ) diff --git a/MaxSdk/AppLovin/Plugins/iOS/MAUnityPlugin.mm b/MaxSdk/AppLovin/Plugins/iOS/MAUnityPlugin.mm index edac38f..7ca2561 100644 --- a/MaxSdk/AppLovin/Plugins/iOS/MAUnityPlugin.mm +++ b/MaxSdk/AppLovin/Plugins/iOS/MAUnityPlugin.mm @@ -15,13 +15,13 @@ @property (assign, readonly, getter=al_isValidString) BOOL al_validString; @end -UIView* UnityGetGLView(); - // When native code plugin is implemented in .mm / .cpp file, then functions // should be surrounded with extern "C" block to conform C function naming rules extern "C" { static NSString *const TAG = @"MAUnityPlugin"; + + UIView* UnityGetGLView(); static ALSdk *_sdk; static MAUnityAdManager *_adManager; @@ -52,6 +52,18 @@ extern "C" static const char * cStringCopy(NSString *string); // Helper method to log errors void logUninitializedAccessError(const char *callingMethod); + + int getConsentStatusValue(NSNumber *consentStatus) + { + if ( consentStatus ) + { + return consentStatus.intValue; + } + else + { + return -1; + } + } bool isPluginInitialized() { @@ -345,7 +357,7 @@ extern "C" void _MaxShowConsentDialog() { - NSLog(@"[%@] Failed to show consent dialog - Unavailable on iOS, please use the consent flow: https://dash.applovin.com/documentation/mediation/unity/getting-started/consent-flow", TAG); + NSLog(@"[%@] Failed to show consent dialog - Unavailable on iOS, please use the consent flow: https://developers.applovin.com/en/unity/overview/terms-and-privacy-policy-flow", TAG); } int _MaxConsentDialogState() @@ -785,51 +797,6 @@ extern "C" return cStringCopy([_adManager mrecLayoutForAdUnitIdentifier: NSSTRING(adUnitIdentifier)]); } - - void _MaxCreateCrossPromoAd(const char *adUnitIdentifier, const float x, const float y, const float width, const float height, const float rotation) - { - if (!isPluginInitialized()) return; - - [_adManager createCrossPromoAdWithAdUnitIdentifier: NSSTRING(adUnitIdentifier) x: x y: y width: width height: height rotation: rotation]; - } - - void _MaxSetCrossPromoAdPlacement(const char *adUnitIdentifier, const char *placement) - { - [_adManager setCrossPromoAdPlacement: NSSTRING(placement) forAdUnitIdentifier: NSSTRING(adUnitIdentifier)]; - } - - void _MaxUpdateCrossPromoAdPosition(const char *adUnitIdentifier, const float x, const float y, const float width, const float height, const float rotation) - { - [_adManager updateCrossPromoAdPositionForAdUnitIdentifier: NSSTRING(adUnitIdentifier) x: x y: y width: width height: height rotation: rotation]; - } - - void _MaxShowCrossPromoAd(const char *adUnitIdentifier) - { - if (!isPluginInitialized()) return; - - [_adManager showCrossPromoAdWithAdUnitIdentifier: NSSTRING(adUnitIdentifier)]; - } - - void _MaxDestroyCrossPromoAd(const char *adUnitIdentifier) - { - if (!isPluginInitialized()) return; - - [_adManager destroyCrossPromoAdWithAdUnitIdentifier: NSSTRING(adUnitIdentifier)]; - } - - void _MaxHideCrossPromoAd(const char *adUnitIdentifier) - { - if (!isPluginInitialized()) return; - - [_adManager hideCrossPromoAdWithAdUnitIdentifier: NSSTRING(adUnitIdentifier)]; - } - - const char * _MaxGetCrossPromoAdLayout(const char *adUnitIdentifier) - { - if (!isPluginInitialized()) return cStringCopy(@""); - - return cStringCopy([_adManager crossPromoAdLayoutForAdUnitIdentifier: NSSTRING(adUnitIdentifier)]); - } void _MaxLoadInterstitial(const char *adUnitIdentifier) { @@ -1060,30 +1027,28 @@ extern "C" return !ALUtils.simulator; } - int _MaxGetTcfConsentStatus(int vendorIdentifier) + int _MaxGetTcfVendorConsentStatus(int vendorIdentifier) { - NSNumber *consentStatus = [ALUtils tcfConsentStatusForVendorIdentifier: vendorIdentifier]; - if ( consentStatus ) - { - return consentStatus.intValue; - } - else - { - return -1; - } + NSNumber *consentStatus = [ALPrivacySettings tcfVendorConsentStatusForIdentifier: vendorIdentifier]; + return getConsentStatusValue(consentStatus); } int _MaxGetAdditionalConsentStatus(int atpIdentifier) { - NSNumber *consentStatus = [ALUtils additionalConsentStatusForATPIdentifier: atpIdentifier]; - if ( consentStatus ) - { - return consentStatus.intValue; - } - else - { - return -1; - } + NSNumber *consentStatus = [ALPrivacySettings additionalConsentStatusForIdentifier: atpIdentifier]; + return getConsentStatusValue(consentStatus); + } + + int _MaxGetPurposeConsentStatus(int purposeIdentifier) + { + NSNumber *consentStatus = [ALPrivacySettings purposeConsentStatusForIdentifier: purposeIdentifier]; + return getConsentStatusValue(consentStatus); + } + + int _MaxGetSpecialFeatureOptInStatus(int specialFeatureIdentifier) + { + NSNumber *consentStatus = [ALPrivacySettings specialFeatureOptInStatusForIdentifier: specialFeatureIdentifier]; + return getConsentStatusValue(consentStatus); } static const char * cStringCopy(NSString *string) @@ -1229,6 +1194,13 @@ extern "C" } } } + + int * _MaxGetSafeAreaInsets() + { + UIEdgeInsets safeAreaInsets = UnityGetGLView().safeAreaInsets; + static int insets[4] = {(int) safeAreaInsets.left, (int) safeAreaInsets.top, (int) safeAreaInsets.right, (int) safeAreaInsets.bottom}; + return insets; + } void _MaxShowCmpForExistingUser() { diff --git a/MaxSdk/Mediation b/MaxSdk/Mediation new file mode 120000 index 0000000..0315c00 --- /dev/null +++ b/MaxSdk/Mediation @@ -0,0 +1 @@ +../Mediation \ No newline at end of file diff --git a/MaxSdk/Scripts/Editor.meta b/MaxSdk/Mediation.meta similarity index 64% rename from MaxSdk/Scripts/Editor.meta rename to MaxSdk/Mediation.meta index 7adfefb..8d173aa 100644 --- a/MaxSdk/Scripts/Editor.meta +++ b/MaxSdk/Mediation.meta @@ -1,8 +1,8 @@ fileFormatVersion: 2 -guid: b6903b66cb8984df289e6d66f9c52ddc +guid: b49a3a3626ac24d289ced4c76184be8d labels: - al_max -- al_max_export_path-MaxSdk/Scripts/Editor +- al_max_export_path-MaxSdk/Mediation folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/MaxSdk/Scripts/Editor/MaxPostProcessBuildiOS.cs b/MaxSdk/Scripts/Editor/MaxPostProcessBuildiOS.cs deleted file mode 100644 index 816c336..0000000 --- a/MaxSdk/Scripts/Editor/MaxPostProcessBuildiOS.cs +++ /dev/null @@ -1,590 +0,0 @@ -// -// MaxPostProcessBuildiOS.cs -// AppLovin MAX Unity Plugin -// -// Created by Santosh Bagadi on 8/5/20. -// Copyright © 2020 AppLovin. All rights reserved. -// - -#if UNITY_IOS || UNITY_IPHONE - -using AppLovinMax.Scripts.IntegrationManager.Editor; -#if UNITY_2019_3_OR_NEWER -using UnityEditor.iOS.Xcode.Extensions; -#endif -using UnityEngine.Networking; -using System; -using System.Linq; -using System.Collections.Generic; -using System.IO; -using UnityEditor; -using UnityEditor.Callbacks; -using UnityEditor.iOS.Xcode; -using UnityEngine; - -namespace AppLovinMax.Scripts.Editor -{ - [Serializable] - public class SkAdNetworkData - { - [SerializeField] public string[] SkAdNetworkIds; - } - - public class MaxPostProcessBuildiOS - { -#if !UNITY_2019_3_OR_NEWER - private const string UnityMainTargetName = "Unity-iPhone"; -#endif - private const string TargetUnityIphonePodfileLine = "target 'Unity-iPhone' do"; - private const string LegacyResourcesDirectoryName = "Resources"; - private const string AppLovinMaxResourcesDirectoryName = "AppLovinMAXResources"; - private const string AppLovinAdvertisingAttributionEndpoint = "https://postbacks-app.com"; - - private const string AppLovinSettingsPlistFileName = "AppLovin-Settings.plist"; - private const string KeyConsentFlowInfo = "ConsentFlowInfo"; - private const string KeyConsentFlowEnabled = "ConsentFlowEnabled"; - private const string KeyConsentFlowTermsOfService = "ConsentFlowTermsOfService"; - private const string KeyConsentFlowPrivacyPolicy = "ConsentFlowPrivacyPolicy"; - private const string KeyConsentFlowDebugUserGeography = "ConsentFlowDebugUserGeography"; - - private static readonly List DynamicLibrariesToEmbed = new List - { - "DTBiOSSDK.xcframework", - "FBAEMKit.xcframework", - "FBSDKCoreKit_Basics.xcframework", - "FBSDKCoreKit.xcframework", - "FBSDKGamingServicesKit.xcframework", - "FBSDKLoginKit.xcframework", - "FBSDKShareKit.xcframework", - "HyprMX.xcframework", - "LinkedinAudienceNetwork.xcframework", - "IASDKCore.xcframework", - "Maio.xcframework", - "MobileFuseSDK.xcframework", - "OMSDK_Appodeal.xcframework", - "OMSDK_Ogury.xcframework", - "OMSDK_Pubnativenet.xcframework", - "OMSDK_Smaato.xcframework" - }; - - private static string PluginMediationDirectory - { - get - { - var pluginParentDir = AppLovinIntegrationManager.MediationSpecificPluginParentDirectory; - return Path.Combine(pluginParentDir, "MaxSdk/Mediation/"); - } - } - - [PostProcessBuildAttribute(int.MaxValue)] - public static void MaxPostProcessPbxProject(BuildTarget buildTarget, string buildPath) - { - var projectPath = PBXProject.GetPBXProjectPath(buildPath); - var project = new PBXProject(); - project.ReadFromFile(projectPath); - -#if UNITY_2019_3_OR_NEWER - var unityMainTargetGuid = project.GetUnityMainTargetGuid(); - var unityFrameworkTargetGuid = project.GetUnityFrameworkTargetGuid(); -#else - var unityMainTargetGuid = project.TargetGuidByName(UnityMainTargetName); - var unityFrameworkTargetGuid = project.TargetGuidByName(UnityMainTargetName); -#endif - EmbedDynamicLibrariesIfNeeded(buildPath, project, unityMainTargetGuid); - - var internalSettingsEnabled = AppLovinInternalSettings.Instance.ConsentFlowEnabled; - var userTrackingUsageDescriptionDe = internalSettingsEnabled ? AppLovinInternalSettings.Instance.UserTrackingUsageDescriptionDe : AppLovinSettings.Instance.UserTrackingUsageDescriptionDe; - LocalizeUserTrackingDescriptionIfNeeded(userTrackingUsageDescriptionDe, "de", buildPath, project, unityMainTargetGuid); - var userTrackingUsageDescriptionEn = internalSettingsEnabled ? AppLovinInternalSettings.Instance.UserTrackingUsageDescriptionEn : AppLovinSettings.Instance.UserTrackingUsageDescriptionEn; - LocalizeUserTrackingDescriptionIfNeeded(userTrackingUsageDescriptionEn, "en", buildPath, project, unityMainTargetGuid); - var userTrackingUsageDescriptionEs = internalSettingsEnabled ? AppLovinInternalSettings.Instance.UserTrackingUsageDescriptionEs : AppLovinSettings.Instance.UserTrackingUsageDescriptionEs; - LocalizeUserTrackingDescriptionIfNeeded(userTrackingUsageDescriptionEs, "es", buildPath, project, unityMainTargetGuid); - var userTrackingUsageDescriptionFr = internalSettingsEnabled ? AppLovinInternalSettings.Instance.UserTrackingUsageDescriptionFr : AppLovinSettings.Instance.UserTrackingUsageDescriptionFr; - LocalizeUserTrackingDescriptionIfNeeded(userTrackingUsageDescriptionFr, "fr", buildPath, project, unityMainTargetGuid); - var userTrackingUsageDescriptionJa = internalSettingsEnabled ? AppLovinInternalSettings.Instance.UserTrackingUsageDescriptionJa : AppLovinSettings.Instance.UserTrackingUsageDescriptionJa; - LocalizeUserTrackingDescriptionIfNeeded(userTrackingUsageDescriptionJa, "ja", buildPath, project, unityMainTargetGuid); - var userTrackingUsageDescriptionKo = internalSettingsEnabled ? AppLovinInternalSettings.Instance.UserTrackingUsageDescriptionKo : AppLovinSettings.Instance.UserTrackingUsageDescriptionKo; - LocalizeUserTrackingDescriptionIfNeeded(userTrackingUsageDescriptionKo, "ko", buildPath, project, unityMainTargetGuid); - var userTrackingUsageDescriptionZhHans = internalSettingsEnabled ? AppLovinInternalSettings.Instance.UserTrackingUsageDescriptionZhHans : AppLovinSettings.Instance.UserTrackingUsageDescriptionZhHans; - LocalizeUserTrackingDescriptionIfNeeded(userTrackingUsageDescriptionZhHans, "zh-Hans", buildPath, project, unityMainTargetGuid); - var userTrackingUsageDescriptionZhHant = internalSettingsEnabled ? AppLovinInternalSettings.Instance.UserTrackingUsageDescriptionZhHant : AppLovinSettings.Instance.UserTrackingUsageDescriptionZhHant; - LocalizeUserTrackingDescriptionIfNeeded(userTrackingUsageDescriptionZhHant, "zh-Hant", buildPath, project, unityMainTargetGuid); - - AddSwiftSupport(buildPath, project, unityFrameworkTargetGuid, unityMainTargetGuid); - AddYandexSettingsIfNeeded(project, unityMainTargetGuid); - - project.WriteToFile(projectPath); - } - - private static void EmbedDynamicLibrariesIfNeeded(string buildPath, PBXProject project, string targetGuid) - { - // Check that the Pods directory exists (it might not if a publisher is building with Generate Podfile setting disabled in EDM). - var podsDirectory = Path.Combine(buildPath, "Pods"); - if (!Directory.Exists(podsDirectory)) return; - - var dynamicLibraryPathsPresentInProject = new List(); - foreach (var dynamicLibraryToSearch in DynamicLibrariesToEmbed) - { - // both .framework and .xcframework are directories, not files - var directories = Directory.GetDirectories(podsDirectory, dynamicLibraryToSearch, SearchOption.AllDirectories); - if (directories.Length <= 0) continue; - - var dynamicLibraryAbsolutePath = directories[0]; - var index = dynamicLibraryAbsolutePath.LastIndexOf("Pods"); - var relativePath = dynamicLibraryAbsolutePath.Substring(index); - dynamicLibraryPathsPresentInProject.Add(relativePath); - } - - if (dynamicLibraryPathsPresentInProject.Count <= 0) return; - -#if UNITY_2019_3_OR_NEWER - // Embed framework only if the podfile does not contain target `Unity-iPhone`. - if (!ContainsUnityIphoneTargetInPodfile(buildPath)) - { - foreach (var dynamicLibraryPath in dynamicLibraryPathsPresentInProject) - { - var fileGuid = project.AddFile(dynamicLibraryPath, dynamicLibraryPath); - project.AddFileToEmbedFrameworks(targetGuid, fileGuid); - } - } -#else - string runpathSearchPaths; - runpathSearchPaths = project.GetBuildPropertyForAnyConfig(targetGuid, "LD_RUNPATH_SEARCH_PATHS"); - runpathSearchPaths += string.IsNullOrEmpty(runpathSearchPaths) ? "" : " "; - - // Check if runtime search paths already contains the required search paths for dynamic libraries. - if (runpathSearchPaths.Contains("@executable_path/Frameworks")) return; - - runpathSearchPaths += "@executable_path/Frameworks"; - project.SetBuildProperty(targetGuid, "LD_RUNPATH_SEARCH_PATHS", runpathSearchPaths); -#endif - } - - private static void LocalizeUserTrackingDescriptionIfNeeded(string localizedUserTrackingDescription, string localeCode, string buildPath, PBXProject project, string targetGuid) - { - // Use the legacy resources directory name if the build is being appended (the "Resources" directory already exists if it is an incremental build). - var resourcesDirectoryName = Directory.Exists(Path.Combine(buildPath, LegacyResourcesDirectoryName)) ? LegacyResourcesDirectoryName : AppLovinMaxResourcesDirectoryName; - var resourcesDirectoryPath = Path.Combine(buildPath, resourcesDirectoryName); - var localeSpecificDirectoryName = localeCode + ".lproj"; - var localeSpecificDirectoryPath = Path.Combine(resourcesDirectoryPath, localeSpecificDirectoryName); - var infoPlistStringsFilePath = Path.Combine(localeSpecificDirectoryPath, "InfoPlist.strings"); - - // Check if localization has been disabled between builds, and remove them as needed. - if (ShouldRemoveLocalization(localizedUserTrackingDescription)) - { - if (!File.Exists(infoPlistStringsFilePath)) return; - - File.Delete(infoPlistStringsFilePath); - return; - } - - // Create intermediate directories as needed. - if (!Directory.Exists(resourcesDirectoryPath)) - { - Directory.CreateDirectory(resourcesDirectoryPath); - } - - if (!Directory.Exists(localeSpecificDirectoryPath)) - { - Directory.CreateDirectory(localeSpecificDirectoryPath); - } - - var localizedDescriptionLine = "\"NSUserTrackingUsageDescription\" = \"" + localizedUserTrackingDescription + "\";\n"; - // File already exists, update it in case the value changed between builds. - if (File.Exists(infoPlistStringsFilePath)) - { - var output = new List(); - var lines = File.ReadAllLines(infoPlistStringsFilePath); - var keyUpdated = false; - foreach (var line in lines) - { - if (line.Contains("NSUserTrackingUsageDescription")) - { - output.Add(localizedDescriptionLine); - keyUpdated = true; - } - else - { - output.Add(line); - } - } - - if (!keyUpdated) - { - output.Add(localizedDescriptionLine); - } - - File.WriteAllText(infoPlistStringsFilePath, string.Join("\n", output.ToArray()) + "\n"); - } - // File doesn't exist, create one. - else - { - File.WriteAllText(infoPlistStringsFilePath, "/* Localized versions of Info.plist keys - Generated by AL MAX plugin */\n" + localizedDescriptionLine); - } - - var localeSpecificDirectoryRelativePath = Path.Combine(resourcesDirectoryName, localeSpecificDirectoryName); - var guid = project.AddFolderReference(localeSpecificDirectoryRelativePath, localeSpecificDirectoryRelativePath); - project.AddFileToBuild(targetGuid, guid); - } - - private static bool ShouldRemoveLocalization(string localizedUserTrackingDescription) - { - if (string.IsNullOrEmpty(localizedUserTrackingDescription)) return true; - - var settings = AppLovinSettings.Instance; - var internalSettings = AppLovinInternalSettings.Instance; - - return (!internalSettings.ConsentFlowEnabled || !internalSettings.UserTrackingUsageLocalizationEnabled) - && !settings.ConsentFlowEnabled || !settings.UserTrackingUsageLocalizationEnabled; - } - - private static void AddSwiftSupport(string buildPath, PBXProject project, string unityFrameworkTargetGuid, string unityMainTargetGuid) - { - var swiftFileRelativePath = "Classes/MAXSwiftSupport.swift"; - var swiftFilePath = Path.Combine(buildPath, swiftFileRelativePath); - - // Add Swift file - CreateSwiftFile(swiftFilePath); - var swiftFileGuid = project.AddFile(swiftFileRelativePath, swiftFileRelativePath, PBXSourceTree.Source); - project.AddFileToBuild(unityFrameworkTargetGuid, swiftFileGuid); - - // Add Swift version property if needed - var swiftVersion = project.GetBuildPropertyForAnyConfig(unityFrameworkTargetGuid, "SWIFT_VERSION"); - if (string.IsNullOrEmpty(swiftVersion)) - { - project.SetBuildProperty(unityFrameworkTargetGuid, "SWIFT_VERSION", "5.0"); - } - - // Enable Swift modules - project.AddBuildProperty(unityFrameworkTargetGuid, "CLANG_ENABLE_MODULES", "YES"); - project.AddBuildProperty(unityMainTargetGuid, "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES", "YES"); - } - - private static void CreateSwiftFile(string swiftFilePath) - { - if (File.Exists(swiftFilePath)) return; - - // Create a file to write to. - using (var writer = File.CreateText(swiftFilePath)) - { - writer.WriteLine("//\n// MAXSwiftSupport.swift\n//"); - writer.WriteLine("\nimport Foundation\n"); - writer.WriteLine("// This file ensures the project includes Swift support."); - writer.WriteLine("// It is automatically generated by the MAX Unity Plugin."); - writer.Close(); - } - } - - [PostProcessBuildAttribute(int.MaxValue)] - public static void MaxPostProcessPlist(BuildTarget buildTarget, string path) - { - var plistPath = Path.Combine(path, "Info.plist"); - var plist = new PlistDocument(); - plist.ReadFromFile(plistPath); - - SetSdkKeyIfNeeded(plist); - SetAttributionReportEndpointIfNeeded(plist); - - EnableVerboseLoggingIfNeeded(plist); - AddGoogleApplicationIdIfNeeded(plist); - - AddSdkSettingsIfNeeded(plist, path); - EnableTermsFlowIfNeeded(plist); - AddSkAdNetworksInfoIfNeeded(plist); - - plist.WriteToFile(plistPath); - } - - private static void SetSdkKeyIfNeeded(PlistDocument plist) - { - var sdkKey = AppLovinSettings.Instance.SdkKey; - if (string.IsNullOrEmpty(sdkKey)) return; - - const string AppLovinVerboseLoggingOnKey = "AppLovinSdkKey"; - plist.root.SetString(AppLovinVerboseLoggingOnKey, sdkKey); - } - - private static void SetAttributionReportEndpointIfNeeded(PlistDocument plist) - { - if (AppLovinSettings.Instance.SetAttributionReportEndpoint) - { - plist.root.SetString("NSAdvertisingAttributionReportEndpoint", AppLovinAdvertisingAttributionEndpoint); - } - else - { - PlistElement attributionReportEndPoint; - plist.root.values.TryGetValue("NSAdvertisingAttributionReportEndpoint", out attributionReportEndPoint); - - // Check if we had previously set the attribution endpoint and un-set it. - if (attributionReportEndPoint != null && AppLovinAdvertisingAttributionEndpoint.Equals(attributionReportEndPoint.AsString())) - { - plist.root.values.Remove("NSAdvertisingAttributionReportEndpoint"); - } - } - } - - private static void EnableVerboseLoggingIfNeeded(PlistDocument plist) - { - if (!EditorPrefs.HasKey(MaxSdkLogger.KeyVerboseLoggingEnabled)) return; - - var enabled = EditorPrefs.GetBool(MaxSdkLogger.KeyVerboseLoggingEnabled); - const string AppLovinVerboseLoggingOnKey = "AppLovinVerboseLoggingOn"; - if (enabled) - { - plist.root.SetBoolean(AppLovinVerboseLoggingOnKey, enabled); - } - else - { - plist.root.values.Remove(AppLovinVerboseLoggingOnKey); - } - } - - private static void AddGoogleApplicationIdIfNeeded(PlistDocument plist) - { - if (!AppLovinIntegrationManager.IsAdapterInstalled("Google") && !AppLovinIntegrationManager.IsAdapterInstalled("GoogleAdManager")) return; - - const string googleApplicationIdentifier = "GADApplicationIdentifier"; - var appId = AppLovinSettings.Instance.AdMobIosAppId; - // Log error if the App ID is not set. - if (string.IsNullOrEmpty(appId) || !appId.StartsWith("ca-app-pub-")) - { - Debug.LogError("[AppLovin MAX] Google App ID is not set. Please enter a valid app ID within the AppLovin Integration Manager window."); - return; - } - - plist.root.SetString(googleApplicationIdentifier, appId); - } - - private static void AddYandexSettingsIfNeeded(PBXProject project, string unityMainTargetGuid) - { - if (!AppLovinIntegrationManager.IsAdapterInstalled("Yandex")) return; - - if (MaxSdkUtils.CompareVersions(PlayerSettings.iOS.targetOSVersionString, "12.0") == MaxSdkUtils.VersionComparisonResult.Lesser) - { - Debug.LogWarning("Your iOS target version is under the minimum required version by Yandex. Please update it to 12.0 or newer in your ProjectSettings and rebuild your project."); - return; - } - - project.SetBuildProperty(unityMainTargetGuid, "GENERATE_INFOPLIST_FILE", "NO"); - } - - private static void AddSdkSettingsIfNeeded(PlistDocument infoPlist, string buildPath) - { - // Right now internal settings is only needed for Consent Flow. Remove this setting once we add more settings. - if (!AppLovinInternalSettings.Instance.ConsentFlowEnabled) return; - - var sdkSettingsPlistPath = Path.Combine(buildPath, AppLovinSettingsPlistFileName); - var sdkSettingsPlist = new PlistDocument(); - if (File.Exists(sdkSettingsPlistPath)) - { - sdkSettingsPlist.ReadFromFile(sdkSettingsPlistPath); - } - - EnableConsentFlowIfNeeded(sdkSettingsPlist, infoPlist); - - sdkSettingsPlist.WriteToFile(sdkSettingsPlistPath); - - var projectPath = PBXProject.GetPBXProjectPath(buildPath); - var project = new PBXProject(); - project.ReadFromFile(projectPath); - -#if UNITY_2019_3_OR_NEWER - var unityMainTargetGuid = project.GetUnityMainTargetGuid(); -#else - var unityMainTargetGuid = project.TargetGuidByName(UnityMainTargetName); -#endif - - var guid = project.AddFile(AppLovinSettingsPlistFileName, AppLovinSettingsPlistFileName, PBXSourceTree.Source); - project.AddFileToBuild(unityMainTargetGuid, guid); - project.WriteToFile(projectPath); - } - - private static void EnableConsentFlowIfNeeded(PlistDocument applovinSettingsPlist, PlistDocument infoPlist) - { - var consentFlowEnabled = AppLovinInternalSettings.Instance.ConsentFlowEnabled; - var userTrackingUsageDescription = AppLovinInternalSettings.Instance.UserTrackingUsageDescriptionEn; - var privacyPolicyUrl = AppLovinInternalSettings.Instance.ConsentFlowPrivacyPolicyUrl; - if (string.IsNullOrEmpty(userTrackingUsageDescription) || string.IsNullOrEmpty(privacyPolicyUrl)) - { - AppLovinIntegrationManager.ShowBuildFailureDialog("You cannot use the AppLovin SDK's consent flow without defining a Privacy Policy URL and the `User Tracking Usage Description` in the AppLovin Integration Manager. \n\n" + - "Both values must be included to enable the SDK's consent flow."); - - // No need to update the info.plist here. Default consent flow state will be determined on the SDK side. - return; - } - - var consentFlowInfoRoot = applovinSettingsPlist.root.CreateDict(KeyConsentFlowInfo); - consentFlowInfoRoot.SetBoolean(KeyConsentFlowEnabled, consentFlowEnabled); - consentFlowInfoRoot.SetString(KeyConsentFlowPrivacyPolicy, privacyPolicyUrl); - - var termsOfServiceUrl = AppLovinInternalSettings.Instance.ConsentFlowTermsOfServiceUrl; - if (MaxSdkUtils.IsValidString(termsOfServiceUrl)) - { - consentFlowInfoRoot.SetString(KeyConsentFlowTermsOfService, termsOfServiceUrl); - } - - var debugUserGeography = AppLovinInternalSettings.Instance.DebugUserGeography; - if (debugUserGeography == MaxSdkBase.ConsentFlowUserGeography.Gdpr) - { - consentFlowInfoRoot.SetString(KeyConsentFlowDebugUserGeography, "gdpr"); - } - - infoPlist.root.SetString("NSUserTrackingUsageDescription", userTrackingUsageDescription); - } - - private static void EnableTermsFlowIfNeeded(PlistDocument plist) - { - // Check if terms flow is enabled. No need to update info.plist if consent flow is disabled. - var consentFlowEnabled = AppLovinSettings.Instance.ConsentFlowEnabled; - if (!consentFlowEnabled) return; - - // Check if terms flow is enabled for this format. - var consentFlowPlatform = AppLovinSettings.Instance.ConsentFlowPlatform; - if (consentFlowPlatform != Platform.All && consentFlowPlatform != Platform.iOS) return; - - var userTrackingUsageDescription = AppLovinSettings.Instance.UserTrackingUsageDescriptionEn; - var privacyPolicyUrl = AppLovinSettings.Instance.ConsentFlowPrivacyPolicyUrl; - if (string.IsNullOrEmpty(userTrackingUsageDescription) || string.IsNullOrEmpty(privacyPolicyUrl)) - { - AppLovinIntegrationManager.ShowBuildFailureDialog("You cannot use the AppLovin SDK's consent flow without defining a Privacy Policy URL and the `User Tracking Usage Description` in the AppLovin Integration Manager. \n\n" + - "Both values must be included to enable the SDK's consent flow."); - - // No need to update the info.plist here. Default consent flow state will be determined on the SDK side. - return; - } - - var consentFlowInfoRoot = plist.root.CreateDict("AppLovinConsentFlowInfo"); - consentFlowInfoRoot.SetBoolean("AppLovinConsentFlowEnabled", consentFlowEnabled); - consentFlowInfoRoot.SetString("AppLovinConsentFlowPrivacyPolicy", privacyPolicyUrl); - - var termsOfServiceUrl = AppLovinSettings.Instance.ConsentFlowTermsOfServiceUrl; - if (!string.IsNullOrEmpty(termsOfServiceUrl)) - { - consentFlowInfoRoot.SetString("AppLovinConsentFlowTermsOfService", termsOfServiceUrl); - } - - plist.root.SetString("NSUserTrackingUsageDescription", userTrackingUsageDescription); - } - - private static void AddSkAdNetworksInfoIfNeeded(PlistDocument plist) - { - var skAdNetworkData = GetSkAdNetworkData(); - var skAdNetworkIds = skAdNetworkData.SkAdNetworkIds; - // Check if we have a valid list of SKAdNetworkIds that need to be added. - if (skAdNetworkIds == null || skAdNetworkIds.Length < 1) return; - - // - // Add the SKAdNetworkItems to the plist. It should look like following: - // - // SKAdNetworkItems - // - // - // SKAdNetworkIdentifier - // ABC123XYZ.skadnetwork - // - // - // SKAdNetworkIdentifier - // 123QWE456.skadnetwork - // - // - // SKAdNetworkIdentifier - // 987XYZ123.skadnetwork - // - // - // - PlistElement skAdNetworkItems; - plist.root.values.TryGetValue("SKAdNetworkItems", out skAdNetworkItems); - var existingSkAdNetworkIds = new HashSet(); - // Check if SKAdNetworkItems array is already in the Plist document and collect all the IDs that are already present. - if (skAdNetworkItems != null && skAdNetworkItems.GetType() == typeof(PlistElementArray)) - { - var plistElementDictionaries = skAdNetworkItems.AsArray().values.Where(plistElement => plistElement.GetType() == typeof(PlistElementDict)); - foreach (var plistElement in plistElementDictionaries) - { - PlistElement existingId; - plistElement.AsDict().values.TryGetValue("SKAdNetworkIdentifier", out existingId); - if (existingId == null || existingId.GetType() != typeof(PlistElementString) || string.IsNullOrEmpty(existingId.AsString())) continue; - - existingSkAdNetworkIds.Add(existingId.AsString()); - } - } - // Else, create an array of SKAdNetworkItems into which we will add our IDs. - else - { - skAdNetworkItems = plist.root.CreateArray("SKAdNetworkItems"); - } - - foreach (var skAdNetworkId in skAdNetworkIds) - { - // Skip adding IDs that are already in the array. - if (existingSkAdNetworkIds.Contains(skAdNetworkId)) continue; - - var skAdNetworkItemDict = skAdNetworkItems.AsArray().AddDict(); - skAdNetworkItemDict.SetString("SKAdNetworkIdentifier", skAdNetworkId); - } - } - - private static SkAdNetworkData GetSkAdNetworkData() - { - var uriBuilder = new UriBuilder("https://unity.applovin.com/max/1.0/skadnetwork_ids"); - - // Get the list of installed ad networks to be passed up - var maxMediationDirectory = PluginMediationDirectory; - if (Directory.Exists(maxMediationDirectory)) - { - var mediationNetworkDirectories = Directory.GetDirectories(maxMediationDirectory); - var installedNetworks = mediationNetworkDirectories.Select(Path.GetFileName).ToList(); - if (AppLovinSettings.Instance.AddApsSkAdNetworkIds) - { - installedNetworks.Add("AmazonPublisherServices"); - } - - var adNetworks = string.Join(",", installedNetworks.ToArray()); - if (!string.IsNullOrEmpty(adNetworks)) - { - uriBuilder.Query += string.Format("ad_networks={0}", adNetworks); - } - } - - using (var unityWebRequest = UnityWebRequest.Get(uriBuilder.ToString())) - { - var operation = unityWebRequest.SendWebRequest(); - // Wait for the download to complete or the request to timeout. - while (!operation.isDone) { } - -#if UNITY_2020_1_OR_NEWER - if (unityWebRequest.result != UnityWebRequest.Result.Success) -#else - if (unityWebRequest.isNetworkError || unityWebRequest.isHttpError) -#endif - { - MaxSdkLogger.UserError("Failed to retrieve SKAdNetwork IDs with error: " + unityWebRequest.error); - return new SkAdNetworkData(); - } - - try - { - return JsonUtility.FromJson(unityWebRequest.downloadHandler.text); - } - catch (Exception exception) - { - MaxSdkLogger.UserError("Failed to parse data '" + unityWebRequest.downloadHandler.text + "' with exception: " + exception); - return new SkAdNetworkData(); - } - } - } - -#if UNITY_2019_3_OR_NEWER - private static bool ContainsUnityIphoneTargetInPodfile(string buildPath) - { - var podfilePath = Path.Combine(buildPath, "Podfile"); - if (!File.Exists(podfilePath)) return false; - - var lines = File.ReadAllLines(podfilePath); - return lines.Any(line => line.Contains(TargetUnityIphonePodfileLine)); - } -#endif - } -} - -#endif diff --git a/MaxSdk/Scripts/Editor/MaxSdk.Scripts.Editor.asmdef b/MaxSdk/Scripts/Editor/MaxSdk.Scripts.Editor.asmdef deleted file mode 100644 index e4bb2e0..0000000 --- a/MaxSdk/Scripts/Editor/MaxSdk.Scripts.Editor.asmdef +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "MaxSdk.Scripts.Editor", - "references": [ - "MaxSdk.Scripts", - "MaxSdk.Scripts.IntegrationManager.Editor" - ], - "includePlatforms": [ - "Editor" - ], - "excludePlatforms": [] -} diff --git a/MaxSdk/Scripts/Editor/MaxSdk.Scripts.Editor.asmdef.meta b/MaxSdk/Scripts/Editor/MaxSdk.Scripts.Editor.asmdef.meta deleted file mode 100644 index b13c71a..0000000 --- a/MaxSdk/Scripts/Editor/MaxSdk.Scripts.Editor.asmdef.meta +++ /dev/null @@ -1,6 +0,0 @@ -fileFormatVersion: 2 -guid: 691e0eb4b7a542dba2219d48c3254f1c -labels: -- al_max -- al_max_export_path-MaxSdk/Scripts/Editor/MaxSdk.Scripts.Editor.asmdef -timeCreated: 1591749791 diff --git a/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinAutoUpdater.cs b/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinAutoUpdater.cs index 2b3e87b..c1e8ed3 100644 --- a/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinAutoUpdater.cs +++ b/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinAutoUpdater.cs @@ -26,7 +26,6 @@ namespace AppLovinMax.Scripts.IntegrationManager.Editor // TODO: Make this list dynamic. public static readonly Dictionary MinAdapterVersions = new Dictionary() { - {"ADCOLONY_NETWORK", "android_4.2.3.1_ios_4.3.1.1"}, {"ADMOB_NETWORK", "android_19.3.0.3_ios_7.65.0.0"}, {"CHARTBOOST_NETWORK", "android_8.1.0.7_ios_8.2.1.3"}, {"FACEBOOK_MEDIATE", "android_6.0.0.1_ios_6.0.0.3"}, @@ -38,7 +37,6 @@ namespace AppLovinMax.Scripts.IntegrationManager.Editor {"SMAATO_NETWORK", "android_21.5.2.5_ios_21.5.2.3"}, {"TIKTOK_NETWORK", "android_3.1.0.1.6_ios_3.2.5.1.1"}, {"UNITY_NETWORK", "android_3.4.8.2_ios_3.4.8.2"}, - {"VERIZON_NETWORK", "android_1.6.0.5_ios_1.7.1.1"}, {"VUNGLE_NETWORK", "android_6.7.1.2_ios_6.7.1.3"}, {"YANDEX_NETWORK", "android_2.170.2_ios_2.18.0.1"} }; diff --git a/MaxSdk/Scripts/Editor/MaxInitialization.cs b/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinInitialize.cs similarity index 93% rename from MaxSdk/Scripts/Editor/MaxInitialization.cs rename to MaxSdk/Scripts/IntegrationManager/Editor/AppLovinInitialize.cs index a1dc1df..4f61d97 100644 --- a/MaxSdk/Scripts/Editor/MaxInitialization.cs +++ b/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinInitialize.cs @@ -12,13 +12,16 @@ using System.IO; using System.Linq; using UnityEditor; -namespace AppLovinMax.Scripts.Editor +namespace AppLovinMax.Scripts.IntegrationManager.Editor { [InitializeOnLoad] - public class MaxInitialize + public class AppLovinInitialize { private static readonly List ObsoleteNetworks = new List { + "AdColony", + "Criteo", + "Nend", "Snap", "Tapjoy", "VerizonAds", @@ -27,6 +30,10 @@ namespace AppLovinMax.Scripts.Editor private static readonly List ObsoleteFileExportPathsToDelete = new List { + // The `MaxSdk/Scripts/Editor` folder contents have been moved into `MaxSdk/Scripts/IntegrationManager/Editor`. + "MaxSdk/Scripts/Editor", + "MaxSdk/Scripts/Editor.meta", + // The `EventSystemChecker` has been renamed to `MaxEventSystemChecker`. "MaxSdk/Scripts/EventSystemChecker.cs", "MaxSdk/Scripts/EventSystemChecker.cs.meta", @@ -54,7 +61,7 @@ namespace AppLovinMax.Scripts.Editor "MaxSdk/Mediation/GoogleAdManager/Editor/MaxSdk.Mediation.GoogleAdManager.Editor.asmdef.meta", "Plugins/Android/MaxMediationGoogleAdManager.androidlib", "Plugins/Android/MaxMediationGoogleAdManager.androidlib.meta", - + // The `VariableService` has been removed. "MaxSdk/Scripts/MaxVariableServiceAndroid.cs", "MaxSdk/Scripts/MaxVariableServiceAndroid.cs.meta", @@ -64,7 +71,7 @@ namespace AppLovinMax.Scripts.Editor "MaxSdk/Scripts/MaxVariableServiceUnityEditor.cs.meta" }; - static MaxInitialize() + static AppLovinInitialize() { #if UNITY_IOS // Check that the publisher is targeting iOS 9.0+ diff --git a/MaxSdk/Scripts/Editor/MaxPostProcessBuildiOS.cs.meta b/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinInitialize.cs.meta similarity index 64% rename from MaxSdk/Scripts/Editor/MaxPostProcessBuildiOS.cs.meta rename to MaxSdk/Scripts/IntegrationManager/Editor/AppLovinInitialize.cs.meta index 78d2f6d..fb8a55c 100644 --- a/MaxSdk/Scripts/Editor/MaxPostProcessBuildiOS.cs.meta +++ b/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinInitialize.cs.meta @@ -1,8 +1,8 @@ fileFormatVersion: 2 -guid: 29959b3cd36c484a9d57d6b7ca7f7bfa +guid: 6b7dce7fe193a4058bc51d9f4d3a2aed labels: - al_max -- al_max_export_path-MaxSdk/Scripts/Editor/MaxPostProcessBuildiOS.cs +- al_max_export_path-MaxSdk/Scripts/IntegrationManager/Editor/AppLovinInitialize.cs MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinIntegrationManager.cs b/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinIntegrationManager.cs index 3b1b9d9..1536e66 100644 --- a/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinIntegrationManager.cs +++ b/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinIntegrationManager.cs @@ -467,19 +467,37 @@ namespace AppLovinMax.Scripts.IntegrationManager.Editor /// Checks whether or not an adapter with the given version or newer exists. /// /// The name of the network (the root adapter folder name in "MaxSdk/Mediation/" folder. - /// The min adapter version to check for. Can be null if we want to check for any version. + /// The min adapter version to check for. Can be null if we want to check for any version. /// true if an adapter with the min version is installed. - public static bool IsAdapterInstalled(string adapterName, string version = null) + public static bool IsAdapterInstalled(string adapterName, string iosVersion = null) // TODO: Add Android version check. { var dependencyFilePath = MaxSdkUtils.GetAssetPathForExportPath("MaxSdk/Mediation/" + adapterName + "/Editor/Dependencies.xml"); if (!File.Exists(dependencyFilePath)) return false; // If version is null, we just need the adapter installed. We don't have to check for a specific version. - if (version == null) return true; + if (iosVersion == null) return true; - var currentVersion = AppLovinIntegrationManager.GetCurrentVersions(dependencyFilePath); - var iosVersionComparison = MaxSdkUtils.CompareVersions(currentVersion.Ios, version); - return iosVersionComparison != MaxSdkUtils.VersionComparisonResult.Lesser; + var currentVersion = GetCurrentVersions(dependencyFilePath); + var iosVersionComparison = MaxSdkUtils.CompareVersions(currentVersion.Ios, iosVersion); + return iosVersionComparison != VersionComparisonResult.Lesser; + } + + /// + /// Checks whether or not an adapter older than the given version exists. + /// + /// TODO: Consolidate this method with and return a state enum. + /// + /// The name of the network (the root adapter folder name in "MaxSdk/Mediation/" folder. + /// The adapter version to check for. + /// true if an adapter older than the provided version is installed. + public static bool IsAdapterOlderThanMinVersionInstalled(string adapterName, string iosVersion) // TODO: Add Android version check. + { + var dependencyFilePath = MaxSdkUtils.GetAssetPathForExportPath("MaxSdk/Mediation/" + adapterName + "/Editor/Dependencies.xml"); + if (!File.Exists(dependencyFilePath)) return false; + + var currentVersion = GetCurrentVersions(dependencyFilePath); + var iosVersionComparison = MaxSdkUtils.CompareVersions(currentVersion.Ios, iosVersion); + return iosVersionComparison == VersionComparisonResult.Lesser; } #region Utility Methods diff --git a/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinIntegrationManagerWindow.cs b/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinIntegrationManagerWindow.cs index 5c3f2d1..3071a8c 100644 --- a/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinIntegrationManagerWindow.cs +++ b/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinIntegrationManagerWindow.cs @@ -18,15 +18,13 @@ namespace AppLovinMax.Scripts.IntegrationManager.Editor { public class AppLovinIntegrationManagerWindow : EditorWindow { - private const string keyNewLocalizationsMarked = "com.applovin.new_localizations_marked_v0"; // Update the key version each time new localizations are added. - private const string windowTitle = "AppLovin Integration Manager"; private const string appLovinSdkKeyLink = "https://dash.applovin.com/o/account#keys"; private const string userTrackingUsageDescriptionDocsLink = "https://developer.apple.com/documentation/bundleresources/information_property_list/nsusertrackingusagedescription"; - private const string documentationTermsAndPrivacyPolicyFlow = "https://dash.applovin.com/documentation/mediation/ios/getting-started/terms-and-privacy-policy-flow"; - private const string documentationAdaptersLink = "https://dash.applovin.com/documentation/mediation/unity/mediation-adapters"; + private const string documentationTermsAndPrivacyPolicyFlow = "https://developers.applovin.com/en/unity/overview/terms-and-privacy-policy-flow"; + private const string documentationAdaptersLink = "https://developers.applovin.com/en/unity/preparing-mediated-networks"; private const string documentationNote = "Please ensure that integration instructions (e.g. permissions, ATS settings, etc) specific to each network are implemented as well. Click the link below for more info:"; private const string uninstallIconExportPath = "MaxSdk/Resources/Images/uninstall_icon.png"; private const string alertIconExportPath = "MaxSdk/Resources/Images/alert_icon.png"; @@ -35,6 +33,9 @@ namespace AppLovinMax.Scripts.IntegrationManager.Editor private const string qualityServiceRequiresGradleBuildErrorMsg = "AppLovin Quality Service integration via AppLovin Integration Manager requires Custom Gradle Template enabled or Unity 2018.2 or higher.\n" + "If you would like to continue using your existing setup, please add Quality Service Plugin to your build.gradle manually."; + private const string customGradleVersionTooltip = "To set the version to 6.9.3, set the field to: https://services.gradle.org/distributions/gradle-6.9.3-bin.zip"; + private const string customGradleToolsVersionTooltip = "To set the version to 4.2.0, set the field to: 4.2.0"; + private readonly string[] termsFlowPlatforms = new string[3] {"Both", "Android", "iOS"}; private readonly string[] debugUserGeographies = new string[2] {"Not Set", "GDPR"}; @@ -142,6 +143,26 @@ namespace AppLovinMax.Scripts.IntegrationManager.Editor } private void OnEnable() + { + // Script reloads can cause AppLovinSettings.Instance to be null for one frame, + // so we load the Integration Manager on the following frame + if (AppLovinSettings.Instance == null) + { + AppLovinEditorCoroutine.StartCoroutine(WaitForNextFrameForEnable()); + } + else + { + OnWindowEnabled(); + } + } + + private IEnumerator WaitForNextFrameForEnable() + { + yield return new WaitForEndOfFrame(); + OnWindowEnabled(); + } + + private void OnWindowEnabled() { AppLovinIntegrationManager.downloadPluginProgressCallback = OnDownloadPluginProgress; @@ -431,7 +452,7 @@ namespace AppLovinMax.Scripts.IntegrationManager.Editor private void DrawNetworkDetailRow(Network network) { string action; - var currentVersion = network.CurrentVersions.Unity; + var currentVersion = network.CurrentVersions != null ? network.CurrentVersions.Unity : ""; var latestVersion = network.LatestVersions.Unity; bool isActionEnabled; bool isInstalled; @@ -621,11 +642,12 @@ namespace AppLovinMax.Scripts.IntegrationManager.Editor GUILayout.EndHorizontal(); } - private string DrawTextField(string fieldTitle, string text, GUILayoutOption labelWidth, GUILayoutOption textFieldWidthOption = null, bool isTextFieldEditable = true) + private string DrawTextField(string fieldTitle, string text, GUILayoutOption labelWidth, GUILayoutOption textFieldWidthOption = null, bool isTextFieldEditable = true, string tooltip = "") { GUILayout.BeginHorizontal(); GUILayout.Space(4); - EditorGUILayout.LabelField(new GUIContent(fieldTitle), labelWidth); + var guiContent = MaxSdkUtils.IsValidString(tooltip) ? new GUIContent(fieldTitle, tooltip) : new GUIContent(fieldTitle); + EditorGUILayout.LabelField(guiContent, labelWidth); GUILayout.Space(4); if (isTextFieldEditable) { @@ -687,6 +709,7 @@ namespace AppLovinMax.Scripts.IntegrationManager.Editor AppLovinInternalSettings.Instance.ConsentFlowEnabled = true; AppLovinSettings.Instance.ConsentFlowEnabled = false; } + GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); GUILayout.Space(4); @@ -750,7 +773,6 @@ namespace AppLovinMax.Scripts.IntegrationManager.Editor Application.OpenURL(userTrackingUsageDescriptionDocsLink); } - GUILayout.Space(4); GUILayout.EndHorizontal(); GUILayout.Space(4); @@ -782,6 +804,7 @@ namespace AppLovinMax.Scripts.IntegrationManager.Editor { Application.OpenURL(documentationTermsAndPrivacyPolicyFlow); } + GUILayout.Space(4); GUILayout.EndHorizontal(); @@ -874,24 +897,28 @@ namespace AppLovinMax.Scripts.IntegrationManager.Editor GUILayout.Space(5); AppLovinSettings.Instance.AddApsSkAdNetworkIds = DrawOtherSettingsToggle(AppLovinSettings.Instance.AddApsSkAdNetworkIds, " Add Amazon Publisher Services SKAdNetworkID's"); GUILayout.Space(5); - var autoUpdateEnabled = DrawOtherSettingsToggle(EditorPrefs.GetBool(AppLovinAutoUpdater.KeyAutoUpdateEnabled, true), " Enable Auto Update"); + var autoUpdateEnabled = DrawOtherSettingsToggle(EditorPrefs.GetBool(AppLovinAutoUpdater.KeyAutoUpdateEnabled, true), " Enable Auto Update", "Checks for AppLovin MAX plugin updates and notifies you when an update is available."); EditorPrefs.SetBool(AppLovinAutoUpdater.KeyAutoUpdateEnabled, autoUpdateEnabled); GUILayout.Space(5); var verboseLoggingEnabled = DrawOtherSettingsToggle(EditorPrefs.GetBool(MaxSdkLogger.KeyVerboseLoggingEnabled, false), " Enable Verbose Logging"); EditorPrefs.SetBool(MaxSdkLogger.KeyVerboseLoggingEnabled, verboseLoggingEnabled); GUILayout.Space(5); + AppLovinSettings.Instance.CustomGradleVersionUrl = DrawTextField("Custom Gradle Version URL", AppLovinSettings.Instance.CustomGradleVersionUrl, GUILayout.Width(privacySettingLabelWidth), privacySettingFieldWidthOption, tooltip: customGradleVersionTooltip); + AppLovinSettings.Instance.CustomGradleToolsVersion = DrawTextField("Custom Gradle Tools Version", AppLovinSettings.Instance.CustomGradleToolsVersion, GUILayout.Width(privacySettingLabelWidth), privacySettingFieldWidthOption, tooltip: customGradleToolsVersionTooltip); + EditorGUILayout.HelpBox("This will overwrite the gradle build tools version in your base gradle template.", MessageType.Info); } GUILayout.Space(5); GUILayout.EndHorizontal(); } - private bool DrawOtherSettingsToggle(bool value, string text) + private bool DrawOtherSettingsToggle(bool value, string text, string tooltip = "") { using (new EditorGUILayout.HorizontalScope()) { GUILayout.Space(4); - var toggleValue = GUILayout.Toggle(value, text); + var content = MaxSdkUtils.IsValidString(tooltip) ? new GUIContent(text, tooltip) : new GUIContent(text); + var toggleValue = GUILayout.Toggle(value, content); GUILayout.Space(4); return toggleValue; diff --git a/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinMenuItems.cs.backup b/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinMenuItems.cs similarity index 93% rename from MaxSdk/Scripts/IntegrationManager/Editor/AppLovinMenuItems.cs.backup rename to MaxSdk/Scripts/IntegrationManager/Editor/AppLovinMenuItems.cs index 5d6574e..130b383 100644 --- a/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinMenuItems.cs.backup +++ b/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinMenuItems.cs @@ -31,7 +31,7 @@ namespace AppLovinMax.Scripts.IntegrationManager.Editor [MenuItem("AppLovin/Documentation")] private static void Documentation() { - Application.OpenURL("https://dash.applovin.com/documentation/mediation/unity/getting-started"); + Application.OpenURL("https://developers.applovin.com/en/unity/overview/integration"); } [MenuItem("AppLovin/Contact Us")] diff --git a/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinMenuItems.cs.backup.meta b/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinMenuItems.cs.backup.meta deleted file mode 100644 index 0749642..0000000 --- a/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinMenuItems.cs.backup.meta +++ /dev/null @@ -1,10 +0,0 @@ -fileFormatVersion: 2 -guid: 028aec80942df459ab226487b786042c -labels: -- al_max -- al_max_export_path-MaxSdk/Scripts/IntegrationManager/Editor/AppLovinMenuItems.cs.backup -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/MaxSdk/Scripts/Editor/MaxPostProcessBuildAndroid.cs.meta b/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinMenuItems.cs.meta similarity index 64% rename from MaxSdk/Scripts/Editor/MaxPostProcessBuildAndroid.cs.meta rename to MaxSdk/Scripts/IntegrationManager/Editor/AppLovinMenuItems.cs.meta index 07e4133..30fb834 100644 --- a/MaxSdk/Scripts/Editor/MaxPostProcessBuildAndroid.cs.meta +++ b/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinMenuItems.cs.meta @@ -1,8 +1,8 @@ fileFormatVersion: 2 -guid: 75fed160a41749d4990cee871ee618a4 +guid: 02c2d277874f649d18a59d382420bf65 labels: - al_max -- al_max_export_path-MaxSdk/Scripts/Editor/MaxPostProcessBuildAndroid.cs +- al_max_export_path-MaxSdk/Scripts/IntegrationManager/Editor/AppLovinMenuItems.cs MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/MaxSdk/Scripts/Editor/MaxPostProcessBuildAndroid.cs b/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinPostProcessAndroid.cs similarity index 59% rename from MaxSdk/Scripts/Editor/MaxPostProcessBuildAndroid.cs rename to MaxSdk/Scripts/IntegrationManager/Editor/AppLovinPostProcessAndroid.cs index c0d1e13..1c34801 100644 --- a/MaxSdk/Scripts/Editor/MaxPostProcessBuildAndroid.cs +++ b/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinPostProcessAndroid.cs @@ -12,8 +12,8 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; +using System.Text.RegularExpressions; using System.Xml.Linq; -using AppLovinMax.ThirdParty.MiniJson; using UnityEditor; using UnityEditor.Android; using UnityEngine; @@ -23,7 +23,7 @@ namespace AppLovinMax.Scripts.Editor /// /// A post processor used to update the Android project once it is generated. /// - public class MaxPostProcessBuildAndroid : IPostGenerateGradleAndroidProject + public class AppLovinPostProcessAndroid : IPostGenerateGradleAndroidProject { #if UNITY_2019_3_OR_NEWER private const string PropertyAndroidX = "android.useAndroidX"; @@ -36,7 +36,23 @@ namespace AppLovinMax.Scripts.Editor private const string KeyMetaDataAppLovinSdkKey = "applovin.sdk.key"; private const string KeyMetaDataAppLovinVerboseLoggingOn = "applovin.sdk.verbose_logging"; private const string KeyMetaDataGoogleApplicationId = "com.google.android.gms.ads.APPLICATION_ID"; - private const string KeyMetaDataGoogleAdManagerApp = "com.google.android.gms.ads.AD_MANAGER_APP"; + private const string KeyMetaDataGoogleOptimizeInitialization = "com.google.android.gms.ads.flag.OPTIMIZE_INITIALIZATION"; + private const string KeyMetaDataGoogleOptimizeAdLoading = "com.google.android.gms.ads.flag.OPTIMIZE_AD_LOADING"; + + private const string KeyMetaDataMobileFuseAutoInit = "com.mobilefuse.sdk.disable_auto_init"; + private const string KeyMetaDataMyTargetAutoInit = "com.my.target.autoInitMode"; + +#if UNITY_2022_3_OR_NEWER + // To match "'com.android.library' version '7.3.1'" line in build.gradle + private static readonly Regex TokenGradleVersionLibrary = new Regex(".*id ['\"]com\\.android\\.library['\"] version"); + private static readonly Regex TokenGradleVersion = new Regex(".*id ['\"]com\\.android\\.application['\"] version"); +#else + // To match "classpath 'com.android.tools.build:gradle:4.0.1'" line in build.gradle + private static readonly Regex TokenGradleVersion = new Regex(".*classpath ['\"]com\\.android\\.tools\\.build:gradle:.*"); +#endif + + // To match "distributionUrl=..." in gradle-wrapper.properties file + private static readonly Regex TokenDistributionUrl = new Regex(".*distributionUrl.*"); private static readonly XNamespace AndroidNamespace = "http://schemas.android.com/apk/res/android"; @@ -52,10 +68,17 @@ namespace AppLovinMax.Scripts.Editor public void OnPostGenerateGradleAndroidProject(string path) { #if UNITY_2019_3_OR_NEWER + var rootGradleBuildFilePath = Path.Combine(path, "../build.gradle"); var gradlePropertiesPath = Path.Combine(path, "../gradle.properties"); + var gradleWrapperPropertiesPath = Path.Combine(path, "../gradle/wrapper/gradle-wrapper.properties"); #else + var rootGradleBuildFilePath = Path.Combine(path, "build.gradle"); var gradlePropertiesPath = Path.Combine(path, "gradle.properties"); + var gradleWrapperPropertiesPath = Path.Combine(path, "gradle/wrapper/gradle-wrapper.properties"); #endif + + UpdateGradleVersionsIfNeeded(gradleWrapperPropertiesPath, rootGradleBuildFilePath); + var gradlePropertiesUpdated = new List(); // If the gradle properties file already exists, make sure to add any previous properties. @@ -144,6 +167,8 @@ namespace AppLovinMax.Scripts.Editor AddSdkKeyIfNeeded(elementApplication); EnableVerboseLoggingIfNeeded(elementApplication); AddGoogleApplicationIdIfNeeded(elementApplication, metaDataElements); + AddGoogleOptimizationFlagsIfNeeded(elementApplication, metaDataElements); + DisableAutoInitIfNeeded(elementApplication, metaDataElements); // Save the updated manifest file. manifest.Save(manifestPath); @@ -235,6 +260,101 @@ namespace AppLovinMax.Scripts.Editor } } + private static void AddGoogleOptimizationFlagsIfNeeded(XElement elementApplication, IEnumerable metaDataElements) + { + if (!AppLovinIntegrationManager.IsAdapterInstalled("Google") && !AppLovinIntegrationManager.IsAdapterInstalled("GoogleAdManager")) return; + + var googleOptimizeInitializationMetaData = GetMetaDataElement(metaDataElements, KeyMetaDataGoogleOptimizeInitialization); + // If meta data doesn't exist, add it + if (googleOptimizeInitializationMetaData == null) + { + elementApplication.Add(CreateMetaDataElement(KeyMetaDataGoogleOptimizeInitialization, true)); + } + + var googleOptimizeAdLoadingMetaData = GetMetaDataElement(metaDataElements, KeyMetaDataGoogleOptimizeAdLoading); + // If meta data doesn't exist, add it + if (googleOptimizeAdLoadingMetaData == null) + { + elementApplication.Add(CreateMetaDataElement(KeyMetaDataGoogleOptimizeAdLoading, true)); + } + } + + private static void DisableAutoInitIfNeeded(XElement elementApplication, IEnumerable metaDataElements) + { + if (AppLovinIntegrationManager.IsAdapterInstalled("MobileFuse")) + { + var mobileFuseMetaData = GetMetaDataElement(metaDataElements, KeyMetaDataMobileFuseAutoInit); + // If MobileFuse meta data doesn't exist, add it + if (mobileFuseMetaData == null) + { + elementApplication.Add(CreateMetaDataElement(KeyMetaDataMobileFuseAutoInit, true)); + } + } + + if (AppLovinIntegrationManager.IsAdapterInstalled("MyTarget")) + { + var myTargetMetaData = GetMetaDataElement(metaDataElements, KeyMetaDataMyTargetAutoInit); + // If MyTarget meta data doesn't exist, add it + if (myTargetMetaData == null) + { + elementApplication.Add(CreateMetaDataElement(KeyMetaDataMyTargetAutoInit, 0)); + } + } + } + + private static void UpdateGradleVersionsIfNeeded(string gradleWrapperPropertiesPath, string rootGradleBuildFilePath) + { + var customGradleVersionUrl = AppLovinSettings.Instance.CustomGradleVersionUrl; + var customGradleToolsVersion = AppLovinSettings.Instance.CustomGradleToolsVersion; + + if (MaxSdkUtils.IsValidString(customGradleVersionUrl)) + { + var newDistributionUrl = string.Format("distributionUrl={0}", customGradleVersionUrl); + if (ReplaceStringInFile(gradleWrapperPropertiesPath, TokenDistributionUrl, newDistributionUrl)) + { + MaxSdkLogger.D("Distribution url set to " + newDistributionUrl); + } + else + { + MaxSdkLogger.E("Failed to set distribution URL"); + } + } + + if (MaxSdkUtils.IsValidString(customGradleToolsVersion)) + { +#if UNITY_2022_3_OR_NEWER + // Unity 2022.3+ requires Gradle Plugin version 7.1.2+. + if (MaxSdkUtils.CompareVersions(customGradleToolsVersion, "7.1.2") == MaxSdkUtils.VersionComparisonResult.Lesser) + { + MaxSdkLogger.E("Failed to set gradle plugin version. Unity 2022.3+ requires gradle plugin version 7.1.2+"); + return; + } + + var newGradleVersionLibraryLine = AppLovinProcessGradleBuildFile.GetFormattedBuildScriptLine(string.Format("id 'com.android.library' version '{0}' apply false", customGradleToolsVersion)); + if (ReplaceStringInFile(rootGradleBuildFilePath, TokenGradleVersionLibrary, newGradleVersionLibraryLine)) + { + MaxSdkLogger.D("Gradle library version set to " + newGradleVersionLibraryLine); + } + else + { + MaxSdkLogger.E("Failed to set gradle library version"); + } + + var newGradleVersionLine = AppLovinProcessGradleBuildFile.GetFormattedBuildScriptLine(string.Format("id 'com.android.application' version '{0}' apply false", customGradleToolsVersion)); +#else + var newGradleVersionLine = AppLovinProcessGradleBuildFile.GetFormattedBuildScriptLine(string.Format("classpath 'com.android.tools.build:gradle:{0}'", customGradleToolsVersion)); +#endif + if (ReplaceStringInFile(rootGradleBuildFilePath, TokenGradleVersion, newGradleVersionLine)) + { + MaxSdkLogger.D("Gradle version set to " + newGradleVersionLine); + } + else + { + MaxSdkLogger.E("Failed to set gradle plugin version"); + } + } + } + /// /// Creates and returns a meta-data element with the given name and value. /// @@ -265,6 +385,31 @@ namespace AppLovinMax.Scripts.Editor return null; } + + /// + /// Finds the first line that contains regexToMatch and replaces the whole line with replacement + /// + /// Path to the file you want to replace a line in + /// Regex to search for in the line you want to replace + /// String that you want as the new line + /// Returns whether the string was successfully replaced or not + private static bool ReplaceStringInFile(string path, Regex regexToMatch, string replacement) + { + if (!File.Exists(path)) return false; + + var lines = File.ReadAllLines(path); + for (var i = 0; i < lines.Length; i++) + { + if (regexToMatch.IsMatch(lines[i])) + { + lines[i] = replacement; + File.WriteAllLines(path, lines); + return true; + } + } + + return false; + } } } diff --git a/Amazon/Scripts/Internal/Android/AndroidAdResponce.cs.meta b/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinPostProcessAndroid.cs.meta similarity index 57% rename from Amazon/Scripts/Internal/Android/AndroidAdResponce.cs.meta rename to MaxSdk/Scripts/IntegrationManager/Editor/AppLovinPostProcessAndroid.cs.meta index 6b35c90..2877140 100644 --- a/Amazon/Scripts/Internal/Android/AndroidAdResponce.cs.meta +++ b/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinPostProcessAndroid.cs.meta @@ -1,5 +1,8 @@ fileFormatVersion: 2 -guid: b59d5cd7e7903495f8d952a28060400d +guid: c01ea79d0cb2a43c093e2fd07201df9e +labels: +- al_max +- al_max_export_path-MaxSdk/Scripts/IntegrationManager/Editor/AppLovinPostProcessAndroid.cs MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinPostProcessiOS.cs b/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinPostProcessiOS.cs index 41c1561..d8ee3c7 100644 --- a/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinPostProcessiOS.cs +++ b/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinPostProcessiOS.cs @@ -8,25 +8,134 @@ #if UNITY_IOS || UNITY_IPHONE -using System.Text; -using UnityEngine.Networking; -using Debug = UnityEngine.Debug; +using System; +using System.Collections.Generic; using System.IO; +using System.Linq; +using System.Text; using UnityEditor; using UnityEditor.Callbacks; +#if UNITY_2019_3_OR_NEWER +using UnityEditor.iOS.Xcode.Extensions; +#endif +using UnityEditor.iOS.Xcode; +using UnityEngine; +using Debug = UnityEngine.Debug; +using UnityEngine.Networking; namespace AppLovinMax.Scripts.IntegrationManager.Editor { - /// - /// Adds AppLovin Quality Service to the iOS project once the project has been exported. - /// - /// 1. Downloads the Quality Service ruby script. - /// 2. Runs the script using Ruby which integrates AppLovin Quality Service to the project. - /// + [Serializable] + public class SkAdNetworkData + { + [SerializeField] public string[] SkAdNetworkIds; + } + public class AppLovinPostProcessiOS { private const string OutputFileName = "AppLovinQualityServiceSetup.rb"; +#if UNITY_2019_3_OR_NEWER + private const string TargetUnityIphonePodfileLine = "target 'Unity-iPhone' do"; + private const string UseFrameworksPodfileLine = "use_frameworks!"; + private const string UseFrameworksDynamicPodfileLine = "use_frameworks! :linkage => :dynamic"; + private const string UseFrameworksStaticPodfileLine = "use_frameworks! :linkage => :static"; +#else + private const string UnityMainTargetName = "Unity-iPhone"; +#endif + private const string LegacyResourcesDirectoryName = "Resources"; + private const string AppLovinMaxResourcesDirectoryName = "AppLovinMAXResources"; + private const string AppLovinAdvertisingAttributionEndpoint = "https://postbacks-app.com"; + + private const string AppLovinSettingsPlistFileName = "AppLovin-Settings.plist"; + private const string KeyConsentFlowInfo = "ConsentFlowInfo"; + private const string KeyConsentFlowEnabled = "ConsentFlowEnabled"; + private const string KeyConsentFlowTermsOfService = "ConsentFlowTermsOfService"; + private const string KeyConsentFlowPrivacyPolicy = "ConsentFlowPrivacyPolicy"; + private const string KeyConsentFlowDebugUserGeography = "ConsentFlowDebugUserGeography"; + + private static List DynamicLibrariesToEmbed + { + get + { + var dynamicLibrariesToEmbed = new List + { + "AppLovinSDK.xcframework", + "DTBiOSSDK.xcframework", + "FBAEMKit.xcframework", + "FBSDKCoreKit_Basics.xcframework", + "FBSDKCoreKit.xcframework", + "FBSDKGamingServicesKit.xcframework", + "FBSDKLoginKit.xcframework", + "FBSDKShareKit.xcframework", + "HyprMX.xcframework", + "Maio.xcframework", + "MobileFuseSDK.xcframework", + "MolocoSDK.xcframework", + "OMSDK_Appodeal.xcframework", + "OMSDK_Ogury.xcframework", + "OMSDK_Pubnativenet.xcframework", + "OMSDK_Smaato.xcframework" + }; + + // LinkedIn Audience Network SDK is distributed as a static library starting version 1.2.0 + if (AppLovinIntegrationManager.IsAdapterOlderThanMinVersionInstalled("LinkedIn", "1.2.0.0")) + { + dynamicLibrariesToEmbed.Add("LinkedinAudienceNetwork.xcframework"); + } + + // Fyber/IA SDK is distributed as a static library starting version 8.2.7 + if (AppLovinIntegrationManager.IsAdapterOlderThanMinVersionInstalled("Fyber", "8.2.7.0")) + { + dynamicLibrariesToEmbed.Add("IASDKCore.xcframework"); + } + + if (AppLovinIntegrationManager.IsAdapterInstalled("InMobi", "10.7.2.0")) + { + dynamicLibrariesToEmbed.Add("InMobiSDK.xcframework"); + } + + if (AppLovinIntegrationManager.IsAdapterInstalled("Smaato", "22.8.3.0")) + { + dynamicLibrariesToEmbed.AddRange(new List() + { + "SmaatoSDKBanner.xcframework", + "SmaatoSDKCore.xcframework", + "SmaatoSDKInAppBidding.xcframework", + "SmaatoSDKInterstitial.xcframework", + "SmaatoSDKNative.xcframework", + "SmaatoSDKOpenMeasurement.xcframework", + "SmaatoSDKOutstream.xcframework", + "SmaatoSDKRewardedAds.xcframework", + "SmaatoSDKRichMedia.xcframework", + "SmaatoSDKVideo.xcframework" + }); + } + + if (AppLovinIntegrationManager.IsAdapterInstalled("Verve", "3.0.0.0")) + { + dynamicLibrariesToEmbed.Add("ATOM.xcframework"); + } + + return dynamicLibrariesToEmbed; + } + } + + private static string PluginMediationDirectory + { + get + { + var pluginParentDir = AppLovinIntegrationManager.MediationSpecificPluginParentDirectory; + return Path.Combine(pluginParentDir, "MaxSdk/Mediation/"); + } + } + + /// + /// Adds AppLovin Quality Service to the iOS project once the project has been exported. + /// + /// 1. Downloads the Quality Service ruby script. + /// 2. Runs the script using Ruby which integrates AppLovin Quality Service to the project. + /// [PostProcessBuild(int.MaxValue)] // We want to run Quality Service script last. public static void OnPostProcessBuild(BuildTarget buildTarget, string buildPath) { @@ -92,6 +201,537 @@ namespace AppLovinMax.Scripts.IntegrationManager.Editor MaxSdkLogger.UserDebug(result.Message); } } + + [PostProcessBuildAttribute(int.MaxValue)] + public static void MaxPostProcessPbxProject(BuildTarget buildTarget, string buildPath) + { + var projectPath = PBXProject.GetPBXProjectPath(buildPath); + var project = new PBXProject(); + project.ReadFromFile(projectPath); + +#if UNITY_2019_3_OR_NEWER + var unityMainTargetGuid = project.GetUnityMainTargetGuid(); + var unityFrameworkTargetGuid = project.GetUnityFrameworkTargetGuid(); +#else + var unityMainTargetGuid = project.TargetGuidByName(UnityMainTargetName); + var unityFrameworkTargetGuid = project.TargetGuidByName(UnityMainTargetName); +#endif + EmbedDynamicLibrariesIfNeeded(buildPath, project, unityMainTargetGuid); + + var internalSettingsEnabled = AppLovinInternalSettings.Instance.ConsentFlowEnabled; + var userTrackingUsageDescriptionDe = internalSettingsEnabled ? AppLovinInternalSettings.Instance.UserTrackingUsageDescriptionDe : AppLovinSettings.Instance.UserTrackingUsageDescriptionDe; + LocalizeUserTrackingDescriptionIfNeeded(userTrackingUsageDescriptionDe, "de", buildPath, project, unityMainTargetGuid); + var userTrackingUsageDescriptionEn = internalSettingsEnabled ? AppLovinInternalSettings.Instance.UserTrackingUsageDescriptionEn : AppLovinSettings.Instance.UserTrackingUsageDescriptionEn; + LocalizeUserTrackingDescriptionIfNeeded(userTrackingUsageDescriptionEn, "en", buildPath, project, unityMainTargetGuid); + var userTrackingUsageDescriptionEs = internalSettingsEnabled ? AppLovinInternalSettings.Instance.UserTrackingUsageDescriptionEs : AppLovinSettings.Instance.UserTrackingUsageDescriptionEs; + LocalizeUserTrackingDescriptionIfNeeded(userTrackingUsageDescriptionEs, "es", buildPath, project, unityMainTargetGuid); + var userTrackingUsageDescriptionFr = internalSettingsEnabled ? AppLovinInternalSettings.Instance.UserTrackingUsageDescriptionFr : AppLovinSettings.Instance.UserTrackingUsageDescriptionFr; + LocalizeUserTrackingDescriptionIfNeeded(userTrackingUsageDescriptionFr, "fr", buildPath, project, unityMainTargetGuid); + var userTrackingUsageDescriptionJa = internalSettingsEnabled ? AppLovinInternalSettings.Instance.UserTrackingUsageDescriptionJa : AppLovinSettings.Instance.UserTrackingUsageDescriptionJa; + LocalizeUserTrackingDescriptionIfNeeded(userTrackingUsageDescriptionJa, "ja", buildPath, project, unityMainTargetGuid); + var userTrackingUsageDescriptionKo = internalSettingsEnabled ? AppLovinInternalSettings.Instance.UserTrackingUsageDescriptionKo : AppLovinSettings.Instance.UserTrackingUsageDescriptionKo; + LocalizeUserTrackingDescriptionIfNeeded(userTrackingUsageDescriptionKo, "ko", buildPath, project, unityMainTargetGuid); + var userTrackingUsageDescriptionZhHans = internalSettingsEnabled ? AppLovinInternalSettings.Instance.UserTrackingUsageDescriptionZhHans : AppLovinSettings.Instance.UserTrackingUsageDescriptionZhHans; + LocalizeUserTrackingDescriptionIfNeeded(userTrackingUsageDescriptionZhHans, "zh-Hans", buildPath, project, unityMainTargetGuid); + var userTrackingUsageDescriptionZhHant = internalSettingsEnabled ? AppLovinInternalSettings.Instance.UserTrackingUsageDescriptionZhHant : AppLovinSettings.Instance.UserTrackingUsageDescriptionZhHant; + LocalizeUserTrackingDescriptionIfNeeded(userTrackingUsageDescriptionZhHant, "zh-Hant", buildPath, project, unityMainTargetGuid); + + AddSwiftSupport(buildPath, project, unityFrameworkTargetGuid, unityMainTargetGuid); + AddYandexSettingsIfNeeded(project, unityMainTargetGuid); + + project.WriteToFile(projectPath); + } + + private static void EmbedDynamicLibrariesIfNeeded(string buildPath, PBXProject project, string targetGuid) + { + // Check that the Pods directory exists (it might not if a publisher is building with Generate Podfile setting disabled in EDM). + var podsDirectory = Path.Combine(buildPath, "Pods"); + if (!Directory.Exists(podsDirectory)) return; + + var dynamicLibraryPathsPresentInProject = new List(); + foreach (var dynamicLibraryToSearch in DynamicLibrariesToEmbed) + { + // both .framework and .xcframework are directories, not files + var directories = Directory.GetDirectories(podsDirectory, dynamicLibraryToSearch, SearchOption.AllDirectories); + if (directories.Length <= 0) continue; + + var dynamicLibraryAbsolutePath = directories[0]; + var index = dynamicLibraryAbsolutePath.LastIndexOf("Pods"); + var relativePath = dynamicLibraryAbsolutePath.Substring(index); + dynamicLibraryPathsPresentInProject.Add(relativePath); + } + + if (dynamicLibraryPathsPresentInProject.Count <= 0) return; + +#if UNITY_2019_3_OR_NEWER + if (ShouldEmbedDynamicLibraries(buildPath)) + { + foreach (var dynamicLibraryPath in dynamicLibraryPathsPresentInProject) + { + var fileGuid = project.AddFile(dynamicLibraryPath, dynamicLibraryPath); + project.AddFileToEmbedFrameworks(targetGuid, fileGuid); + } + } +#else + string runpathSearchPaths; + runpathSearchPaths = project.GetBuildPropertyForAnyConfig(targetGuid, "LD_RUNPATH_SEARCH_PATHS"); + runpathSearchPaths += string.IsNullOrEmpty(runpathSearchPaths) ? "" : " "; + + // Check if runtime search paths already contains the required search paths for dynamic libraries. + if (runpathSearchPaths.Contains("@executable_path/Frameworks")) return; + + runpathSearchPaths += "@executable_path/Frameworks"; + project.SetBuildProperty(targetGuid, "LD_RUNPATH_SEARCH_PATHS", runpathSearchPaths); +#endif + } + + private static void LocalizeUserTrackingDescriptionIfNeeded(string localizedUserTrackingDescription, string localeCode, string buildPath, PBXProject project, string targetGuid) + { + // Use the legacy resources directory name if the build is being appended (the "Resources" directory already exists if it is an incremental build). + var resourcesDirectoryName = Directory.Exists(Path.Combine(buildPath, LegacyResourcesDirectoryName)) ? LegacyResourcesDirectoryName : AppLovinMaxResourcesDirectoryName; + var resourcesDirectoryPath = Path.Combine(buildPath, resourcesDirectoryName); + var localeSpecificDirectoryName = localeCode + ".lproj"; + var localeSpecificDirectoryPath = Path.Combine(resourcesDirectoryPath, localeSpecificDirectoryName); + var infoPlistStringsFilePath = Path.Combine(localeSpecificDirectoryPath, "InfoPlist.strings"); + + // Check if localization has been disabled between builds, and remove them as needed. + if (ShouldRemoveLocalization(localizedUserTrackingDescription)) + { + if (!File.Exists(infoPlistStringsFilePath)) return; + + File.Delete(infoPlistStringsFilePath); + return; + } + + // Create intermediate directories as needed. + if (!Directory.Exists(resourcesDirectoryPath)) + { + Directory.CreateDirectory(resourcesDirectoryPath); + } + + if (!Directory.Exists(localeSpecificDirectoryPath)) + { + Directory.CreateDirectory(localeSpecificDirectoryPath); + } + + var localizedDescriptionLine = "\"NSUserTrackingUsageDescription\" = \"" + localizedUserTrackingDescription + "\";\n"; + // File already exists, update it in case the value changed between builds. + if (File.Exists(infoPlistStringsFilePath)) + { + var output = new List(); + var lines = File.ReadAllLines(infoPlistStringsFilePath); + var keyUpdated = false; + foreach (var line in lines) + { + if (line.Contains("NSUserTrackingUsageDescription")) + { + output.Add(localizedDescriptionLine); + keyUpdated = true; + } + else + { + output.Add(line); + } + } + + if (!keyUpdated) + { + output.Add(localizedDescriptionLine); + } + + File.WriteAllText(infoPlistStringsFilePath, string.Join("\n", output.ToArray()) + "\n"); + } + // File doesn't exist, create one. + else + { + File.WriteAllText(infoPlistStringsFilePath, "/* Localized versions of Info.plist keys - Generated by AL MAX plugin */\n" + localizedDescriptionLine); + } + + var localeSpecificDirectoryRelativePath = Path.Combine(resourcesDirectoryName, localeSpecificDirectoryName); + var guid = project.AddFolderReference(localeSpecificDirectoryRelativePath, localeSpecificDirectoryRelativePath); + project.AddFileToBuild(targetGuid, guid); + } + + private static bool ShouldRemoveLocalization(string localizedUserTrackingDescription) + { + if (string.IsNullOrEmpty(localizedUserTrackingDescription)) return true; + + var settings = AppLovinSettings.Instance; + var internalSettings = AppLovinInternalSettings.Instance; + + return (!internalSettings.ConsentFlowEnabled || !internalSettings.UserTrackingUsageLocalizationEnabled) + && (!settings.ConsentFlowEnabled || !settings.UserTrackingUsageLocalizationEnabled); + } + + private static void AddSwiftSupport(string buildPath, PBXProject project, string unityFrameworkTargetGuid, string unityMainTargetGuid) + { + var swiftFileRelativePath = "Classes/MAXSwiftSupport.swift"; + var swiftFilePath = Path.Combine(buildPath, swiftFileRelativePath); + + // Add Swift file + CreateSwiftFile(swiftFilePath); + var swiftFileGuid = project.AddFile(swiftFileRelativePath, swiftFileRelativePath, PBXSourceTree.Source); + project.AddFileToBuild(unityFrameworkTargetGuid, swiftFileGuid); + + // Add Swift version property if needed + var swiftVersion = project.GetBuildPropertyForAnyConfig(unityFrameworkTargetGuid, "SWIFT_VERSION"); + if (string.IsNullOrEmpty(swiftVersion)) + { + project.SetBuildProperty(unityFrameworkTargetGuid, "SWIFT_VERSION", "5.0"); + } + + // Enable Swift modules + project.AddBuildProperty(unityFrameworkTargetGuid, "CLANG_ENABLE_MODULES", "YES"); + project.AddBuildProperty(unityMainTargetGuid, "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES", "YES"); + } + + private static void CreateSwiftFile(string swiftFilePath) + { + if (File.Exists(swiftFilePath)) return; + + // Create a file to write to. + using (var writer = File.CreateText(swiftFilePath)) + { + writer.WriteLine("//\n// MAXSwiftSupport.swift\n//"); + writer.WriteLine("\nimport Foundation\n"); + writer.WriteLine("// This file ensures the project includes Swift support."); + writer.WriteLine("// It is automatically generated by the MAX Unity Plugin."); + writer.Close(); + } + } + + [PostProcessBuildAttribute(int.MaxValue)] + public static void MaxPostProcessPlist(BuildTarget buildTarget, string path) + { + var plistPath = Path.Combine(path, "Info.plist"); + var plist = new PlistDocument(); + plist.ReadFromFile(plistPath); + + SetSdkKeyIfNeeded(plist); + SetAttributionReportEndpointIfNeeded(plist); + + EnableVerboseLoggingIfNeeded(plist); + AddGoogleApplicationIdIfNeeded(plist); + + AddSdkSettingsIfNeeded(plist, path); + EnableTermsFlowIfNeeded(plist); + AddSkAdNetworksInfoIfNeeded(plist); + + plist.WriteToFile(plistPath); + } + + private static void SetSdkKeyIfNeeded(PlistDocument plist) + { + var sdkKey = AppLovinSettings.Instance.SdkKey; + if (string.IsNullOrEmpty(sdkKey)) return; + + const string AppLovinVerboseLoggingOnKey = "AppLovinSdkKey"; + plist.root.SetString(AppLovinVerboseLoggingOnKey, sdkKey); + } + + private static void SetAttributionReportEndpointIfNeeded(PlistDocument plist) + { + if (AppLovinSettings.Instance.SetAttributionReportEndpoint) + { + plist.root.SetString("NSAdvertisingAttributionReportEndpoint", AppLovinAdvertisingAttributionEndpoint); + } + else + { + PlistElement attributionReportEndPoint; + plist.root.values.TryGetValue("NSAdvertisingAttributionReportEndpoint", out attributionReportEndPoint); + + // Check if we had previously set the attribution endpoint and un-set it. + if (attributionReportEndPoint != null && AppLovinAdvertisingAttributionEndpoint.Equals(attributionReportEndPoint.AsString())) + { + plist.root.values.Remove("NSAdvertisingAttributionReportEndpoint"); + } + } + } + + private static void EnableVerboseLoggingIfNeeded(PlistDocument plist) + { + if (!EditorPrefs.HasKey(MaxSdkLogger.KeyVerboseLoggingEnabled)) return; + + var enabled = EditorPrefs.GetBool(MaxSdkLogger.KeyVerboseLoggingEnabled); + const string AppLovinVerboseLoggingOnKey = "AppLovinVerboseLoggingOn"; + if (enabled) + { + plist.root.SetBoolean(AppLovinVerboseLoggingOnKey, enabled); + } + else + { + plist.root.values.Remove(AppLovinVerboseLoggingOnKey); + } + } + + private static void AddGoogleApplicationIdIfNeeded(PlistDocument plist) + { + if (!AppLovinIntegrationManager.IsAdapterInstalled("Google") && !AppLovinIntegrationManager.IsAdapterInstalled("GoogleAdManager")) return; + + const string googleApplicationIdentifier = "GADApplicationIdentifier"; + var appId = AppLovinSettings.Instance.AdMobIosAppId; + // Log error if the App ID is not set. + if (string.IsNullOrEmpty(appId) || !appId.StartsWith("ca-app-pub-")) + { + Debug.LogError("[AppLovin MAX] Google App ID is not set. Please enter a valid app ID within the AppLovin Integration Manager window."); + return; + } + + plist.root.SetString(googleApplicationIdentifier, appId); + } + + private static void AddYandexSettingsIfNeeded(PBXProject project, string unityMainTargetGuid) + { + if (!AppLovinIntegrationManager.IsAdapterInstalled("Yandex")) return; + + if (MaxSdkUtils.CompareVersions(PlayerSettings.iOS.targetOSVersionString, "12.0") == MaxSdkUtils.VersionComparisonResult.Lesser) + { + Debug.LogWarning("Your iOS target version is under the minimum required version by Yandex. Please update it to 12.0 or newer in your ProjectSettings and rebuild your project."); + return; + } + + project.SetBuildProperty(unityMainTargetGuid, "GENERATE_INFOPLIST_FILE", "NO"); + } + + private static void AddSdkSettingsIfNeeded(PlistDocument infoPlist, string buildPath) + { + // Right now internal settings is only needed for Consent Flow. Remove this setting once we add more settings. + if (!AppLovinInternalSettings.Instance.ConsentFlowEnabled) return; + + var sdkSettingsPlistPath = Path.Combine(buildPath, AppLovinSettingsPlistFileName); + var sdkSettingsPlist = new PlistDocument(); + if (File.Exists(sdkSettingsPlistPath)) + { + sdkSettingsPlist.ReadFromFile(sdkSettingsPlistPath); + } + + EnableConsentFlowIfNeeded(sdkSettingsPlist, infoPlist); + + sdkSettingsPlist.WriteToFile(sdkSettingsPlistPath); + + var projectPath = PBXProject.GetPBXProjectPath(buildPath); + var project = new PBXProject(); + project.ReadFromFile(projectPath); + +#if UNITY_2019_3_OR_NEWER + var unityMainTargetGuid = project.GetUnityMainTargetGuid(); +#else + var unityMainTargetGuid = project.TargetGuidByName(UnityMainTargetName); +#endif + + var guid = project.AddFile(AppLovinSettingsPlistFileName, AppLovinSettingsPlistFileName, PBXSourceTree.Source); + project.AddFileToBuild(unityMainTargetGuid, guid); + project.WriteToFile(projectPath); + } + + private static void EnableConsentFlowIfNeeded(PlistDocument applovinSettingsPlist, PlistDocument infoPlist) + { + var consentFlowEnabled = AppLovinInternalSettings.Instance.ConsentFlowEnabled; + var userTrackingUsageDescription = AppLovinInternalSettings.Instance.UserTrackingUsageDescriptionEn; + var privacyPolicyUrl = AppLovinInternalSettings.Instance.ConsentFlowPrivacyPolicyUrl; + if (string.IsNullOrEmpty(userTrackingUsageDescription) || string.IsNullOrEmpty(privacyPolicyUrl)) + { + AppLovinIntegrationManager.ShowBuildFailureDialog("You cannot use the AppLovin SDK's consent flow without defining a Privacy Policy URL and the `User Tracking Usage Description` in the AppLovin Integration Manager. \n\n" + + "Both values must be included to enable the SDK's consent flow."); + + // No need to update the info.plist here. Default consent flow state will be determined on the SDK side. + return; + } + + var consentFlowInfoRoot = applovinSettingsPlist.root.CreateDict(KeyConsentFlowInfo); + consentFlowInfoRoot.SetBoolean(KeyConsentFlowEnabled, consentFlowEnabled); + consentFlowInfoRoot.SetString(KeyConsentFlowPrivacyPolicy, privacyPolicyUrl); + + var termsOfServiceUrl = AppLovinInternalSettings.Instance.ConsentFlowTermsOfServiceUrl; + if (MaxSdkUtils.IsValidString(termsOfServiceUrl)) + { + consentFlowInfoRoot.SetString(KeyConsentFlowTermsOfService, termsOfServiceUrl); + } + + var debugUserGeography = AppLovinInternalSettings.Instance.DebugUserGeography; + if (debugUserGeography == MaxSdkBase.ConsentFlowUserGeography.Gdpr) + { + consentFlowInfoRoot.SetString(KeyConsentFlowDebugUserGeography, "gdpr"); + } + + infoPlist.root.SetString("NSUserTrackingUsageDescription", userTrackingUsageDescription); + } + + private static void EnableTermsFlowIfNeeded(PlistDocument plist) + { + // Check if terms flow is enabled. No need to update info.plist if consent flow is disabled. + var consentFlowEnabled = AppLovinSettings.Instance.ConsentFlowEnabled; + if (!consentFlowEnabled) return; + + // Check if terms flow is enabled for this format. + var consentFlowPlatform = AppLovinSettings.Instance.ConsentFlowPlatform; + if (consentFlowPlatform != Platform.All && consentFlowPlatform != Platform.iOS) return; + + var userTrackingUsageDescription = AppLovinSettings.Instance.UserTrackingUsageDescriptionEn; + var privacyPolicyUrl = AppLovinSettings.Instance.ConsentFlowPrivacyPolicyUrl; + if (string.IsNullOrEmpty(userTrackingUsageDescription) || string.IsNullOrEmpty(privacyPolicyUrl)) + { + AppLovinIntegrationManager.ShowBuildFailureDialog("You cannot use the AppLovin SDK's consent flow without defining a Privacy Policy URL and the `User Tracking Usage Description` in the AppLovin Integration Manager. \n\n" + + "Both values must be included to enable the SDK's consent flow."); + + // No need to update the info.plist here. Default consent flow state will be determined on the SDK side. + return; + } + + var consentFlowInfoRoot = plist.root.CreateDict("AppLovinConsentFlowInfo"); + consentFlowInfoRoot.SetBoolean("AppLovinConsentFlowEnabled", consentFlowEnabled); + consentFlowInfoRoot.SetString("AppLovinConsentFlowPrivacyPolicy", privacyPolicyUrl); + + var termsOfServiceUrl = AppLovinSettings.Instance.ConsentFlowTermsOfServiceUrl; + if (!string.IsNullOrEmpty(termsOfServiceUrl)) + { + consentFlowInfoRoot.SetString("AppLovinConsentFlowTermsOfService", termsOfServiceUrl); + } + + plist.root.SetString("NSUserTrackingUsageDescription", userTrackingUsageDescription); + } + + private static void AddSkAdNetworksInfoIfNeeded(PlistDocument plist) + { + var skAdNetworkData = GetSkAdNetworkData(); + var skAdNetworkIds = skAdNetworkData.SkAdNetworkIds; + // Check if we have a valid list of SKAdNetworkIds that need to be added. + if (skAdNetworkIds == null || skAdNetworkIds.Length < 1) return; + + // + // Add the SKAdNetworkItems to the plist. It should look like following: + // + // SKAdNetworkItems + // + // + // SKAdNetworkIdentifier + // ABC123XYZ.skadnetwork + // + // + // SKAdNetworkIdentifier + // 123QWE456.skadnetwork + // + // + // SKAdNetworkIdentifier + // 987XYZ123.skadnetwork + // + // + // + PlistElement skAdNetworkItems; + plist.root.values.TryGetValue("SKAdNetworkItems", out skAdNetworkItems); + var existingSkAdNetworkIds = new HashSet(); + // Check if SKAdNetworkItems array is already in the Plist document and collect all the IDs that are already present. + if (skAdNetworkItems != null && skAdNetworkItems.GetType() == typeof(PlistElementArray)) + { + var plistElementDictionaries = skAdNetworkItems.AsArray().values.Where(plistElement => plistElement.GetType() == typeof(PlistElementDict)); + foreach (var plistElement in plistElementDictionaries) + { + PlistElement existingId; + plistElement.AsDict().values.TryGetValue("SKAdNetworkIdentifier", out existingId); + if (existingId == null || existingId.GetType() != typeof(PlistElementString) || string.IsNullOrEmpty(existingId.AsString())) continue; + + existingSkAdNetworkIds.Add(existingId.AsString()); + } + } + // Else, create an array of SKAdNetworkItems into which we will add our IDs. + else + { + skAdNetworkItems = plist.root.CreateArray("SKAdNetworkItems"); + } + + foreach (var skAdNetworkId in skAdNetworkIds) + { + // Skip adding IDs that are already in the array. + if (existingSkAdNetworkIds.Contains(skAdNetworkId)) continue; + + var skAdNetworkItemDict = skAdNetworkItems.AsArray().AddDict(); + skAdNetworkItemDict.SetString("SKAdNetworkIdentifier", skAdNetworkId); + } + } + + private static SkAdNetworkData GetSkAdNetworkData() + { + var uriBuilder = new UriBuilder("https://unity.applovin.com/max/1.0/skadnetwork_ids"); + + // Get the list of installed ad networks to be passed up + var maxMediationDirectory = PluginMediationDirectory; + if (Directory.Exists(maxMediationDirectory)) + { + var mediationNetworkDirectories = Directory.GetDirectories(maxMediationDirectory); + var installedNetworks = mediationNetworkDirectories.Select(Path.GetFileName).ToList(); + if (AppLovinSettings.Instance.AddApsSkAdNetworkIds) + { + installedNetworks.Add("AmazonPublisherServices"); + } + + var adNetworks = string.Join(",", installedNetworks.ToArray()); + if (!string.IsNullOrEmpty(adNetworks)) + { + uriBuilder.Query += string.Format("ad_networks={0}", adNetworks); + } + } + + using (var unityWebRequest = UnityWebRequest.Get(uriBuilder.ToString())) + { + var operation = unityWebRequest.SendWebRequest(); + // Wait for the download to complete or the request to timeout. + while (!operation.isDone) { } + +#if UNITY_2020_1_OR_NEWER + if (unityWebRequest.result != UnityWebRequest.Result.Success) +#else + if (unityWebRequest.isNetworkError || unityWebRequest.isHttpError) +#endif + { + MaxSdkLogger.UserError("Failed to retrieve SKAdNetwork IDs with error: " + unityWebRequest.error); + return new SkAdNetworkData(); + } + + try + { + return JsonUtility.FromJson(unityWebRequest.downloadHandler.text); + } + catch (Exception exception) + { + MaxSdkLogger.UserError("Failed to parse data '" + unityWebRequest.downloadHandler.text + "' with exception: " + exception); + return new SkAdNetworkData(); + } + } + } + +#if UNITY_2019_3_OR_NEWER + /// + /// |-----------------------------------------------------------------------------------------------------------------------------------------------------| + /// | embed | use_frameworks! (:linkage => :dynamic) | use_frameworks! :linkage => :static | `use_frameworks!` line not present | + /// |---------------------------|------------------------------------------|---------------------------------------|--------------------------------------| + /// | Unity-iPhone present | Do not embed dynamic libraries | Embed dynamic libraries | Do not embed dynamic libraries | + /// | Unity-iPhone not present | Embed dynamic libraries | Embed dynamic libraries | Embed dynamic libraries | + /// |-----------------------------------------------------------------------------------------------------------------------------------------------------| + /// + /// An iOS build path + /// Whether or not the dynamic libraries should be embedded. + private static bool ShouldEmbedDynamicLibraries(string buildPath) + { + var podfilePath = Path.Combine(buildPath, "Podfile"); + if (!File.Exists(podfilePath)) return false; + + // If the Podfile doesn't have a `Unity-iPhone` target, we should embed the dynamic libraries. + var lines = File.ReadAllLines(podfilePath); + var containsUnityIphoneTarget = lines.Any(line => line.Contains(TargetUnityIphonePodfileLine)); + if (!containsUnityIphoneTarget) return true; + + // If the Podfile does not have a `use_frameworks! :linkage => static` line, we should not embed the dynamic libraries. + var useFrameworksStaticLineIndex = Array.FindIndex(lines, line => line.Contains(UseFrameworksStaticPodfileLine)); + if (useFrameworksStaticLineIndex == -1) return false; + + // If more than one of the `use_frameworks!` lines are present, CocoaPods will use the last one. + var useFrameworksLineIndex = Array.FindIndex(lines, line => line.Trim() == UseFrameworksPodfileLine); // Check for exact line to avoid matching `use_frameworks! :linkage => static/dynamic` + var useFrameworksDynamicLineIndex = Array.FindIndex(lines, line => line.Contains(UseFrameworksDynamicPodfileLine)); + + // Check if `use_frameworks! :linkage => :static` is the last line of the three. If it is, we should embed the dynamic libraries. + return useFrameworksLineIndex < useFrameworksStaticLineIndex && useFrameworksDynamicLineIndex < useFrameworksStaticLineIndex; + } +#endif } } diff --git a/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinPreProcessAndroid.cs b/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinPreProcessAndroid.cs index 2761fec..61bea2b 100644 --- a/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinPreProcessAndroid.cs +++ b/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinPreProcessAndroid.cs @@ -38,6 +38,10 @@ namespace AppLovinMax.Scripts.IntegrationManager.Editor private const string KeyConsentFlowTermsOfService = "consent_flow_terms_of_service"; private const string KeyConsentFlowPrivacyPolicy = "consent_flow_privacy_policy"; private const string KeyConsentFlowDebugUserGeography = "consent_flow_debug_user_geography"; + + private const string UmpLegacyDependencyLine = ""; + private const string UmpDependencyLine = ""; + private const string AndroidPackagesContainerElementString = "androidPackages"; public void OnPreprocessBuild(BuildReport report) { @@ -181,16 +185,16 @@ namespace AppLovinMax.Scripts.IntegrationManager.Editor private static void AddGoogleCmpDependencyIfNeeded() { - const string umpDependencyLine = ""; - const string containerElementString = "androidPackages"; + // Remove the legacy fixed UMP version if it exists, we'll add the dependency with a dynamic version below. + TryRemoveStringFromDependencyFile(UmpLegacyDependencyLine, AndroidPackagesContainerElementString); if (AppLovinInternalSettings.Instance.ConsentFlowEnabled) { - TryAddStringToDependencyFile(umpDependencyLine, containerElementString); + TryAddStringToDependencyFile(UmpDependencyLine, AndroidPackagesContainerElementString); } else { - TryRemoveStringFromDependencyFile(umpDependencyLine, containerElementString); + TryRemoveStringFromDependencyFile(UmpDependencyLine, AndroidPackagesContainerElementString); } } diff --git a/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinPreProcessiOS.cs b/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinPreProcessiOS.cs index dcffbc6..8537150 100644 --- a/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinPreProcessiOS.cs +++ b/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinPreProcessiOS.cs @@ -20,18 +20,22 @@ namespace AppLovinMax.Scripts.IntegrationManager.Editor AddGoogleCmpDependencyIfNeeded(); } + private const string UmpLegacyDependencyLine = ""; + private const string UmpDependencyLine = ""; + private const string IosPodsContainerElementString = "iosPods"; + private static void AddGoogleCmpDependencyIfNeeded() { - const string umpDependencyLine = ""; - const string containerElementString = "iosPods"; + // Remove the legacy fixed UMP version if it exists, we'll add the dependency with a dynamic version below. + TryRemoveStringFromDependencyFile(UmpLegacyDependencyLine, IosPodsContainerElementString); if (AppLovinInternalSettings.Instance.ConsentFlowEnabled) { - TryAddStringToDependencyFile(umpDependencyLine, containerElementString); + TryAddStringToDependencyFile(UmpDependencyLine, IosPodsContainerElementString); } else { - TryRemoveStringFromDependencyFile(umpDependencyLine, containerElementString); + TryRemoveStringFromDependencyFile(UmpDependencyLine, IosPodsContainerElementString); } } diff --git a/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinProcessGradleBuildFile.cs b/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinProcessGradleBuildFile.cs index 48b4d0e..87152a9 100644 --- a/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinProcessGradleBuildFile.cs +++ b/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinProcessGradleBuildFile.cs @@ -544,7 +544,7 @@ namespace AppLovinMax.Scripts.IntegrationManager.Editor return outputLines; } - private static string GetFormattedBuildScriptLine(string buildScriptLine) + public static string GetFormattedBuildScriptLine(string buildScriptLine) { #if UNITY_2022_2_OR_NEWER return " " diff --git a/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinSettings.cs b/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinSettings.cs index 540cbe8..df88d8d 100644 --- a/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinSettings.cs +++ b/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinSettings.cs @@ -60,6 +60,9 @@ public class AppLovinSettings : ScriptableObject [SerializeField] private bool setAttributionReportEndpoint; [SerializeField] private bool addApsSkAdNetworkIds; + [SerializeField] private string customGradleVersionUrl; + [SerializeField] private string customGradleToolsVersion; + [SerializeField] private bool consentFlowEnabled; [SerializeField] private Platform consentFlowPlatform; [SerializeField] private string consentFlowPrivacyPolicyUrl = string.Empty; @@ -128,9 +131,13 @@ public class AppLovinSettings : ScriptableObject Directory.CreateDirectory(settingsDir); } - instance = CreateInstance(); - AssetDatabase.CreateAsset(instance, settingsFilePath); - MaxSdkLogger.D("Creating new AppLovinSettings asset at path: " + settingsFilePath); + // On script reload AssetDatabase.FindAssets() can fail and will overwrite AppLovinSettings without this check + if (!File.Exists(settingsFilePath)) + { + instance = CreateInstance(); + AssetDatabase.CreateAsset(instance, settingsFilePath); + MaxSdkLogger.D("Creating new AppLovinSettings asset at path: " + settingsFilePath); + } } return instance; @@ -173,6 +180,24 @@ public class AppLovinSettings : ScriptableObject set { Instance.addApsSkAdNetworkIds = value; } } + /// + /// A URL to set the distributionUrl in the gradle-wrapper.properties file (ex: https\://services.gradle.org/distributions/gradle-6.9.3-bin.zip) + /// + public string CustomGradleVersionUrl + { + get { return Instance.customGradleVersionUrl; } + set { Instance.customGradleVersionUrl = value; } + } + + /// + /// A string to set the custom gradle tools version (ex: com.android.tools.build:gradle:4.2.0) + /// + public string CustomGradleToolsVersion + { + get { return Instance.customGradleToolsVersion; } + set { Instance.customGradleToolsVersion = value; } + } + /// /// Whether or not AppLovin Consent Flow is enabled. /// diff --git a/MaxSdk/Scripts/MaxEventExecutor.cs b/MaxSdk/Scripts/MaxEventExecutor.cs new file mode 100644 index 0000000..1065e6d --- /dev/null +++ b/MaxSdk/Scripts/MaxEventExecutor.cs @@ -0,0 +1,108 @@ +// +// MaxEventExecutor.cs +// Max Unity Plugin +// +// Created by Jonathan Liu on 1/22/2024. +// Copyright © 2024 AppLovin. All rights reserved. +// + +using System; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Events; + +namespace AppLovinMax.Internal +{ + public class MaxEventExecutor : MonoBehaviour + { + private static MaxEventExecutor instance; + private static List adEventsQueue = new List(); + + private static volatile bool adEventsQueueEmpty = true; + + struct MaxAction + { + public Action action; + public string eventName; + + public MaxAction(Action actionToExecute, string nameOfEvent) + { + action = actionToExecute; + eventName = nameOfEvent; + } + } + + public static void InitializeIfNeeded() + { + if (instance != null) return; + + var executor = new GameObject("MaxEventExecutor"); + executor.hideFlags = HideFlags.HideAndDontSave; + DontDestroyOnLoad(executor); + instance = executor.AddComponent(); + } + + #region Public API + +#if UNITY_EDITOR || !(UNITY_ANDROID || UNITY_IPHONE || UNITY_IOS) + public static MaxEventExecutor Instance + { + get + { + InitializeIfNeeded(); + return instance; + } + } +#endif + + public static void ExecuteOnMainThread(Action action, string eventName) + { + lock (adEventsQueue) + { + adEventsQueue.Add(new MaxAction(action, eventName)); + adEventsQueueEmpty = false; + } + } + + public static void InvokeOnMainThread(UnityEvent unityEvent, string eventName) + { + ExecuteOnMainThread(() => unityEvent.Invoke(), eventName); + } + + #endregion + + public void Update() + { + if (adEventsQueueEmpty) return; + + var actionsToExecute = new List(); + lock (adEventsQueue) + { + actionsToExecute.AddRange(adEventsQueue); + adEventsQueue.Clear(); + adEventsQueueEmpty = true; + } + + foreach (var maxAction in actionsToExecute) + { + if (maxAction.action.Target != null) + { + try + { + maxAction.action.Invoke(); + } + catch (Exception exception) + { + MaxSdkLogger.UserError("Caught exception in publisher event: " + maxAction.eventName + ", exception: " + exception); + Debug.LogException(exception); + } + } + } + } + + public void Disable() + { + instance = null; + } + } +} diff --git a/MaxSdk/Scripts/Editor/MaxInitialization.cs.meta b/MaxSdk/Scripts/MaxEventExecutor.cs.meta similarity index 68% rename from MaxSdk/Scripts/Editor/MaxInitialization.cs.meta rename to MaxSdk/Scripts/MaxEventExecutor.cs.meta index a96a577..18ba126 100644 --- a/MaxSdk/Scripts/Editor/MaxInitialization.cs.meta +++ b/MaxSdk/Scripts/MaxEventExecutor.cs.meta @@ -1,8 +1,8 @@ fileFormatVersion: 2 -guid: bc0c5693335e0408a95293c0d7b61137 +guid: 4715dd62632564dc4810a4dc98243f4a labels: - al_max -- al_max_export_path-MaxSdk/Scripts/Editor/MaxInitialization.cs +- al_max_export_path-MaxSdk/Scripts/MaxEventExecutor.cs MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/MaxSdk/Scripts/MaxSdk.cs b/MaxSdk/Scripts/MaxSdk.cs index 9d24ee3..05e7a99 100644 --- a/MaxSdk/Scripts/MaxSdk.cs +++ b/MaxSdk/Scripts/MaxSdk.cs @@ -18,7 +18,7 @@ public class MaxSdk : MaxSdkUnityEditor #endif { - private const string _version = "6.1.2"; + private const string _version = "6.5.2"; /// /// Returns the current plugin version. diff --git a/MaxSdk/Scripts/MaxSdkAndroid.cs b/MaxSdk/Scripts/MaxSdkAndroid.cs index 0ed7612..fd38238 100644 --- a/MaxSdk/Scripts/MaxSdkAndroid.cs +++ b/MaxSdk/Scripts/MaxSdkAndroid.cs @@ -20,7 +20,7 @@ public class MaxSdkAndroid : MaxSdkBase static MaxSdkAndroid() { - InitCallbacks(); + InitializeEventExecutor(); } #region Initialization @@ -30,6 +30,7 @@ public class MaxSdkAndroid : MaxSdkBase /// /// This method must be called before any other SDK operation /// + /// AppLovin SDK Key. Must not be null. public static void SetSdkKey(string sdkKey) { MaxUnityPluginClass.CallStatic("setSdkKey", sdkKey); @@ -69,7 +70,7 @@ public class MaxSdkAndroid : MaxSdkBase /// For example, a username or email. We'll include this in the postback when we ping your currency endpoint from our server. /// /// - /// The user identifier to be set. + /// The user identifier to be set. Must not be null. public static void SetUserId(string userId) { MaxUnityPluginClass.CallStatic("setUserId", userId); @@ -131,8 +132,8 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Returns the arbitrary ad value for a given ad unit identifier with key. Returns null if no ad is loaded. /// - /// - /// Ad value key + /// Ad unit identifier for which to get the ad value for. Must not be null. + /// Ad value key. Must not be null. /// Arbitrary ad value for a given key, or null if no ad is loaded. public static string GetAdValue(string adUnitIdentifier, string key) { @@ -247,8 +248,8 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Create a new banner. /// - /// Ad unit identifier of the banner to create - /// Banner position + /// Ad unit identifier of the banner to create. Must not be null. + /// Banner position. Must not be null. public static void CreateBanner(string adUnitIdentifier, BannerPosition bannerPosition) { ValidateAdUnitIdentifier(adUnitIdentifier, "create banner"); @@ -258,7 +259,7 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Create a new banner with a custom position. /// - /// Ad unit identifier of the banner to create + /// Ad unit identifier of the banner to create. Must not be null. /// The X coordinate (horizontal position) of the banner relative to the top left corner of the screen. /// The Y coordinate (vertical position) of the banner relative to the top left corner of the screen. /// @@ -275,7 +276,7 @@ public class MaxSdkAndroid : MaxSdkBase /// NOTE: The method loads the first banner ad and initiates an automated banner refresh process. /// You only need to call this method if you pause banner refresh. /// - /// Ad unit identifier of the banner to load + /// Ad unit identifier of the banner to load. Must not be null. public static void LoadBanner(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "load banner"); @@ -285,7 +286,7 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Set the banner placement for an ad unit identifier to tie the future ad events to. /// - /// Ad unit identifier of the banner to set the placement for + /// Ad unit identifier of the banner to set the placement for. Must not be null. /// Placement to set public static void SetBannerPlacement(string adUnitIdentifier, string placement) { @@ -296,7 +297,7 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Starts or resumes auto-refreshing of the banner for the given ad unit identifier. /// - /// Ad unit identifier of the banner for which to start auto-refresh + /// Ad unit identifier of the banner for which to start auto-refresh. Must not be null. public static void StartBannerAutoRefresh(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "start banner auto-refresh"); @@ -306,7 +307,7 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Pauses auto-refreshing of the banner for the given ad unit identifier. /// - /// Ad unit identifier of the banner for which to stop auto-refresh + /// Ad unit identifier of the banner for which to stop auto-refresh. Must not be null. public static void StopBannerAutoRefresh(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "stop banner auto-refresh"); @@ -316,8 +317,8 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Updates the position of the banner to the new position provided. /// - /// The ad unit identifier of the banner for which to update the position - /// A new position for the banner + /// The ad unit identifier of the banner for which to update the position. Must not be null. + /// A new position for the banner. Must not be null. public static void UpdateBannerPosition(string adUnitIdentifier, BannerPosition bannerPosition) { ValidateAdUnitIdentifier(adUnitIdentifier, "update banner position"); @@ -327,7 +328,7 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Updates the position of the banner to the new coordinates provided. /// - /// The ad unit identifier of the banner for which to update the position + /// The ad unit identifier of the banner for which to update the position. Must not be null. /// The X coordinate (horizontal position) of the banner relative to the top left corner of the screen. /// The Y coordinate (vertical position) of the banner relative to the top left corner of the screen. /// @@ -342,7 +343,7 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Overrides the width of the banner in dp. /// - /// The ad unit identifier of the banner for which to override the width for + /// The ad unit identifier of the banner for which to override the width for. Must not be null. /// The desired width of the banner in dp public static void SetBannerWidth(string adUnitIdentifier, float width) { @@ -353,7 +354,7 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Show banner at a position determined by the 'CreateBanner' call. /// - /// Ad unit identifier of the banner to show + /// Ad unit identifier of the banner to show. Must not be null. public static void ShowBanner(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "show banner"); @@ -363,7 +364,7 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Remove banner from the ad view and destroy it. /// - /// Ad unit identifier of the banner to destroy + /// Ad unit identifier of the banner to destroy. Must not be null. public static void DestroyBanner(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "destroy banner"); @@ -373,8 +374,7 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Hide banner. /// - /// Ad unit identifier of the banner to hide - /// + /// Ad unit identifier of the banner to hide. Must not be null. public static void HideBanner(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "hide banner"); @@ -384,9 +384,8 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Set non-transparent background color for banners to be fully functional. /// - /// Ad unit identifier of the banner to set background color for - /// A background color to set for the ad - /// + /// Ad unit identifier of the banner to set background color for. Must not be null. + /// A background color to set for the ad. Must not be null. public static void SetBannerBackgroundColor(string adUnitIdentifier, Color color) { ValidateAdUnitIdentifier(adUnitIdentifier, "set background color"); @@ -396,8 +395,8 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Set an extra parameter for the banner ad. /// - /// Ad unit identifier of the banner to set the extra parameter for. - /// The key for the extra parameter. + /// Ad unit identifier of the banner to set the extra parameter for. Must not be null. + /// The key for the extra parameter. Must not be null. /// The value for the extra parameter. public static void SetBannerExtraParameter(string adUnitIdentifier, string key, string value) { @@ -408,8 +407,8 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Set a local extra parameter for the banner ad. /// - /// Ad unit identifier of the banner to set the local extra parameter for. - /// The key for the local extra parameter. + /// Ad unit identifier of the banner to set the local extra parameter for. Must not be null. + /// The key for the local extra parameter. Must not be null. /// The value for the extra parameter. Accepts the following types: , null, IList, IDictionary, string, primitive types public static void SetBannerLocalExtraParameter(string adUnitIdentifier, string key, object value) { @@ -428,7 +427,7 @@ public class MaxSdkAndroid : MaxSdkBase /// /// The custom data to tie the showing banner ad to, for ILRD and rewarded postbacks via the {CUSTOM_DATA} macro. Maximum size is 8KB. /// - /// Banner ad unit identifier of the banner to set the custom data for. + /// Banner ad unit identifier of the banner to set the custom data for. Must not be null. /// The custom data to be set. public static void SetBannerCustomData(string adUnitIdentifier, string customData) { @@ -440,7 +439,7 @@ public class MaxSdkAndroid : MaxSdkBase /// The banner position on the screen. When setting the banner position via or , /// the banner is placed within the safe area of the screen. This returns the absolute position of the banner on screen. /// - /// Ad unit identifier of the banner for which to get the position on screen. + /// Ad unit identifier of the banner for which to get the position on screen. Must not be null. /// A representing the banner position on screen. public static Rect GetBannerLayout(string adUnitIdentifier) { @@ -456,8 +455,8 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Create a new MREC. /// - /// Ad unit identifier of the MREC to create - /// MREC position + /// Ad unit identifier of the MREC to create. Must not be null. + /// MREC position. Must not be null. public static void CreateMRec(string adUnitIdentifier, AdViewPosition mrecPosition) { ValidateAdUnitIdentifier(adUnitIdentifier, "create MREC"); @@ -467,7 +466,7 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Create a new MREC with a custom position. /// - /// Ad unit identifier of the MREC to create + /// Ad unit identifier of the MREC to create. Must not be null. /// The X coordinate (horizontal position) of the MREC relative to the top left corner of the screen. /// The Y coordinate (vertical position) of the MREC relative to the top left corner of the screen. /// @@ -484,7 +483,7 @@ public class MaxSdkAndroid : MaxSdkBase /// NOTE: The method loads the first MREC ad and initiates an automated MREC refresh process. /// You only need to call this method if you pause MREC refresh. /// - /// Ad unit identifier of the MREC to load + /// Ad unit identifier of the MREC to load. Must not be null. public static void LoadMRec(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "load MREC"); @@ -494,7 +493,7 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Set the MREC placement for an ad unit identifier to tie the future ad events to. /// - /// Ad unit identifier of the MREC to set the placement for + /// Ad unit identifier of the MREC to set the placement for. Must not be null. /// Placement to set public static void SetMRecPlacement(string adUnitIdentifier, string placement) { @@ -505,7 +504,7 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Starts or resumes auto-refreshing of the MREC for the given ad unit identifier. /// - /// Ad unit identifier of the MREC for which to start auto-refresh + /// Ad unit identifier of the MREC for which to start auto-refresh. Must not be null. public static void StartMRecAutoRefresh(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "start MREC auto-refresh"); @@ -515,7 +514,7 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Pauses auto-refreshing of the MREC for the given ad unit identifier. /// - /// Ad unit identifier of the MREC for which to stop auto-refresh + /// Ad unit identifier of the MREC for which to stop auto-refresh. Must not be null. public static void StopMRecAutoRefresh(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "stop MREC auto-refresh"); @@ -525,8 +524,8 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Updates the position of the MREC to the new position provided. /// - /// The ad unit identifier of the MREC for which to update the position - /// A new position for the MREC + /// The ad unit identifier of the MREC for which to update the position. Must not be null. + /// A new position for the MREC. Must not be null. public static void UpdateMRecPosition(string adUnitIdentifier, AdViewPosition mrecPosition) { ValidateAdUnitIdentifier(adUnitIdentifier, "update MREC position"); @@ -536,7 +535,7 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Updates the position of the MREC to the new coordinates provided. /// - /// The ad unit identifier of the MREC for which to update the position + /// The ad unit identifier of the MREC for which to update the position. Must not be null. /// The X coordinate (horizontal position) of the MREC relative to the top left corner of the screen. /// The Y coordinate (vertical position) of the MREC relative to the top left corner of the screen. /// @@ -551,7 +550,7 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Show MREC at a position determined by the 'CreateMRec' call. /// - /// Ad unit identifier of the MREC to show + /// Ad unit identifier of the MREC to show. Must not be null. public static void ShowMRec(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "show MREC"); @@ -561,7 +560,7 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Remove MREC from the ad view and destroy it. /// - /// Ad unit identifier of the MREC to destroy + /// Ad unit identifier of the MREC to destroy. Must not be null. public static void DestroyMRec(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "destroy MREC"); @@ -571,7 +570,7 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Hide MREC. /// - /// Ad unit identifier of the MREC to hide + /// Ad unit identifier of the MREC to hide. Must not be null. public static void HideMRec(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "hide MREC"); @@ -581,8 +580,8 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Set an extra parameter for the MREC ad. /// - /// Ad unit identifier of the MREC to set the extra parameter for. - /// The key for the extra parameter. + /// Ad unit identifier of the MREC to set the extra parameter for. Must not be null. + /// The key for the extra parameter. Must not be null. /// The value for the extra parameter. public static void SetMRecExtraParameter(string adUnitIdentifier, string key, string value) { @@ -593,8 +592,8 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Set a local extra parameter for the MREC ad. /// - /// Ad unit identifier of the MREC to set the local extra parameter for. - /// The key for the local extra parameter. + /// Ad unit identifier of the MREC to set the local extra parameter for. Must not be null. + /// The key for the local extra parameter. Must not be null. /// The value for the extra parameter. Accepts the following types: , null, IList, IDictionary, string, primitive types public static void SetMRecLocalExtraParameter(string adUnitIdentifier, string key, object value) { @@ -613,7 +612,7 @@ public class MaxSdkAndroid : MaxSdkBase /// /// The custom data to tie the showing MREC ad to, for ILRD and rewarded postbacks via the {CUSTOM_DATA} macro. Maximum size is 8KB. /// - /// MREC Ad unit identifier of the banner to set the custom data for. + /// MREC Ad unit identifier of the banner to set the custom data for. Must not be null. /// The custom data to be set. public static void SetMRecCustomData(string adUnitIdentifier, string customData) { @@ -625,7 +624,7 @@ public class MaxSdkAndroid : MaxSdkBase /// The MREC position on the screen. When setting the banner position via or , /// the banner is placed within the safe area of the screen. This returns the absolute position of the MREC on screen. /// - /// Ad unit identifier of the MREC for which to get the position on screen. + /// Ad unit identifier of the MREC for which to get the position on screen. Must not be null. /// A representing the banner position on screen. public static Rect GetMRecLayout(string adUnitIdentifier) { @@ -636,106 +635,12 @@ public class MaxSdkAndroid : MaxSdkBase #endregion - #region Cross Promo Ads - - /// - /// Create a new cross promo ad with a custom position. - /// - /// Ad unit identifier of the cross promo ad to create - /// The X coordinate (horizontal position) of the cross promo ad relative to the top left corner of the screen. - /// The Y coordinate (vertical position) of the cross promo ad relative to the top left corner of the screen. - /// The width of the cross promo ad. - /// The height of the cross promo ad. - /// The rotation of the cross promo ad in degrees. - /// - /// The cross promo is placed within the safe area of the screen. You can use this to get the absolute position Rect of the cross promo ad on screen. - /// - public static void CreateCrossPromoAd(string adUnitIdentifier, float x, float y, float width, float height, float rotation) - { - ValidateAdUnitIdentifier(adUnitIdentifier, "create cross promo ad"); - MaxUnityPluginClass.CallStatic("createCrossPromoAd", adUnitIdentifier, x, y, width, height, rotation); - } - - /// - /// Set the cross promo ad placement for an ad unit identifier to tie the future ad events to. - /// - /// Ad unit identifier of the cross promo ad to set the placement for - /// Placement to set - public static void SetCrossPromoAdPlacement(string adUnitIdentifier, string placement) - { - ValidateAdUnitIdentifier(adUnitIdentifier, "set cross promo ad placement"); - MaxUnityPluginClass.CallStatic("setCrossPromoAdPlacement", adUnitIdentifier, placement); - } - - /// - /// Updates the position of the cross promo ad to the new coordinates provided. - /// - /// The ad unit identifier of the cross promo ad for which to update the position - /// The X coordinate (horizontal position) of the cross promo ad relative to the top left corner of the screen. - /// The Y coordinate (vertical position) of the cross promo ad relative to the top left corner of the screen. - /// The width of the cross promo ad. - /// The height of the cross promo ad. - /// The rotation of the cross promo ad in degrees. - /// - /// The cross promo ad is placed within the safe area of the screen. You can use this to get the absolute position Rect of the cross promo ad on screen. - /// - public static void UpdateCrossPromoAdPosition(string adUnitIdentifier, float x, float y, float width, float height, float rotation) - { - ValidateAdUnitIdentifier(adUnitIdentifier, "update cross promo ad position"); - MaxUnityPluginClass.CallStatic("updateCrossPromoAdPosition", adUnitIdentifier, x, y, width, height, rotation); - } - - /// - /// Show cross promo ad at a position determined by the 'CreateCrossPromoAd' call. - /// - /// Ad unit identifier of the cross promo ad to show - public static void ShowCrossPromoAd(string adUnitIdentifier) - { - ValidateAdUnitIdentifier(adUnitIdentifier, "show cross promo ad"); - MaxUnityPluginClass.CallStatic("showCrossPromoAd", adUnitIdentifier); - } - - /// - /// Remove cross promo ad from the ad view and destroy it. - /// - /// Ad unit identifier of the cross promo ad to destroy - public static void DestroyCrossPromoAd(string adUnitIdentifier) - { - ValidateAdUnitIdentifier(adUnitIdentifier, "destroy cross promo ad"); - MaxUnityPluginClass.CallStatic("destroyCrossPromoAd", adUnitIdentifier); - } - - /// - /// Hide cross promo ad. - /// - /// Ad unit identifier of the cross promo ad to hide - public static void HideCrossPromoAd(string adUnitIdentifier) - { - ValidateAdUnitIdentifier(adUnitIdentifier, "hide cross promo ad"); - MaxUnityPluginClass.CallStatic("hideCrossPromoAd", adUnitIdentifier); - } - - /// - /// The cross promo ad position on the screen. When setting the cross promo ad position via or , - /// the cross promo ad is placed within the safe area of the screen. This returns the absolute position of the cross promo ad on screen. - /// - /// Ad unit identifier of the cross promo ad for which to get the position on screen. - /// A representing the banner position on screen. - public static Rect GetCrossPromoAdLayout(string adUnitIdentifier) - { - ValidateAdUnitIdentifier(adUnitIdentifier, "get cross promo ad layout"); - var positionRect = MaxUnityPluginClass.CallStatic("getCrossPromoAdLayout", adUnitIdentifier); - return GetRectFromString(positionRect); - } - - #endregion - #region Interstitials /// /// Start loading an interstitial. /// - /// Ad unit identifier of the interstitial to load + /// Ad unit identifier of the interstitial to load. Must not be null. public static void LoadInterstitial(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "load interstitial"); @@ -745,7 +650,7 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Check if interstitial ad is loaded and ready to be displayed. /// - /// Ad unit identifier of the interstitial to load + /// Ad unit identifier of the interstitial to load. Must not be null. /// True if the ad is ready to be displayed public static bool IsInterstitialReady(string adUnitIdentifier) { @@ -756,7 +661,7 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Present loaded interstitial for a given placement to tie ad events to. Note: if the interstitial is not ready to be displayed nothing will happen. /// - /// Ad unit identifier of the interstitial to load + /// Ad unit identifier of the interstitial to load. Must not be null. /// The placement to tie the showing ad's events to /// The custom data to tie the showing ad's events to. Maximum size is 8KB. public static void ShowInterstitial(string adUnitIdentifier, string placement = null, string customData = null) @@ -776,8 +681,8 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Set an extra parameter for the ad. /// - /// Ad unit identifier of the interstitial to set the extra parameter for. - /// The key for the extra parameter. + /// Ad unit identifier of the interstitial to set the extra parameter for. Must not be null. + /// The key for the extra parameter. Must not be null. /// The value for the extra parameter. public static void SetInterstitialExtraParameter(string adUnitIdentifier, string key, string value) { @@ -788,8 +693,8 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Set a local extra parameter for the ad. /// - /// Ad unit identifier of the interstitial to set the local extra parameter for. - /// The key for the local extra parameter. + /// Ad unit identifier of the interstitial to set the local extra parameter for. Must not be null. + /// The key for the local extra parameter. Must not be null. /// The value for the extra parameter. Accepts the following types: , null, IList, IDictionary, string, primitive types public static void SetInterstitialLocalExtraParameter(string adUnitIdentifier, string key, object value) { @@ -812,7 +717,7 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Start loading an app open ad. /// - /// Ad unit identifier of the app open ad to load + /// Ad unit identifier of the app open ad to load. Must not be null. public static void LoadAppOpenAd(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "load app open ad"); @@ -822,7 +727,7 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Check if app open ad ad is loaded and ready to be displayed. /// - /// Ad unit identifier of the app open ad to load + /// Ad unit identifier of the app open ad to load. Must not be null. /// True if the ad is ready to be displayed public static bool IsAppOpenAdReady(string adUnitIdentifier) { @@ -833,7 +738,7 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Present loaded app open ad for a given placement to tie ad events to. Note: if the app open ad is not ready to be displayed nothing will happen. /// - /// Ad unit identifier of the app open ad to load + /// Ad unit identifier of the app open ad to load. Must not be null. /// The placement to tie the showing ad's events to /// The custom data to tie the showing ad's events to. Maximum size is 8KB. public static void ShowAppOpenAd(string adUnitIdentifier, string placement = null, string customData = null) @@ -853,8 +758,8 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Set an extra parameter for the ad. /// - /// Ad unit identifier of the app open ad to set the extra parameter for. - /// The key for the extra parameter. + /// Ad unit identifier of the app open ad to set the extra parameter for. Must not be null. + /// The key for the extra parameter. Must not be null. /// The value for the extra parameter. public static void SetAppOpenAdExtraParameter(string adUnitIdentifier, string key, string value) { @@ -865,8 +770,8 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Set a local extra parameter for the ad. /// - /// Ad unit identifier of the app open ad to set the local extra parameter for. - /// The key for the local extra parameter. + /// Ad unit identifier of the app open ad to set the local extra parameter for. Must not be null. + /// The key for the local extra parameter. Must not be null. /// The value for the extra parameter. Accepts the following types: , null, IList, IDictionary, string, primitive types public static void SetAppOpenAdLocalExtraParameter(string adUnitIdentifier, string key, object value) { @@ -889,7 +794,7 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Start loading an rewarded ad. /// - /// Ad unit identifier of the rewarded ad to load + /// Ad unit identifier of the rewarded ad to load. Must not be null. public static void LoadRewardedAd(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "load rewarded ad"); @@ -899,7 +804,7 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Check if rewarded ad ad is loaded and ready to be displayed. /// - /// Ad unit identifier of the rewarded ad to load + /// Ad unit identifier of the rewarded ad to load. Must not be null. /// True if the ad is ready to be displayed public static bool IsRewardedAdReady(string adUnitIdentifier) { @@ -910,7 +815,7 @@ public class MaxSdkAndroid : MaxSdkBase /// ready to be /// Present loaded rewarded ad for a given placement to tie ad events to. Note: if the rewarded ad is not ready to be displayed nothing will happen. /// - /// Ad unit identifier of the interstitial to load + /// Ad unit identifier of the interstitial to load. Must not be null. /// The placement to tie the showing ad's events to /// The custom data to tie the showing ad's events to. Maximum size is 8KB. public static void ShowRewardedAd(string adUnitIdentifier, string placement = null, string customData = null) @@ -930,8 +835,8 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Set an extra parameter for the ad. /// - /// Ad unit identifier of the rewarded to set the extra parameter for. - /// The key for the extra parameter. + /// Ad unit identifier of the rewarded to set the extra parameter for. Must not be null. + /// The key for the extra parameter. Must not be null. /// The value for the extra parameter. public static void SetRewardedAdExtraParameter(string adUnitIdentifier, string key, string value) { @@ -942,8 +847,8 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Set a local extra parameter for the ad. /// - /// Ad unit identifier of the rewarded to set the local extra parameter for. - /// The key for the local extra parameter. + /// Ad unit identifier of the rewarded to set the local extra parameter for. Must not be null. + /// The key for the local extra parameter. Must not be null. /// The value for the extra parameter. Accepts the following types: , null, IList, IDictionary, string, primitive types public static void SetRewardedAdLocalExtraParameter(string adUnitIdentifier, string key, object value) { @@ -966,7 +871,7 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Start loading an rewarded interstitial ad. /// - /// Ad unit identifier of the rewarded interstitial ad to load + /// Ad unit identifier of the rewarded interstitial ad to load. Must not be null. public static void LoadRewardedInterstitialAd(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "load rewarded interstitial ad"); @@ -976,7 +881,7 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Check if rewarded interstitial ad ad is loaded and ready to be displayed. /// - /// Ad unit identifier of the rewarded interstitial ad to load + /// Ad unit identifier of the rewarded interstitial ad to load. Must not be null. /// True if the ad is ready to be displayed public static bool IsRewardedInterstitialAdReady(string adUnitIdentifier) { @@ -987,7 +892,7 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Present loaded rewarded interstitial ad for a given placement to tie ad events to. Note: if the rewarded interstitial ad is not ready to be displayed nothing will happen. /// - /// Ad unit identifier of the rewarded interstitial to show + /// Ad unit identifier of the rewarded interstitial to show. Must not be null. /// The placement to tie the showing ad's events to /// The custom data to tie the showing ad's events to. Maximum size is 8KB. public static void ShowRewardedInterstitialAd(string adUnitIdentifier, string placement = null, string customData = null) @@ -1007,8 +912,8 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Set an extra parameter for the ad. /// - /// Ad unit identifier of the rewarded interstitial to set the extra parameter for. - /// The key for the extra parameter. + /// Ad unit identifier of the rewarded interstitial to set the extra parameter for. Must not be null. + /// The key for the extra parameter. Must not be null. /// The value for the extra parameter. public static void SetRewardedInterstitialAdExtraParameter(string adUnitIdentifier, string key, string value) { @@ -1019,8 +924,8 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Set a local extra parameter for the ad. /// - /// Ad unit identifier of the rewarded interstitial to set the local extra parameter for. - /// The key for the local extra parameter. + /// Ad unit identifier of the rewarded interstitial to set the local extra parameter for. Must not be null. + /// The key for the local extra parameter. Must not be null. /// The value for the extra parameter. Accepts the following types: , null, IList, IDictionary, string, primitive types public static void SetRewardedInterstitialAdLocalExtraParameter(string adUnitIdentifier, string key, object value) { @@ -1043,7 +948,7 @@ public class MaxSdkAndroid : MaxSdkBase /// /// Track an event using AppLovin. /// - /// An event from the list of pre-defined events may be found in MaxEvents.cs as part of the AppLovin SDK framework. + /// An event from the list of pre-defined events may be found in MaxEvents.cs as part of the AppLovin SDK framework. Must not be null. /// A dictionary containing key-value pairs further describing this event. public static void TrackEvent(string name, IDictionary parameters = null) { @@ -1149,6 +1054,25 @@ public class MaxSdkAndroid : MaxSdkBase MaxUnityPluginClass.CallStatic("setExtraParameter", key, value); } + /// + /// Get the native insets in pixels for the safe area. + /// These insets are used to position ads within the safe area of the screen. + /// + public static SafeAreaInsets GetSafeAreaInsets() + { + // Use an int array instead of json serialization for performance + var insets = MaxUnityPluginClass.CallStatic("getSafeAreaInsets"); + + // Convert from points to pixels + var screenDensity = MaxSdkUtils.GetScreenDensity(); + for (var i = 0; i < insets.Length; i++) + { + insets[i] *= (int) screenDensity; + } + + return new SafeAreaInsets(insets); + } + #endregion #region Private diff --git a/MaxSdk/Scripts/MaxSdkBase.cs b/MaxSdk/Scripts/MaxSdkBase.cs index dfe1228..dacb7af 100644 --- a/MaxSdk/Scripts/MaxSdkBase.cs +++ b/MaxSdk/Scripts/MaxSdkBase.cs @@ -5,6 +5,7 @@ using System.Globalization; using System.Linq; using System.Text; using AppLovinMax.ThirdParty.MiniJson; +using AppLovinMax.Internal; using UnityEngine; #if UNITY_IOS && !UNITY_EDITOR @@ -168,7 +169,6 @@ public abstract class MaxSdkBase sdkConfiguration.ConsentFlowUserGeography = ConsentFlowUserGeography.Unknown; } - #pragma warning disable 0618 var consentDialogStateStr = MaxSdkUtils.GetStringFromDictionary(eventProps, "consentDialogState", ""); if ("1".Equals(consentDialogStateStr)) @@ -325,6 +325,7 @@ public abstract class MaxSdkBase public double Revenue { get; private set; } public string RevenuePrecision { get; private set; } public WaterfallInfo WaterfallInfo { get; private set; } + public long LatencyMillis { get; private set; } public string DspName { get; private set; } public AdInfo(IDictionary adInfoDictionary) @@ -338,6 +339,7 @@ public abstract class MaxSdkBase Revenue = MaxSdkUtils.GetDoubleFromDictionary(adInfoDictionary, "revenue", -1); RevenuePrecision = MaxSdkUtils.GetStringFromDictionary(adInfoDictionary, "revenuePrecision"); WaterfallInfo = new WaterfallInfo(MaxSdkUtils.GetDictionaryFromDictionary(adInfoDictionary, "waterfallInfo", new Dictionary())); + LatencyMillis = MaxSdkUtils.GetLongFromDictionary(adInfoDictionary, "latencyMillis"); DspName = MaxSdkUtils.GetStringFromDictionary(adInfoDictionary, "dspName"); } @@ -351,6 +353,7 @@ public abstract class MaxSdkBase ", placement: " + Placement + ", revenue: " + Revenue + ", revenuePrecision: " + RevenuePrecision + + ", latency: " + LatencyMillis + ", dspName: " + DspName + "]"; } } @@ -469,6 +472,7 @@ public abstract class MaxSdkBase public string MediatedNetworkErrorMessage { get; private set; } public string AdLoadFailureInfo { get; private set; } public WaterfallInfo WaterfallInfo { get; private set; } + public long LatencyMillis { get; private set; } public ErrorInfo(IDictionary errorInfoDictionary) { @@ -478,6 +482,7 @@ public abstract class MaxSdkBase MediatedNetworkErrorMessage = MaxSdkUtils.GetStringFromDictionary(errorInfoDictionary, "mediatedNetworkErrorMessage", ""); AdLoadFailureInfo = MaxSdkUtils.GetStringFromDictionary(errorInfoDictionary, "adLoadFailureInfo", ""); WaterfallInfo = new WaterfallInfo(MaxSdkUtils.GetDictionaryFromDictionary(errorInfoDictionary, "waterfallInfo", new Dictionary())); + LatencyMillis = MaxSdkUtils.GetLongFromDictionary(errorInfoDictionary, "latencyMillis"); } public override string ToString() @@ -491,10 +496,47 @@ public abstract class MaxSdkBase stringbuilder.Append(", mediatedNetworkMessage: ").Append(MediatedNetworkErrorMessage); } + stringbuilder.Append(", latency: ").Append(LatencyMillis); return stringbuilder.Append(", adLoadFailureInfo: ").Append(AdLoadFailureInfo).Append("]").ToString(); } } + /// + /// Inset values for the safe area on the screen used to render banner ads. + /// + public class SafeAreaInsets + { + public int Left { get; private set; } + public int Top { get; private set; } + public int Right { get; private set; } + public int Bottom { get; private set; } + + /// + /// Creates a new instance of . + /// + /// An integer array with insets values in the order of left, top, right, and bottom + internal SafeAreaInsets(int[] insets) + { + Left = insets[0]; + Top = insets[1]; + Right = insets[2]; + Bottom = insets[3]; + } + + public override string ToString() + { + return "[SafeAreaInsets: Left: " + Left + + ", Top: " + Top + + ", Right: " + Right + + ", Bottom: " + Bottom + "]"; + } + } + + /// + /// Determines whether ad events raised by the AppLovin's Unity plugin should be invoked on the Unity main thread. + /// + public static bool? InvokeEventsOnUnityMainThread { get; set; } + /// /// The CMP service, which provides direct APIs for interfacing with the Google-certified CMP installed, if any. /// @@ -511,16 +553,10 @@ public abstract class MaxSdkBase } } - // Allocate the MaxSdkCallbacks singleton, which receives all callback events from the native SDKs. - protected static void InitCallbacks() + // Allocate the MaxEventExecutor singleton which handles pushing callbacks from the background to the main thread. + protected static void InitializeEventExecutor() { - var type = typeof(MaxSdkCallbacks); - var mgr = new GameObject("MaxSdkCallbacks", type) - .GetComponent(); // Its Awake() method sets Instance. - if (MaxSdkCallbacks.Instance != mgr) - { - MaxSdkLogger.UserWarning("It looks like you have the " + type.Name + " on a GameObject in your scene. Please remove the script from your scene."); - } + MaxEventExecutor.InitializeIfNeeded(); } /// @@ -562,7 +598,7 @@ public abstract class MaxSdkBase { try { - MaxSdkCallbacks.Instance.ForwardEvent(propsStr); + MaxSdkCallbacks.ForwardEvent(propsStr); } catch (Exception exception) { diff --git a/MaxSdk/Scripts/MaxSdkCallbacks.cs b/MaxSdk/Scripts/MaxSdkCallbacks.cs index bf3084f..d2e3522 100644 --- a/MaxSdk/Scripts/MaxSdkCallbacks.cs +++ b/MaxSdk/Scripts/MaxSdkCallbacks.cs @@ -7,30 +7,10 @@ using System.Collections.Generic; using System.Globalization; using UnityEngine; using AppLovinMax.ThirdParty.MiniJson; +using AppLovinMax.Internal; -public class MaxSdkCallbacks : MonoBehaviour +public static class MaxSdkCallbacks { -#if UNITY_EDITOR - private static MaxSdkCallbacks instance; -#endif - - public static MaxSdkCallbacks Instance - { -#if UNITY_EDITOR - get - { - if (instance != null) return instance; - - instance = new GameObject("MaxSdkCallbacks", typeof(MaxSdkCallbacks)).GetComponent(); - DontDestroyOnLoad(instance); - - return instance; - } -#else - get; private set; -#endif - } - // Fired when the SDK has finished initializing private static Action _onSdkInitializedEvent; public static event Action OnSdkInitializedEvent @@ -63,6 +43,24 @@ public class MaxSdkCallbacks : MonoBehaviour } } + private static Action _onApplicationStateChangedEvent; + /// + /// Fired when the application is paused or resumed. + /// + public static event Action OnApplicationStateChangedEvent + { + add + { + LogSubscribedToEvent("OnApplicationStateChangedEvent"); + _onApplicationStateChangedEvent += value; + } + remove + { + LogUnsubscribedToEvent("OnApplicationStateChangedEvent"); + _onApplicationStateChangedEvent -= value; + } + } + private static Action _onInterstitialAdLoadedEventV2; private static Action _onInterstitialAdLoadFailedEventV2; private static Action _onInterstitialAdDisplayedEventV2; @@ -844,100 +842,6 @@ public class MaxSdkCallbacks : MonoBehaviour } } - private static Action _onCrossPromoAdLoadedEvent; - private static Action _onCrossPromoAdLoadFailedEvent; - private static Action _onCrossPromoAdClickedEvent; - private static Action _onCrossPromoAdRevenuePaidEvent; - private static Action _onCrossPromoAdExpandedEvent; - private static Action _onCrossPromoAdCollapsedEvent; - - public class CrossPromo - { - public static event Action OnAdLoadedEvent - { - add - { - LogSubscribedToEvent("OnCrossPromoAdLoadedEvent"); - _onCrossPromoAdLoadedEvent += value; - } - remove - { - LogUnsubscribedToEvent("OnCrossPromoAdLoadedEvent"); - _onCrossPromoAdLoadedEvent -= value; - } - } - - public static event Action OnAdLoadFailedEvent - { - add - { - LogSubscribedToEvent("OnCrossPromoAdLoadFailedEvent"); - _onCrossPromoAdLoadFailedEvent += value; - } - remove - { - LogUnsubscribedToEvent("OnCrossPromoAdLoadFailedEvent"); - _onCrossPromoAdLoadFailedEvent -= value; - } - } - - public static event Action OnAdClickedEvent - { - add - { - LogSubscribedToEvent("OnCrossPromoAdClickedEvent"); - _onCrossPromoAdClickedEvent += value; - } - remove - { - LogUnsubscribedToEvent("OnCrossPromoAdClickedEvent"); - _onCrossPromoAdClickedEvent -= value; - } - } - - public static event Action OnAdRevenuePaidEvent - { - add - { - LogSubscribedToEvent("OnCrossPromoAdRevenuePaidEvent"); - _onCrossPromoAdRevenuePaidEvent += value; - } - remove - { - LogUnsubscribedToEvent("OnCrossPromoAdRevenuePaidEvent"); - _onCrossPromoAdRevenuePaidEvent -= value; - } - } - - public static event Action OnAdExpandedEvent - { - add - { - LogSubscribedToEvent("OnCrossPromoAdExpandedEvent"); - _onCrossPromoAdExpandedEvent += value; - } - remove - { - LogUnsubscribedToEvent("OnCrossPromoAdExpandedEvent"); - _onCrossPromoAdExpandedEvent -= value; - } - } - - public static event Action OnAdCollapsedEvent - { - add - { - LogSubscribedToEvent("OnCrossPromoAdCollapsedEvent"); - _onCrossPromoAdCollapsedEvent += value; - } - remove - { - LogUnsubscribedToEvent("OnCrossPromoAdCollapsedEvent"); - _onCrossPromoAdCollapsedEvent -= value; - } - } - } - private static Action _onBannerAdLoadedEvent; private static Action _onBannerAdLoadFailedEvent; private static Action _onBannerAdClickedEvent; @@ -1312,18 +1216,7 @@ public class MaxSdkCallbacks : MonoBehaviour } } -#if !UNITY_EDITOR - void Awake() - { - if (Instance == null) - { - Instance = this; - DontDestroyOnLoad(gameObject); - } - } -#endif - - public void ForwardEvent(string eventPropsStr) + public static void ForwardEvent(string eventPropsStr) { var eventProps = Json.Deserialize(eventPropsStr) as Dictionary; if (eventProps == null) @@ -1332,6 +1225,7 @@ public class MaxSdkCallbacks : MonoBehaviour return; } + var keepInBackground = MaxSdkUtils.GetBoolFromDictionary(eventProps, "keepInBackground", false); var eventName = MaxSdkUtils.GetStringFromDictionary(eventProps, "name", ""); if (eventName == "OnInitialCallbackEvent") { @@ -1340,17 +1234,22 @@ public class MaxSdkCallbacks : MonoBehaviour else if (eventName == "OnSdkInitializedEvent") { var sdkConfiguration = MaxSdkBase.SdkConfiguration.Create(eventProps); - InvokeEvent(_onSdkInitializedEvent, sdkConfiguration, eventName); + InvokeEvent(_onSdkInitializedEvent, sdkConfiguration, eventName, keepInBackground); } else if (eventName == "OnSdkConsentDialogDismissedEvent") { - InvokeEvent(_onSdkConsentDialogDismissedEvent, eventName); + InvokeEvent(_onSdkConsentDialogDismissedEvent, eventName, keepInBackground); } else if (eventName == "OnCmpCompletedEvent") { var errorProps = MaxSdkUtils.GetDictionaryFromDictionary(eventProps, "error"); MaxCmpService.NotifyCompletedIfNeeded(errorProps); } + else if (eventName == "OnApplicationStateChanged") + { + var isPaused = MaxSdkUtils.GetBoolFromDictionary(eventProps, "isPaused"); + InvokeEvent(_onApplicationStateChangedEvent, isPaused, eventName, keepInBackground); + } // Ad Events else { @@ -1358,223 +1257,197 @@ public class MaxSdkCallbacks : MonoBehaviour var adUnitIdentifier = MaxSdkUtils.GetStringFromDictionary(eventProps, "adUnitId", ""); if (eventName == "OnBannerAdLoadedEvent") { - InvokeEvent(_onBannerAdLoadedEvent, adUnitIdentifier, eventName); - InvokeEvent(_onBannerAdLoadedEventV2, adUnitIdentifier, adInfo, eventName); + InvokeEvent(_onBannerAdLoadedEvent, adUnitIdentifier, eventName, keepInBackground); + InvokeEvent(_onBannerAdLoadedEventV2, adUnitIdentifier, adInfo, eventName, keepInBackground); } else if (eventName == "OnBannerAdLoadFailedEvent") { var errorCode = MaxSdkUtils.GetIntFromDictionary(eventProps, "errorCode", -1); - InvokeEvent(_onBannerAdLoadFailedEvent, adUnitIdentifier, errorCode, eventName); + InvokeEvent(_onBannerAdLoadFailedEvent, adUnitIdentifier, errorCode, eventName, keepInBackground); var errorInfo = new MaxSdkBase.ErrorInfo(eventProps); - InvokeEvent(_onBannerAdLoadFailedEventV2, adUnitIdentifier, errorInfo, eventName); + InvokeEvent(_onBannerAdLoadFailedEventV2, adUnitIdentifier, errorInfo, eventName, keepInBackground); } else if (eventName == "OnBannerAdClickedEvent") { - InvokeEvent(_onBannerAdClickedEvent, adUnitIdentifier, eventName); - InvokeEvent(_onBannerAdClickedEventV2, adUnitIdentifier, adInfo, eventName); + InvokeEvent(_onBannerAdClickedEvent, adUnitIdentifier, eventName, keepInBackground); + InvokeEvent(_onBannerAdClickedEventV2, adUnitIdentifier, adInfo, eventName, keepInBackground); } else if (eventName == "OnBannerAdRevenuePaidEvent") { - InvokeEvent(_onBannerAdRevenuePaidEvent, adUnitIdentifier, adInfo, eventName); + InvokeEvent(_onBannerAdRevenuePaidEvent, adUnitIdentifier, adInfo, eventName, keepInBackground); } else if (eventName == "OnBannerAdReviewCreativeIdGeneratedEvent") { var adReviewCreativeId = MaxSdkUtils.GetStringFromDictionary(eventProps, "adReviewCreativeId", ""); - InvokeEvent(_onBannerAdReviewCreativeIdGeneratedEvent, adUnitIdentifier, adReviewCreativeId, adInfo, eventName); + InvokeEvent(_onBannerAdReviewCreativeIdGeneratedEvent, adUnitIdentifier, adReviewCreativeId, adInfo, eventName, keepInBackground); } else if (eventName == "OnBannerAdExpandedEvent") { - InvokeEvent(_onBannerAdExpandedEvent, adUnitIdentifier, eventName); - InvokeEvent(_onBannerAdExpandedEventV2, adUnitIdentifier, adInfo, eventName); + InvokeEvent(_onBannerAdExpandedEvent, adUnitIdentifier, eventName, keepInBackground); + InvokeEvent(_onBannerAdExpandedEventV2, adUnitIdentifier, adInfo, eventName, keepInBackground); } else if (eventName == "OnBannerAdCollapsedEvent") { - InvokeEvent(_onBannerAdCollapsedEvent, adUnitIdentifier, eventName); - InvokeEvent(_onBannerAdCollapsedEventV2, adUnitIdentifier, adInfo, eventName); + InvokeEvent(_onBannerAdCollapsedEvent, adUnitIdentifier, eventName, keepInBackground); + InvokeEvent(_onBannerAdCollapsedEventV2, adUnitIdentifier, adInfo, eventName, keepInBackground); } else if (eventName == "OnMRecAdLoadedEvent") { - InvokeEvent(_onMRecAdLoadedEvent, adUnitIdentifier, eventName); - InvokeEvent(_onMRecAdLoadedEventV2, adUnitIdentifier, adInfo, eventName); + InvokeEvent(_onMRecAdLoadedEvent, adUnitIdentifier, eventName, keepInBackground); + InvokeEvent(_onMRecAdLoadedEventV2, adUnitIdentifier, adInfo, eventName, keepInBackground); } else if (eventName == "OnMRecAdLoadFailedEvent") { var errorCode = MaxSdkUtils.GetIntFromDictionary(eventProps, "errorCode", -1); - InvokeEvent(_onMRecAdLoadFailedEvent, adUnitIdentifier, errorCode, eventName); + InvokeEvent(_onMRecAdLoadFailedEvent, adUnitIdentifier, errorCode, eventName, keepInBackground); var errorInfo = new MaxSdkBase.ErrorInfo(eventProps); - InvokeEvent(_onMRecAdLoadFailedEventV2, adUnitIdentifier, errorInfo, eventName); + InvokeEvent(_onMRecAdLoadFailedEventV2, adUnitIdentifier, errorInfo, eventName, keepInBackground); } else if (eventName == "OnMRecAdClickedEvent") { - InvokeEvent(_onMRecAdClickedEvent, adUnitIdentifier, eventName); - InvokeEvent(_onMRecAdClickedEventV2, adUnitIdentifier, adInfo, eventName); + InvokeEvent(_onMRecAdClickedEvent, adUnitIdentifier, eventName, keepInBackground); + InvokeEvent(_onMRecAdClickedEventV2, adUnitIdentifier, adInfo, eventName, keepInBackground); } else if (eventName == "OnMRecAdRevenuePaidEvent") { - InvokeEvent(_onMRecAdRevenuePaidEvent, adUnitIdentifier, adInfo, eventName); + InvokeEvent(_onMRecAdRevenuePaidEvent, adUnitIdentifier, adInfo, eventName, keepInBackground); } else if (eventName == "OnMRecAdReviewCreativeIdGeneratedEvent") { var adReviewCreativeId = MaxSdkUtils.GetStringFromDictionary(eventProps, "adReviewCreativeId", ""); - InvokeEvent(_onMRecAdReviewCreativeIdGeneratedEvent, adUnitIdentifier, adReviewCreativeId, adInfo, eventName); + InvokeEvent(_onMRecAdReviewCreativeIdGeneratedEvent, adUnitIdentifier, adReviewCreativeId, adInfo, eventName, keepInBackground); } else if (eventName == "OnMRecAdExpandedEvent") { - InvokeEvent(_onMRecAdExpandedEvent, adUnitIdentifier, eventName); - InvokeEvent(_onMRecAdExpandedEventV2, adUnitIdentifier, adInfo, eventName); + InvokeEvent(_onMRecAdExpandedEvent, adUnitIdentifier, eventName, keepInBackground); + InvokeEvent(_onMRecAdExpandedEventV2, adUnitIdentifier, adInfo, eventName, keepInBackground); } else if (eventName == "OnMRecAdCollapsedEvent") { - InvokeEvent(_onMRecAdCollapsedEvent, adUnitIdentifier, eventName); - InvokeEvent(_onMRecAdCollapsedEventV2, adUnitIdentifier, adInfo, eventName); - } - else if (eventName == "OnCrossPromoAdLoadedEvent") - { - InvokeEvent(_onCrossPromoAdLoadedEvent, adUnitIdentifier, adInfo, eventName); - } - else if (eventName == "OnCrossPromoAdLoadFailedEvent") - { - var errorInfo = new MaxSdkBase.ErrorInfo(eventProps); - - InvokeEvent(_onCrossPromoAdLoadFailedEvent, adUnitIdentifier, errorInfo, eventName); - } - else if (eventName == "OnCrossPromoAdClickedEvent") - { - InvokeEvent(_onCrossPromoAdClickedEvent, adUnitIdentifier, adInfo, eventName); - } - else if (eventName == "OnCrossPromoAdRevenuePaidEvent") - { - InvokeEvent(_onCrossPromoAdRevenuePaidEvent, adUnitIdentifier, adInfo, eventName); - } - else if (eventName == "OnCrossPromoAdExpandedEvent") - { - InvokeEvent(_onCrossPromoAdExpandedEvent, adUnitIdentifier, adInfo, eventName); - } - else if (eventName == "OnCrossPromoAdCollapsedEvent") - { - InvokeEvent(_onCrossPromoAdCollapsedEvent, adUnitIdentifier, adInfo, eventName); + InvokeEvent(_onMRecAdCollapsedEvent, adUnitIdentifier, eventName, keepInBackground); + InvokeEvent(_onMRecAdCollapsedEventV2, adUnitIdentifier, adInfo, eventName, keepInBackground); } else if (eventName == "OnInterstitialLoadedEvent") { - InvokeEvent(_onInterstitialAdLoadedEvent, adUnitIdentifier, eventName); - InvokeEvent(_onInterstitialAdLoadedEventV2, adUnitIdentifier, adInfo, eventName); + InvokeEvent(_onInterstitialAdLoadedEvent, adUnitIdentifier, eventName, keepInBackground); + InvokeEvent(_onInterstitialAdLoadedEventV2, adUnitIdentifier, adInfo, eventName, keepInBackground); } else if (eventName == "OnInterstitialLoadFailedEvent") { var errorCode = MaxSdkUtils.GetIntFromDictionary(eventProps, "errorCode", -1); - InvokeEvent(_onInterstitialLoadFailedEvent, adUnitIdentifier, errorCode, eventName); + InvokeEvent(_onInterstitialLoadFailedEvent, adUnitIdentifier, errorCode, eventName, keepInBackground); var errorInfo = new MaxSdkBase.ErrorInfo(eventProps); - InvokeEvent(_onInterstitialAdLoadFailedEventV2, adUnitIdentifier, errorInfo, eventName); + InvokeEvent(_onInterstitialAdLoadFailedEventV2, adUnitIdentifier, errorInfo, eventName, keepInBackground); } else if (eventName == "OnInterstitialHiddenEvent") { - InvokeEvent(_onInterstitialAdHiddenEvent, adUnitIdentifier, eventName); - InvokeEvent(_onInterstitialAdHiddenEventV2, adUnitIdentifier, adInfo, eventName); + InvokeEvent(_onInterstitialAdHiddenEvent, adUnitIdentifier, eventName, keepInBackground); + InvokeEvent(_onInterstitialAdHiddenEventV2, adUnitIdentifier, adInfo, eventName, keepInBackground); } else if (eventName == "OnInterstitialDisplayedEvent") { - InvokeEvent(_onInterstitialAdDisplayedEvent, adUnitIdentifier, eventName); - InvokeEvent(_onInterstitialAdDisplayedEventV2, adUnitIdentifier, adInfo, eventName); + InvokeEvent(_onInterstitialAdDisplayedEvent, adUnitIdentifier, eventName, keepInBackground); + InvokeEvent(_onInterstitialAdDisplayedEventV2, adUnitIdentifier, adInfo, eventName, keepInBackground); } else if (eventName == "OnInterstitialAdFailedToDisplayEvent") { var errorCode = MaxSdkUtils.GetIntFromDictionary(eventProps, "errorCode", -1); - InvokeEvent(_onInterstitialAdFailedToDisplayEvent, adUnitIdentifier, errorCode, eventName); + InvokeEvent(_onInterstitialAdFailedToDisplayEvent, adUnitIdentifier, errorCode, eventName, keepInBackground); var errorInfo = new MaxSdkBase.ErrorInfo(eventProps); - InvokeEvent(_onInterstitialAdFailedToDisplayEventV2, adUnitIdentifier, errorInfo, adInfo, eventName); + InvokeEvent(_onInterstitialAdFailedToDisplayEventV2, adUnitIdentifier, errorInfo, adInfo, eventName, keepInBackground); } else if (eventName == "OnInterstitialClickedEvent") { - InvokeEvent(_onInterstitialAdClickedEvent, adUnitIdentifier, eventName); - InvokeEvent(_onInterstitialAdClickedEventV2, adUnitIdentifier, adInfo, eventName); + InvokeEvent(_onInterstitialAdClickedEvent, adUnitIdentifier, eventName, keepInBackground); + InvokeEvent(_onInterstitialAdClickedEventV2, adUnitIdentifier, adInfo, eventName, keepInBackground); } else if (eventName == "OnInterstitialAdRevenuePaidEvent") { - InvokeEvent(_onInterstitialAdRevenuePaidEvent, adUnitIdentifier, adInfo, eventName); + InvokeEvent(_onInterstitialAdRevenuePaidEvent, adUnitIdentifier, adInfo, eventName, keepInBackground); } else if (eventName == "OnInterstitialAdReviewCreativeIdGeneratedEvent") { var adReviewCreativeId = MaxSdkUtils.GetStringFromDictionary(eventProps, "adReviewCreativeId", ""); - InvokeEvent(_onInterstitialAdReviewCreativeIdGeneratedEvent, adUnitIdentifier, adReviewCreativeId, adInfo, eventName); + InvokeEvent(_onInterstitialAdReviewCreativeIdGeneratedEvent, adUnitIdentifier, adReviewCreativeId, adInfo, eventName, keepInBackground); } else if (eventName == "OnAppOpenAdLoadedEvent") { - InvokeEvent(_onAppOpenAdLoadedEvent, adUnitIdentifier, adInfo, eventName); + InvokeEvent(_onAppOpenAdLoadedEvent, adUnitIdentifier, adInfo, eventName, keepInBackground); } else if (eventName == "OnAppOpenAdLoadFailedEvent") { var errorInfo = new MaxSdkBase.ErrorInfo(eventProps); - InvokeEvent(_onAppOpenAdLoadFailedEvent, adUnitIdentifier, errorInfo, eventName); + InvokeEvent(_onAppOpenAdLoadFailedEvent, adUnitIdentifier, errorInfo, eventName, keepInBackground); } else if (eventName == "OnAppOpenAdHiddenEvent") { - InvokeEvent(_onAppOpenAdHiddenEvent, adUnitIdentifier, adInfo, eventName); + InvokeEvent(_onAppOpenAdHiddenEvent, adUnitIdentifier, adInfo, eventName, keepInBackground); } else if (eventName == "OnAppOpenAdDisplayedEvent") { - InvokeEvent(_onAppOpenAdDisplayedEvent, adUnitIdentifier, adInfo, eventName); + InvokeEvent(_onAppOpenAdDisplayedEvent, adUnitIdentifier, adInfo, eventName, keepInBackground); } else if (eventName == "OnAppOpenAdFailedToDisplayEvent") { var errorInfo = new MaxSdkBase.ErrorInfo(eventProps); - InvokeEvent(_onAppOpenAdFailedToDisplayEvent, adUnitIdentifier, errorInfo, adInfo, eventName); + InvokeEvent(_onAppOpenAdFailedToDisplayEvent, adUnitIdentifier, errorInfo, adInfo, eventName, keepInBackground); } else if (eventName == "OnAppOpenAdClickedEvent") { - InvokeEvent(_onAppOpenAdClickedEvent, adUnitIdentifier, adInfo, eventName); + InvokeEvent(_onAppOpenAdClickedEvent, adUnitIdentifier, adInfo, eventName, keepInBackground); } else if (eventName == "OnAppOpenAdRevenuePaidEvent") { - InvokeEvent(_onAppOpenAdRevenuePaidEvent, adUnitIdentifier, adInfo, eventName); + InvokeEvent(_onAppOpenAdRevenuePaidEvent, adUnitIdentifier, adInfo, eventName, keepInBackground); } else if (eventName == "OnRewardedAdLoadedEvent") { - InvokeEvent(_onRewardedAdLoadedEvent, adUnitIdentifier, eventName); - InvokeEvent(_onRewardedAdLoadedEventV2, adUnitIdentifier, adInfo, eventName); + InvokeEvent(_onRewardedAdLoadedEvent, adUnitIdentifier, eventName, keepInBackground); + InvokeEvent(_onRewardedAdLoadedEventV2, adUnitIdentifier, adInfo, eventName, keepInBackground); } else if (eventName == "OnRewardedAdLoadFailedEvent") { var errorCode = MaxSdkUtils.GetIntFromDictionary(eventProps, "errorCode", -1); - InvokeEvent(_onRewardedAdLoadFailedEvent, adUnitIdentifier, errorCode, eventName); + InvokeEvent(_onRewardedAdLoadFailedEvent, adUnitIdentifier, errorCode, eventName, keepInBackground); var errorInfo = new MaxSdkBase.ErrorInfo(eventProps); - InvokeEvent(_onRewardedAdLoadFailedEventV2, adUnitIdentifier, errorInfo, eventName); + InvokeEvent(_onRewardedAdLoadFailedEventV2, adUnitIdentifier, errorInfo, eventName, keepInBackground); } else if (eventName == "OnRewardedAdDisplayedEvent") { - InvokeEvent(_onRewardedAdDisplayedEvent, adUnitIdentifier, eventName); - InvokeEvent(_onRewardedAdDisplayedEventV2, adUnitIdentifier, adInfo, eventName); + InvokeEvent(_onRewardedAdDisplayedEvent, adUnitIdentifier, eventName, keepInBackground); + InvokeEvent(_onRewardedAdDisplayedEventV2, adUnitIdentifier, adInfo, eventName, keepInBackground); } else if (eventName == "OnRewardedAdHiddenEvent") { - InvokeEvent(_onRewardedAdHiddenEvent, adUnitIdentifier, eventName); - InvokeEvent(_onRewardedAdHiddenEventV2, adUnitIdentifier, adInfo, eventName); + InvokeEvent(_onRewardedAdHiddenEvent, adUnitIdentifier, eventName, keepInBackground); + InvokeEvent(_onRewardedAdHiddenEventV2, adUnitIdentifier, adInfo, eventName, keepInBackground); } else if (eventName == "OnRewardedAdClickedEvent") { - InvokeEvent(_onRewardedAdClickedEvent, adUnitIdentifier, eventName); - InvokeEvent(_onRewardedAdClickedEventV2, adUnitIdentifier, adInfo, eventName); + InvokeEvent(_onRewardedAdClickedEvent, adUnitIdentifier, eventName, keepInBackground); + InvokeEvent(_onRewardedAdClickedEventV2, adUnitIdentifier, adInfo, eventName, keepInBackground); } else if (eventName == "OnRewardedAdRevenuePaidEvent") { - InvokeEvent(_onRewardedAdRevenuePaidEvent, adUnitIdentifier, adInfo, eventName); + InvokeEvent(_onRewardedAdRevenuePaidEvent, adUnitIdentifier, adInfo, eventName, keepInBackground); } else if (eventName == "OnRewardedAdReviewCreativeIdGeneratedEvent") { var adReviewCreativeId = MaxSdkUtils.GetStringFromDictionary(eventProps, "adReviewCreativeId", ""); - InvokeEvent(_onRewardedAdReviewCreativeIdGeneratedEvent, adUnitIdentifier, adReviewCreativeId, adInfo, eventName); + InvokeEvent(_onRewardedAdReviewCreativeIdGeneratedEvent, adUnitIdentifier, adReviewCreativeId, adInfo, eventName, keepInBackground); } else if (eventName == "OnRewardedAdFailedToDisplayEvent") { var errorCode = MaxSdkUtils.GetIntFromDictionary(eventProps, "errorCode", -1); - InvokeEvent(_onRewardedAdFailedToDisplayEvent, adUnitIdentifier, errorCode, eventName); + InvokeEvent(_onRewardedAdFailedToDisplayEvent, adUnitIdentifier, errorCode, eventName, keepInBackground); var errorInfo = new MaxSdkBase.ErrorInfo(eventProps); - InvokeEvent(_onRewardedAdFailedToDisplayEventV2, adUnitIdentifier, errorInfo, adInfo, eventName); + InvokeEvent(_onRewardedAdFailedToDisplayEventV2, adUnitIdentifier, errorInfo, adInfo, eventName, keepInBackground); } else if (eventName == "OnRewardedAdReceivedRewardEvent") { @@ -1584,45 +1457,45 @@ public class MaxSdkCallbacks : MonoBehaviour Amount = MaxSdkUtils.GetIntFromDictionary(eventProps, "rewardAmount", 0) }; - InvokeEvent(_onRewardedAdReceivedRewardEvent, adUnitIdentifier, reward, eventName); - InvokeEvent(_onRewardedAdReceivedRewardEventV2, adUnitIdentifier, reward, adInfo, eventName); + InvokeEvent(_onRewardedAdReceivedRewardEvent, adUnitIdentifier, reward, eventName, keepInBackground); + InvokeEvent(_onRewardedAdReceivedRewardEventV2, adUnitIdentifier, reward, adInfo, eventName, keepInBackground); } else if (eventName == "OnRewardedInterstitialAdLoadedEvent") { - InvokeEvent(_onRewardedInterstitialAdLoadedEvent, adUnitIdentifier, adInfo, eventName); + InvokeEvent(_onRewardedInterstitialAdLoadedEvent, adUnitIdentifier, adInfo, eventName, keepInBackground); } else if (eventName == "OnRewardedInterstitialAdLoadFailedEvent") { var errorInfo = new MaxSdkBase.ErrorInfo(eventProps); - InvokeEvent(_onRewardedInterstitialAdLoadFailedEvent, adUnitIdentifier, errorInfo, eventName); + InvokeEvent(_onRewardedInterstitialAdLoadFailedEvent, adUnitIdentifier, errorInfo, eventName, keepInBackground); } else if (eventName == "OnRewardedInterstitialAdDisplayedEvent") { - InvokeEvent(_onRewardedInterstitialAdDisplayedEvent, adUnitIdentifier, adInfo, eventName); + InvokeEvent(_onRewardedInterstitialAdDisplayedEvent, adUnitIdentifier, adInfo, eventName, keepInBackground); } else if (eventName == "OnRewardedInterstitialAdHiddenEvent") { - InvokeEvent(_onRewardedInterstitialAdHiddenEvent, adUnitIdentifier, adInfo, eventName); + InvokeEvent(_onRewardedInterstitialAdHiddenEvent, adUnitIdentifier, adInfo, eventName, keepInBackground); } else if (eventName == "OnRewardedInterstitialAdClickedEvent") { - InvokeEvent(_onRewardedInterstitialAdClickedEvent, adUnitIdentifier, adInfo, eventName); + InvokeEvent(_onRewardedInterstitialAdClickedEvent, adUnitIdentifier, adInfo, eventName, keepInBackground); } else if (eventName == "OnRewardedInterstitialAdRevenuePaidEvent") { - InvokeEvent(_onRewardedInterstitialAdRevenuePaidEvent, adUnitIdentifier, adInfo, eventName); + InvokeEvent(_onRewardedInterstitialAdRevenuePaidEvent, adUnitIdentifier, adInfo, eventName, keepInBackground); } else if (eventName == "OnRewardedInterstitialAdReviewCreativeIdGeneratedEvent") { var adReviewCreativeId = MaxSdkUtils.GetStringFromDictionary(eventProps, "adReviewCreativeId", ""); - InvokeEvent(_onRewardedInterstitialAdReviewCreativeIdGeneratedEvent, adUnitIdentifier, adReviewCreativeId, adInfo, eventName); + InvokeEvent(_onRewardedInterstitialAdReviewCreativeIdGeneratedEvent, adUnitIdentifier, adReviewCreativeId, adInfo, eventName, keepInBackground); } else if (eventName == "OnRewardedInterstitialAdFailedToDisplayEvent") { var errorInfo = new MaxSdkBase.ErrorInfo(eventProps); - InvokeEvent(_onRewardedInterstitialAdFailedToDisplayEvent, adUnitIdentifier, errorInfo, adInfo, eventName); + InvokeEvent(_onRewardedInterstitialAdFailedToDisplayEvent, adUnitIdentifier, errorInfo, adInfo, eventName, keepInBackground); } else if (eventName == "OnRewardedInterstitialAdReceivedRewardEvent") { @@ -1632,7 +1505,7 @@ public class MaxSdkCallbacks : MonoBehaviour Amount = MaxSdkUtils.GetIntFromDictionary(eventProps, "rewardAmount", 0) }; - InvokeEvent(_onRewardedInterstitialAdReceivedRewardEvent, adUnitIdentifier, reward, adInfo, eventName); + InvokeEvent(_onRewardedInterstitialAdReceivedRewardEvent, adUnitIdentifier, reward, adInfo, eventName, keepInBackground); } else { @@ -1650,36 +1523,96 @@ public class MaxSdkCallbacks : MonoBehaviour } #endif - private static void InvokeEvent(Action evt, string eventName) + private static void InvokeEvent(Action evt, string eventName, bool keepInBackground) { if (!CanInvokeEvent(evt)) return; MaxSdkLogger.UserDebug("Invoking event: " + eventName); - evt(); + if (ShouldInvokeInBackground(keepInBackground)) + { + try + { + evt(); + } + catch (Exception exception) + { + MaxSdkLogger.UserError("Caught exception in publisher event: " + eventName + ", exception: " + exception); + Debug.LogException(exception); + } + } + else + { + MaxEventExecutor.ExecuteOnMainThread(evt, eventName); + } } - private static void InvokeEvent(Action evt, T param, string eventName) + private static void InvokeEvent(Action evt, T param, string eventName, bool keepInBackground) { if (!CanInvokeEvent(evt)) return; MaxSdkLogger.UserDebug("Invoking event: " + eventName + ". Param: " + param); - evt(param); + if (ShouldInvokeInBackground(keepInBackground)) + { + try + { + evt(param); + } + catch (Exception exception) + { + MaxSdkLogger.UserError("Caught exception in publisher event: " + eventName + ", exception: " + exception); + Debug.LogException(exception); + } + } + else + { + MaxEventExecutor.ExecuteOnMainThread(() => evt(param), eventName); + } } - private static void InvokeEvent(Action evt, T1 param1, T2 param2, string eventName) + private static void InvokeEvent(Action evt, T1 param1, T2 param2, string eventName, bool keepInBackground) { if (!CanInvokeEvent(evt)) return; MaxSdkLogger.UserDebug("Invoking event: " + eventName + ". Params: " + param1 + ", " + param2); - evt(param1, param2); + if (ShouldInvokeInBackground(keepInBackground)) + { + try + { + evt(param1, param2); + } + catch (Exception exception) + { + MaxSdkLogger.UserError("Caught exception in publisher event: " + eventName + ", exception: " + exception); + Debug.LogException(exception); + } + } + else + { + MaxEventExecutor.ExecuteOnMainThread(() => evt(param1, param2), eventName); + } } - private static void InvokeEvent(Action evt, T1 param1, T2 param2, T3 param3, string eventName) + private static void InvokeEvent(Action evt, T1 param1, T2 param2, T3 param3, string eventName, bool keepInBackground) { if (!CanInvokeEvent(evt)) return; MaxSdkLogger.UserDebug("Invoking event: " + eventName + ". Params: " + param1 + ", " + param2 + ", " + param3); - evt(param1, param2, param3); + if (ShouldInvokeInBackground(keepInBackground)) + { + try + { + evt(param1, param2, param3); + } + catch (Exception exception) + { + MaxSdkLogger.UserError("Caught exception in publisher event: " + eventName + ", exception: " + exception); + Debug.LogException(exception); + } + } + else + { + MaxEventExecutor.ExecuteOnMainThread(() => evt(param1, param2, param3), eventName); + } } private static bool CanInvokeEvent(Delegate evt) @@ -1695,6 +1628,11 @@ public class MaxSdkCallbacks : MonoBehaviour return true; } + private static bool ShouldInvokeInBackground(bool keepInBackground) + { + return MaxSdkBase.InvokeEventsOnUnityMainThread == null ? keepInBackground : !MaxSdkBase.InvokeEventsOnUnityMainThread.Value; + } + private static void LogSubscribedToEvent(string eventName) { MaxSdkLogger.D("Listener has been added to callback: " + eventName); @@ -1768,13 +1706,6 @@ public class MaxSdkCallbacks : MonoBehaviour _onMRecAdExpandedEventV2 = null; _onMRecAdCollapsedEventV2 = null; - _onCrossPromoAdLoadedEvent = null; - _onCrossPromoAdLoadFailedEvent = null; - _onCrossPromoAdClickedEvent = null; - _onCrossPromoAdRevenuePaidEvent = null; - _onCrossPromoAdExpandedEvent = null; - _onCrossPromoAdCollapsedEvent = null; - _onBannerAdLoadedEvent = null; _onBannerAdLoadFailedEvent = null; _onBannerAdClickedEvent = null; diff --git a/MaxSdk/Scripts/MaxSdkUnityEditor.cs b/MaxSdk/Scripts/MaxSdkUnityEditor.cs index 61c93b1..11ff89b 100644 --- a/MaxSdk/Scripts/MaxSdkUnityEditor.cs +++ b/MaxSdk/Scripts/MaxSdkUnityEditor.cs @@ -6,6 +6,7 @@ using System; using System.Collections; using System.Collections.Generic; using System.Globalization; +using AppLovinMax.Internal; using AppLovinMax.ThirdParty.MiniJson; #if UNITY_EDITOR using UnityEditor; @@ -28,6 +29,7 @@ public class MaxSdkUnityEditor : MaxSdkBase private static bool _doNotSell = false; private static bool _isDoNotSellSet = false; private static bool _showStubAds = true; + private static SafeAreaInsets _safeAreaInsets = new SafeAreaInsets(new int[] {0, 0, 0, 0}); private static readonly HashSet RequestedAdUnits = new HashSet(); private static readonly HashSet ReadyAdUnits = new HashSet(); private static readonly Dictionary StubBanners = new Dictionary(); @@ -49,6 +51,7 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// This method must be called before any other SDK operation /// + /// AppLovin SDK key. Must not be null. public static void SetSdkKey(string sdkKey) { _hasSdkKey = true; @@ -111,7 +114,7 @@ public class MaxSdkUnityEditor : MaxSdkBase /// For example, a username or email. We'll include this in the postback when we ping your currency endpoint from our server. /// /// - /// The user identifier to be set. + /// The user identifier to be set. Must not be null. public static void SetUserId(string userId) { } /// @@ -184,8 +187,8 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// Returns the arbitrary ad value for a given ad unit identifier with key. Returns null if no ad is loaded. /// - /// - /// Ad value key + /// Ad unit identifier for which to get the ad value for. Must not be null. + /// Ad value key. Must not be null. /// Arbitrary ad value for a given key, or null if no ad is loaded. public static string GetAdValue(string adUnitIdentifier, string key) { @@ -297,8 +300,8 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// Create a new banner. /// - /// Ad unit identifier of the banner to create - /// Banner position + /// Ad unit identifier of the banner to create. Must not be null. + /// Banner position. Must not be null. public static void CreateBanner(string adUnitIdentifier, BannerPosition bannerPosition) { ValidateAdUnitIdentifier(adUnitIdentifier, "create banner"); @@ -312,14 +315,14 @@ public class MaxSdkUnityEditor : MaxSdkBase ExecuteWithDelay(1f, () => { var eventProps = Json.Serialize(CreateBaseEventPropsDictionary("OnBannerAdLoadedEvent", adUnitIdentifier)); - MaxSdkCallbacks.Instance.ForwardEvent(eventProps); + MaxSdkCallbacks.ForwardEvent(eventProps); }); } /// /// Create a new banner with a custom position. /// - /// Ad unit identifier of the banner to create + /// Ad unit identifier of the banner to create. Must not be null. /// The X coordinate (horizontal position) of the banner relative to the top left corner of the screen. /// The Y coordinate (vertical position) of the banner relative to the top left corner of the screen. /// @@ -356,7 +359,7 @@ public class MaxSdkUnityEditor : MaxSdkBase /// NOTE: The method loads the first banner ad and initiates an automated banner refresh process. /// You only need to call this method if you pause banner refresh. /// - /// Ad unit identifier of the banner to load + /// Ad unit identifier of the banner to load. Must not be null. public static void LoadBanner(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "load banner"); @@ -364,14 +367,14 @@ public class MaxSdkUnityEditor : MaxSdkBase ExecuteWithDelay(1f, () => { var eventProps = Json.Serialize(CreateBaseEventPropsDictionary("OnBannerAdLoadedEvent", adUnitIdentifier)); - MaxSdkCallbacks.Instance.ForwardEvent(eventProps); + MaxSdkCallbacks.ForwardEvent(eventProps); }); } /// /// Set the banner placement for an ad unit identifier to tie the future ad events to. /// - /// Ad unit identifier of the banner to set the placement for + /// Ad unit identifier of the banner to set the placement for. Must not be null. /// Placement to set public static void SetBannerPlacement(string adUnitIdentifier, string placement) { @@ -381,7 +384,7 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// Starts or resumes auto-refreshing of the banner for the given ad unit identifier. /// - /// Ad unit identifier of the banner for which to start auto-refresh + /// Ad unit identifier of the banner for which to start auto-refresh. Must not be null. public static void StartBannerAutoRefresh(string adUnitIdentifier) { MaxSdkLogger.UserDebug("Starting banner auto refresh."); @@ -390,7 +393,7 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// Pauses auto-refreshing of the banner for the given ad unit identifier. /// - /// Ad unit identifier of the banner for which to stop auto-refresh + /// Ad unit identifier of the banner for which to stop auto-refresh. Must not be null. public static void StopBannerAutoRefresh(string adUnitIdentifier) { MaxSdkLogger.UserDebug("Stopping banner auto refresh."); @@ -399,8 +402,8 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// Updates the position of the banner to the new position provided. /// - /// The ad unit identifier of the banner for which to update the position - /// A new position for the banner + /// The ad unit identifier of the banner for which to update the position. Must not be null. + /// A new position for the banner. Must not be null. public static void UpdateBannerPosition(string adUnitIdentifier, BannerPosition bannerPosition) { Debug.Log("[AppLovin MAX] Updating banner position to '" + bannerPosition + "' for ad unit id '" + adUnitIdentifier + "'"); @@ -409,7 +412,7 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// Updates the position of the banner to the new coordinates provided. /// - /// The ad unit identifier of the banner for which to update the position + /// The ad unit identifier of the banner for which to update the position. Must not be null. /// The X coordinate (horizontal position) of the banner relative to the top left corner of the screen. /// The Y coordinate (vertical position) of the banner relative to the top left corner of the screen. /// @@ -423,7 +426,7 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// Overrides the width of the banner in points/dp. /// - /// The ad unit identifier of the banner for which to override the width for + /// The ad unit identifier of the banner for which to override the width for. Must not be null. /// The desired width of the banner in points/dp public static void SetBannerWidth(string adUnitIdentifier, float width) { @@ -434,7 +437,7 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// Show banner at a position determined by the 'CreateBanner' call. /// - /// Ad unit identifier of the banner to show + /// Ad unit identifier of the banner to show. Must not be null. public static void ShowBanner(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "show banner"); @@ -456,7 +459,7 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// Remove banner from the ad view and destroy it. /// - /// Ad unit identifier of the banner to destroy + /// Ad unit identifier of the banner to destroy. Must not be null. public static void DestroyBanner(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "destroy banner"); @@ -472,8 +475,7 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// Hide banner. /// - /// Ad unit identifier of the banner to hide - /// + /// Ad unit identifier of the banner to hide. Must not be null. public static void HideBanner(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "hide banner"); @@ -488,9 +490,8 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// Set non-transparent background color for banners to be fully functional. /// - /// Ad unit identifier of the banner to set background color for - /// A background color to set for the ad - /// + /// Ad unit identifier of the banner to set background color for. Must not be null. + /// A background color to set for the ad. Must not be null. public static void SetBannerBackgroundColor(string adUnitIdentifier, Color color) { ValidateAdUnitIdentifier(adUnitIdentifier, "set background color"); @@ -505,8 +506,8 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// Set an extra parameter for the banner ad. /// - /// Ad unit identifier of the banner to set the extra parameter for. - /// The key for the extra parameter. + /// Ad unit identifier of the banner to set the extra parameter for. Must not be null. + /// The key for the extra parameter. Must not be null. /// The value for the extra parameter. public static void SetBannerExtraParameter(string adUnitIdentifier, string key, string value) { @@ -516,8 +517,8 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// Set a local extra parameter for the banner ad. /// - /// Ad unit identifier of the banner to set the local extra parameter for. - /// The key for the local extra parameter. + /// Ad unit identifier of the banner to set the local extra parameter for. Must not be null. + /// The key for the local extra parameter. Must not be null. /// The value for the local extra parameter. public static void SetBannerLocalExtraParameter(string adUnitIdentifier, string key, object value) { @@ -527,7 +528,7 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// The custom data to tie the showing banner ad to, for ILRD and rewarded postbacks via the {CUSTOM_DATA} macro. Maximum size is 8KB. /// - /// Banner ad unit identifier of the banner to set the custom data for. + /// Banner ad unit identifier of the banner to set the custom data for. Must not be null. /// The custom data to be set. public static void SetBannerCustomData(string adUnitIdentifier, string customData) { @@ -538,7 +539,7 @@ public class MaxSdkUnityEditor : MaxSdkBase /// The banner position on the screen. When setting the banner position via or , /// the banner is placed within the safe area of the screen. This returns the absolute position of the banner on screen. /// - /// Ad unit identifier of the banner for which to get the position on screen. + /// Ad unit identifier of the banner for which to get the position on screen. Must not be null. /// A representing the banner position on screen. public static Rect GetBannerLayout(string adUnitIdentifier) { @@ -553,8 +554,8 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// Create a new MREC. /// - /// Ad unit identifier of the MREC to create - /// MREC position + /// Ad unit identifier of the MREC to create. Must not be null. + /// MREC position. Must not be null. public static void CreateMRec(string adUnitIdentifier, AdViewPosition mrecPosition) { ValidateAdUnitIdentifier(adUnitIdentifier, "create MREC"); @@ -563,14 +564,14 @@ public class MaxSdkUnityEditor : MaxSdkBase ExecuteWithDelay(1f, () => { var eventProps = Json.Serialize(CreateBaseEventPropsDictionary("OnMRecAdLoadedEvent", adUnitIdentifier)); - MaxSdkCallbacks.Instance.ForwardEvent(eventProps); + MaxSdkCallbacks.ForwardEvent(eventProps); }); } /// /// Create a new MREC with a custom position. /// - /// Ad unit identifier of the MREC to create + /// Ad unit identifier of the MREC to create. Must not be null. /// The X coordinate (horizontal position) of the MREC relative to the top left corner of the screen. /// The Y coordinate (vertical position) of the MREC relative to the top left corner of the screen. /// @@ -587,7 +588,7 @@ public class MaxSdkUnityEditor : MaxSdkBase /// NOTE: The method loads the first MREC ad and initiates an automated MREC refresh process. /// You only need to call this method if you pause MREC refresh. /// - /// Ad unit identifier of the MREC to load + /// Ad unit identifier of the MREC to load. Must not be null. public static void LoadMRec(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "load MREC"); @@ -595,14 +596,14 @@ public class MaxSdkUnityEditor : MaxSdkBase ExecuteWithDelay(1f, () => { var eventProps = Json.Serialize(CreateBaseEventPropsDictionary("OnMRecAdLoadedEvent", adUnitIdentifier)); - MaxSdkCallbacks.Instance.ForwardEvent(eventProps); + MaxSdkCallbacks.ForwardEvent(eventProps); }); } /// /// Set the MREC placement for an ad unit identifier to tie the future ad events to. /// - /// Ad unit identifier of the MREC to set the placement for + /// Ad unit identifier of the MREC to set the placement for. Must not be null. /// Placement to set public static void SetMRecPlacement(string adUnitIdentifier, string placement) { @@ -612,7 +613,7 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// Starts or resumes auto-refreshing of the MREC for the given ad unit identifier. /// - /// Ad unit identifier of the MREC for which to start auto-refresh + /// Ad unit identifier of the MREC for which to start auto-refresh. Must not be null. public static void StartMRecAutoRefresh(string adUnitIdentifier) { MaxSdkLogger.UserDebug("Starting banner auto refresh."); @@ -621,7 +622,7 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// Pauses auto-refreshing of the MREC for the given ad unit identifier. /// - /// Ad unit identifier of the MREC for which to stop auto-refresh + /// Ad unit identifier of the MREC for which to stop auto-refresh. Must not be null. public static void StopMRecAutoRefresh(string adUnitIdentifier) { MaxSdkLogger.UserDebug("Stopping banner auto refresh."); @@ -630,8 +631,8 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// Updates the position of the MREC to the new position provided. /// - /// The ad unit identifier of the MREC for which to update the position - /// A new position for the MREC + /// The ad unit identifier of the MREC for which to update the position. Must not be null. + /// A new position for the MREC. Must not be null. public static void UpdateMRecPosition(string adUnitIdentifier, AdViewPosition mrecPosition) { MaxSdkLogger.UserDebug("Updating MREC position to '" + mrecPosition + "' for ad unit id '" + adUnitIdentifier + "'"); @@ -640,7 +641,7 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// Updates the position of the MREC to the new coordinates provided. /// - /// The ad unit identifier of the MREC for which to update the position + /// The ad unit identifier of the MREC for which to update the position. Must not be null. /// The X coordinate (horizontal position) of the MREC relative to the top left corner of the screen. /// The Y coordinate (vertical position) of the MREC relative to the top left corner of the screen. /// @@ -654,7 +655,7 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// Show MREC at a position determined by the 'CreateMRec' call. /// - /// Ad unit identifier of the MREC to show + /// Ad unit identifier of the MREC to show. Must not be null. public static void ShowMRec(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "show MREC"); @@ -668,7 +669,7 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// Remove MREC from the ad view and destroy it. /// - /// Ad unit identifier of the MREC to destroy + /// Ad unit identifier of the MREC to destroy. Must not be null. public static void DestroyMRec(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "destroy MREC"); @@ -677,7 +678,7 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// Hide MREC. /// - /// Ad unit identifier of the MREC to hide + /// Ad unit identifier of the MREC to hide. Must not be null. public static void HideMRec(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "hide MREC"); @@ -686,8 +687,8 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// Set an extra parameter for the MREC ad. /// - /// Ad unit identifier of the MREC to set the extra parameter for. - /// The key for the extra parameter. + /// Ad unit identifier of the MREC to set the extra parameter for. Must not be null. + /// The key for the extra parameter. Must not be null. /// The value for the extra parameter. public static void SetMRecExtraParameter(string adUnitIdentifier, string key, string value) { @@ -697,8 +698,8 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// Set a local extra parameter for the MREC ad. /// - /// Ad unit identifier of the MREC to set the local extra parameter for. - /// The key for the local extra parameter. + /// Ad unit identifier of the MREC to set the local extra parameter for. Must not be null. + /// The key for the local extra parameter. Must not be null. /// The value for the local extra parameter. public static void SetMRecLocalExtraParameter(string adUnitIdentifier, string key, object value) { @@ -708,7 +709,7 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// The custom data to tie the showing MREC ad to, for ILRD and rewarded postbacks via the {CUSTOM_DATA} macro. Maximum size is 8KB. /// - /// MREC Ad unit identifier of the banner to set the custom data for. + /// MREC Ad unit identifier of the banner to set the custom data for. Must not be null. /// The custom data to be set. public static void SetMRecCustomData(string adUnitIdentifier, string customData) { @@ -719,7 +720,7 @@ public class MaxSdkUnityEditor : MaxSdkBase /// The MREC position on the screen. When setting the MREC position via or , /// the MREC is placed within the safe area of the screen. This returns the absolute position of the MREC on screen. /// - /// Ad unit identifier of the MREC for which to get the position on screen. + /// Ad unit identifier of the MREC for which to get the position on screen. Must not be null. /// A representing the banner position on screen. public static Rect GetMRecLayout(string adUnitIdentifier) { @@ -729,99 +730,6 @@ public class MaxSdkUnityEditor : MaxSdkBase #endregion - #region Cross Promo Ads - - /// - /// Create a new cross promo ad with a custom position. - /// - /// Ad unit identifier of the cross promo ad to create - /// The X coordinate (horizontal position) of the cross promo ad relative to the top left corner of the screen. - /// The Y coordinate (vertical position) of the cross promo ad relative to the top left corner of the screen. - /// The width of the cross promo ad. - /// The height of the cross promo ad. - /// The rotation of the cross promo ad in degrees. - /// - /// The cross promo is placed within the safe area of the screen. You can use this to get the absolute position Rect of the cross promo ad on screen. - /// - public static void CreateCrossPromoAd(string adUnitIdentifier, float x, float y, float width, float height, float rotation) - { - ValidateAdUnitIdentifier(adUnitIdentifier, "create cross promo ad"); - RequestAdUnit(adUnitIdentifier); - } - - /// - /// Set the cross promo ad placement for an ad unit identifier to tie the future ad events to. - /// - /// Ad unit identifier of the cross promo ad to set the placement for - /// Placement to set - public static void SetCrossPromoAdPlacement(string adUnitIdentifier, string placement) - { - MaxSdkLogger.UserDebug("Setting cross promo ad placement to '" + placement + "' for ad unit id '" + adUnitIdentifier + "'"); - } - - /// - /// Updates the position of the cross promo ad to the new coordinates provided. - /// - /// The ad unit identifier of the cross promo ad for which to update the position - /// The X coordinate (horizontal position) of the cross promo ad relative to the top left corner of the screen. - /// The Y coordinate (vertical position) of the cross promo ad relative to the top left corner of the screen. - /// The width of the cross promo ad. - /// The height of the cross promo ad. - /// The rotation of the cross promo ad in degrees. - /// - /// The cross promo ad is placed within the safe area of the screen. You can use this to get the absolute position Rect of the cross promo ad on screen. - /// - public static void UpdateCrossPromoAdPosition(string adUnitIdentifier, float x, float y, float width, float height, float rotation) - { - MaxSdkLogger.UserDebug("Updating cross promo ad position to (" + x + "," + y + ") with size " + width + " x " + height + " and rotation of " + rotation + " degrees"); - } - - /// - /// Show cross promo ad at a position determined by the 'CreateCrossPromoAd' call. - /// - /// Ad unit identifier of the cross promo ad to show - public static void ShowCrossPromoAd(string adUnitIdentifier) - { - ValidateAdUnitIdentifier(adUnitIdentifier, "show cross promo ad"); - - if (!IsAdUnitRequested(adUnitIdentifier)) - { - MaxSdkLogger.UserWarning("Cross promo ad '" + adUnitIdentifier + "' was not created, can not show it"); - } - } - - /// - /// Remove cross promo ad from the ad view and destroy it. - /// - /// Ad unit identifier of the cross promo ad to destroy - public static void DestroyCrossPromoAd(string adUnitIdentifier) - { - ValidateAdUnitIdentifier(adUnitIdentifier, "destroy cross promo ad"); - } - - /// - /// Hide cross promo ad. - /// - /// Ad unit identifier of the cross promo ad to hide - public static void HideCrossPromoAd(string adUnitIdentifier) - { - ValidateAdUnitIdentifier(adUnitIdentifier, "hide cross promo ad"); - } - - /// - /// The cross promo ad position on the screen. When setting the cross promo ad position via or , - /// the cross promo ad is placed within the safe area of the screen. This returns the absolute position of the cross promo ad on screen. - /// - /// Ad unit identifier of the cross promo ad for which to get the position on screen. - /// A representing the banner position on screen. - public static Rect GetCrossPromoAdLayout(string adUnitIdentifier) - { - ValidateAdUnitIdentifier(adUnitIdentifier, "get cross promo ad layout"); - return Rect.zero; - } - - #endregion - #region Interstitials /// @@ -838,7 +746,7 @@ public class MaxSdkUnityEditor : MaxSdkBase AddReadyAdUnit(adUnitIdentifier); var eventProps = Json.Serialize(CreateBaseEventPropsDictionary("OnInterstitialLoadedEvent", adUnitIdentifier)); - MaxSdkCallbacks.Instance.ForwardEvent(eventProps); + MaxSdkCallbacks.ForwardEvent(eventProps); }); } @@ -906,12 +814,12 @@ public class MaxSdkUnityEditor : MaxSdkBase closeButton.onClick.AddListener(() => { var adHiddenEventProps = Json.Serialize(CreateBaseEventPropsDictionary("OnInterstitialHiddenEvent", adUnitIdentifier)); - MaxSdkCallbacks.Instance.ForwardEvent(adHiddenEventProps); + MaxSdkCallbacks.ForwardEvent(adHiddenEventProps); Object.Destroy(stubInterstitial); }); var adDisplayedEventProps = Json.Serialize(CreateBaseEventPropsDictionary("OnInterstitialDisplayedEvent", adUnitIdentifier)); - MaxSdkCallbacks.Instance.ForwardEvent(adDisplayedEventProps); + MaxSdkCallbacks.ForwardEvent(adDisplayedEventProps); #endif } @@ -944,7 +852,7 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// Start loading an app open ad. /// - /// Ad unit identifier of the app open ad to load + /// Ad unit identifier of the app open ad to load. Must not be null. public static void LoadAppOpenAd(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "load app open ad"); @@ -955,14 +863,14 @@ public class MaxSdkUnityEditor : MaxSdkBase AddReadyAdUnit(adUnitIdentifier); var eventProps = Json.Serialize(CreateBaseEventPropsDictionary("OnAppOpenAdLoadedEvent", adUnitIdentifier)); - MaxSdkCallbacks.Instance.ForwardEvent(eventProps); + MaxSdkCallbacks.ForwardEvent(eventProps); }); } /// /// Check if app open ad ad is loaded and ready to be displayed. /// - /// Ad unit identifier of the app open ad to load + /// Ad unit identifier of the app open ad to load. Must not be null. /// True if the ad is ready to be displayed public static bool IsAppOpenAdReady(string adUnitIdentifier) { @@ -981,7 +889,7 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// Present loaded app open ad for a given placement to tie ad events to. Note: if the app open ad is not ready to be displayed nothing will happen. /// - /// Ad unit identifier of the app open ad to load + /// Ad unit identifier of the app open ad to load. Must not be null. /// The placement to tie the showing ad's events to /// The custom data to tie the showing ad's events to. Maximum size is 8KB. public static void ShowAppOpenAd(string adUnitIdentifier, string placement = null, string customData = null) @@ -1023,20 +931,20 @@ public class MaxSdkUnityEditor : MaxSdkBase closeButton.onClick.AddListener(() => { var adHiddenEventProps = Json.Serialize(CreateBaseEventPropsDictionary("OnAppOpenAdHiddenEvent", adUnitIdentifier)); - MaxSdkCallbacks.Instance.ForwardEvent(adHiddenEventProps); + MaxSdkCallbacks.ForwardEvent(adHiddenEventProps); Object.Destroy(stubAppOpenAd); }); var adDisplayedEventProps = Json.Serialize(CreateBaseEventPropsDictionary("OnAppOpenAdDisplayedEvent", adUnitIdentifier)); - MaxSdkCallbacks.Instance.ForwardEvent(adDisplayedEventProps); + MaxSdkCallbacks.ForwardEvent(adDisplayedEventProps); #endif } /// /// Set an extra parameter for the ad. /// - /// Ad unit identifier of the app open ad to set the extra parameter for. - /// The key for the extra parameter. + /// Ad unit identifier of the app open ad to set the extra parameter for. Must not be null. + /// The key for the extra parameter. Must not be null. /// The value for the extra parameter. public static void SetAppOpenAdExtraParameter(string adUnitIdentifier, string key, string value) { @@ -1046,8 +954,8 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// Set a local extra parameter for the ad. /// - /// Ad unit identifier of the app open ad to set the local extra parameter for. - /// The key for the local extra parameter. + /// Ad unit identifier of the app open ad to set the local extra parameter for. Must not be null. + /// The key for the local extra parameter. Must not be null. /// The value for the local extra parameter. public static void SetAppOpenAdLocalExtraParameter(string adUnitIdentifier, string key, object value) { @@ -1061,7 +969,7 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// Start loading an rewarded ad. /// - /// Ad unit identifier of the rewarded ad to load + /// Ad unit identifier of the rewarded ad to load. Must not be null. public static void LoadRewardedAd(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "load rewarded ad"); @@ -1071,14 +979,14 @@ public class MaxSdkUnityEditor : MaxSdkBase { AddReadyAdUnit(adUnitIdentifier); var eventProps = Json.Serialize(CreateBaseEventPropsDictionary("OnRewardedAdLoadedEvent", adUnitIdentifier)); - MaxSdkCallbacks.Instance.ForwardEvent(eventProps); + MaxSdkCallbacks.ForwardEvent(eventProps); }); } /// /// Check if rewarded ad ad is loaded and ready to be displayed. /// - /// Ad unit identifier of the rewarded ad to load + /// Ad unit identifier of the rewarded ad to load. Must not be null. /// True if the ad is ready to be displayed public static bool IsRewardedAdReady(string adUnitIdentifier) { @@ -1097,7 +1005,7 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// Present loaded rewarded ad for a given placement to tie ad events to. Note: if the rewarded ad is not ready to be displayed nothing will happen. /// - /// Ad unit identifier of the interstitial to load + /// Ad unit identifier of the interstitial to load. Must not be null. /// The placement to tie the showing ad's events to /// The custom data to tie the showing ad's events to. Maximum size is 8KB. public static void ShowRewardedAd(string adUnitIdentifier, string placement = null, string customData = null) @@ -1147,11 +1055,11 @@ public class MaxSdkUnityEditor : MaxSdkBase rewardEventPropsDict["rewardLabel"] = "coins"; rewardEventPropsDict["rewardAmount"] = "5"; var rewardEventProps = Json.Serialize(rewardEventPropsDict); - MaxSdkCallbacks.Instance.ForwardEvent(rewardEventProps); + MaxSdkCallbacks.ForwardEvent(rewardEventProps); } var adHiddenEventProps = Json.Serialize(CreateBaseEventPropsDictionary("OnRewardedAdHiddenEvent", adUnitIdentifier)); - MaxSdkCallbacks.Instance.ForwardEvent(adHiddenEventProps); + MaxSdkCallbacks.ForwardEvent(adHiddenEventProps); Object.Destroy(stubRewardedAd); }); rewardButton.onClick.AddListener(() => @@ -1161,15 +1069,15 @@ public class MaxSdkUnityEditor : MaxSdkBase }); var adDisplayedEventProps = Json.Serialize(CreateBaseEventPropsDictionary("OnRewardedAdDisplayedEvent", adUnitIdentifier)); - MaxSdkCallbacks.Instance.ForwardEvent(adDisplayedEventProps); + MaxSdkCallbacks.ForwardEvent(adDisplayedEventProps); #endif } /// /// Set an extra parameter for the ad. /// - /// Ad unit identifier of the rewarded ad to set the extra parameter for. - /// The key for the extra parameter. + /// Ad unit identifier of the rewarded ad to set the extra parameter for. Must not be null. + /// The key for the extra parameter. Must not be null. /// The value for the extra parameter. public static void SetRewardedAdExtraParameter(string adUnitIdentifier, string key, string value) { @@ -1179,8 +1087,8 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// Set a local extra parameter for the ad. /// - /// Ad unit identifier of the rewarded ad to set the local extra parameter for. - /// The key for the local extra parameter. + /// Ad unit identifier of the rewarded ad to set the local extra parameter for. Must not be null. + /// The key for the local extra parameter. Must not be null. /// The value for the local extra parameter. public static void SetRewardedAdLocalExtraParameter(string adUnitIdentifier, string key, object value) { @@ -1194,7 +1102,7 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// Start loading an rewarded interstitial ad. /// - /// Ad unit identifier of the rewarded interstitial ad to load + /// Ad unit identifier of the rewarded interstitial ad to load. Must not be null. public static void LoadRewardedInterstitialAd(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "load rewarded interstitial ad"); @@ -1204,14 +1112,14 @@ public class MaxSdkUnityEditor : MaxSdkBase { AddReadyAdUnit(adUnitIdentifier); var eventProps = Json.Serialize(CreateBaseEventPropsDictionary("OnRewardedInterstitialAdLoadedEvent", adUnitIdentifier)); - MaxSdkCallbacks.Instance.ForwardEvent(eventProps); + MaxSdkCallbacks.ForwardEvent(eventProps); }); } /// /// Check if rewarded interstitial ad ad is loaded and ready to be displayed. /// - /// Ad unit identifier of the rewarded ad to load + /// Ad unit identifier of the rewarded ad to load. Must not be null. /// True if the ad is ready to be displayed public static bool IsRewardedInterstitialAdReady(string adUnitIdentifier) { @@ -1230,7 +1138,7 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// Present loaded rewarded interstitial ad for a given placement to tie ad events to. Note: if the rewarded interstitial ad is not ready to be displayed nothing will happen. /// - /// Ad unit identifier of the rewarded interstitial to show + /// Ad unit identifier of the rewarded interstitial to show. Must not be null. /// The placement to tie the showing ad's events to /// The custom data to tie the showing ad's events to. Maximum size is 8KB. public static void ShowRewardedInterstitialAd(string adUnitIdentifier, string placement = null, string customData = null) @@ -1280,11 +1188,11 @@ public class MaxSdkUnityEditor : MaxSdkBase rewardEventPropsDict["rewardLabel"] = "coins"; rewardEventPropsDict["rewardAmount"] = "5"; var rewardEventProps = Json.Serialize(rewardEventPropsDict); - MaxSdkCallbacks.Instance.ForwardEvent(rewardEventProps); + MaxSdkCallbacks.ForwardEvent(rewardEventProps); } var adHiddenEventProps = Json.Serialize(CreateBaseEventPropsDictionary("OnRewardedInterstitialAdHiddenEvent", adUnitIdentifier)); - MaxSdkCallbacks.Instance.ForwardEvent(adHiddenEventProps); + MaxSdkCallbacks.ForwardEvent(adHiddenEventProps); Object.Destroy(stubRewardedAd); }); rewardButton.onClick.AddListener(() => @@ -1294,15 +1202,15 @@ public class MaxSdkUnityEditor : MaxSdkBase }); var adDisplayedEventProps = Json.Serialize(CreateBaseEventPropsDictionary("OnRewardedAdDisplayedEvent", adUnitIdentifier)); - MaxSdkCallbacks.Instance.ForwardEvent(adDisplayedEventProps); + MaxSdkCallbacks.ForwardEvent(adDisplayedEventProps); #endif } /// /// Set an extra parameter for the ad. /// - /// Ad unit identifier of the rewarded interstitial ad to set the extra parameter for. - /// The key for the extra parameter. + /// Ad unit identifier of the rewarded interstitial ad to set the extra parameter for. Must not be null. + /// The key for the extra parameter. Must not be null. /// The value for the extra parameter. public static void SetRewardedInterstitialAdExtraParameter(string adUnitIdentifier, string key, string value) { @@ -1312,8 +1220,8 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// Set a local extra parameter for the ad. /// - /// Ad unit identifier of the rewarded interstitial ad to set the local extra parameter for. - /// The key for the local extra parameter. + /// Ad unit identifier of the rewarded interstitial ad to set the local extra parameter for. Must not be null. + /// The key for the local extra parameter. Must not be null. /// The value for the local extra parameter. public static void SetRewardedInterstitialAdLocalExtraParameter(string adUnitIdentifier, string key, object value) { @@ -1327,7 +1235,7 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// Track an event using AppLovin. /// - /// An event from the list of pre-defined events may be found in MaxEvents.cs as part of the AppLovin SDK framework. + /// An event from the list of pre-defined events may be found in MaxEvents.cs as part of the AppLovin SDK framework. Must not be null. /// A dictionary containing key-value pairs further describing this event. public static void TrackEvent(string name, IDictionary parameters = null) { } @@ -1395,7 +1303,7 @@ public class MaxSdkUnityEditor : MaxSdkBase /// /// String list of advertising identifiers from devices to receive test ads. public static void SetTestDeviceAdvertisingIdentifiers(string[] advertisingIdentifiers) - { + { if (IsInitialized()) { MaxSdkLogger.UserError("Test Device Advertising Identifiers must be set before SDK initialization."); @@ -1421,6 +1329,15 @@ public class MaxSdkUnityEditor : MaxSdkBase /// The value for the extra parameter. May be null. public static void SetExtraParameter(string key, string value) { } + /// + /// Get the native insets in pixels for the safe area. + /// These insets are used to position ads within the safe area of the screen. + /// + public static SafeAreaInsets GetSafeAreaInsets() + { + return _safeAreaInsets; + } + #endregion #region Internal @@ -1481,7 +1398,7 @@ public class MaxSdkUnityEditor : MaxSdkBase private static void ExecuteWithDelay(float seconds, Action action) { - MaxSdkCallbacks.Instance.StartCoroutine(ExecuteAction(seconds, action)); + MaxEventExecutor.Instance.StartCoroutine(ExecuteAction(seconds, action)); } private static IEnumerator ExecuteAction(float seconds, Action action) diff --git a/MaxSdk/Scripts/MaxSdkUtils.cs b/MaxSdk/Scripts/MaxSdkUtils.cs index 063106d..cbab2d3 100644 --- a/MaxSdk/Scripts/MaxSdkUtils.cs +++ b/MaxSdk/Scripts/MaxSdkUtils.cs @@ -350,27 +350,21 @@ public class MaxSdkUtils } /// - /// Parses the IAB TCF String to determine the consent status for the IAB vendor with the provided ID. + /// Parses the IABTCF_VendorConsents string to determine the consent status of the IAB vendor with the provided ID. + /// NOTE: Must be called after AppLovin MAX SDK has been initialized. /// /// Vendor ID as defined in the Global Vendor List. - /// The consent status of the IAB vendor. Returns true if the vendor has consent, false if not, or null if no TCF string is available on disk. + /// true if the vendor has consent, false if not, or null if TC data is not available on disk. /// Current Version of Global Vendor List public static bool? GetTcfConsentStatus(int vendorId) { var tcfConsentStatus = GetPlatformSpecificTcfConsentStatus(vendorId); - if (tcfConsentStatus == -1) - { - return null; - } - else - { - return tcfConsentStatus == 1; - } + return GetConsentStatusValue(tcfConsentStatus); } #if UNITY_IOS [DllImport("__Internal")] - private static extern int _MaxGetTcfConsentStatus(int vendorIdentifier); + private static extern int _MaxGetTcfVendorConsentStatus(int vendorIdentifier); #endif private static int GetPlatformSpecificTcfConsentStatus(int vendorId) @@ -378,34 +372,28 @@ public class MaxSdkUtils #if UNITY_EDITOR return -1; #elif UNITY_IOS - return _MaxGetTcfConsentStatus(vendorId); + return _MaxGetTcfVendorConsentStatus(vendorId); #elif UNITY_ANDROID - return MaxUnityPluginClass.CallStatic("getTcfConsentStatus", vendorId); + return MaxUnityPluginClass.CallStatic("getTcfVendorConsentStatus", vendorId); #else return -1; #endif } /// - /// Parses the Google UMP's Additional Consent (AC) string to determine the consent status for the advertising entity represented by the provided Ad Technology Provider (ATP) ID. + /// Parses the IABTCF_AddtlConsent string to determine the consent status of the advertising entity with the provided Ad Technology Provider (ATP) ID. + /// NOTE: Must be called after AppLovin MAX SDK has been initialized. /// - /// The ID representing the advertising entity (e.g. 89 for Meta Audience Network). + /// ATP ID of the advertising entity (e.g. 89 for Meta Audience Network). /// - /// The consent status of the advertising entity. Returns true if the entity has consent, false if not, or null if no AC string is available on disk. + /// true if the advertising entity has consent, false if not, or null if no AC string is available on disk or the ATP network was not listed in the CMP flow. /// /// Google’s Additional Consent Mode technical specification /// List of Google ATPs and their IDs public static bool? GetAdditionalConsentStatus(int atpId) { var additionalConsentStatus = GetPlatformSpecificAdditionalConsentStatus(atpId); - if (additionalConsentStatus == -1) - { - return null; - } - else - { - return additionalConsentStatus == 1; - } + return GetConsentStatusValue(additionalConsentStatus); } #if UNITY_IOS @@ -426,6 +414,80 @@ public class MaxSdkUtils #endif } + /// + /// Parses the IABTCF_PurposeConsents String to determine the consent status of the IAB defined data processing purpose. + /// NOTE: Must be called after AppLovin MAX SDK has been initialized. + /// + /// Purpose ID. + /// true if the purpose has consent, false if not, or null if TC data is not available on disk. + /// see IAB Europe Transparency and Consent Framework Policies (Appendix A) for purpose definitions. + public static bool? GetPurposeConsentStatus(int purposeId) + { + var purposeConsentStatus = GetPlatformSpecificPurposeConsentStatus(purposeId); + return GetConsentStatusValue(purposeConsentStatus); + } + +#if UNITY_IOS + [DllImport("__Internal")] + private static extern int _MaxGetPurposeConsentStatus(int purposeIdentifier); +#endif + + private static int GetPlatformSpecificPurposeConsentStatus(int purposeId) + { +#if UNITY_EDITOR + return -1; +#elif UNITY_IOS + return _MaxGetPurposeConsentStatus(purposeId); +#elif UNITY_ANDROID + return MaxUnityPluginClass.CallStatic("getPurposeConsentStatus", purposeId); +#else + return -1; +#endif + } + + /// + /// Parses the IABTCF_SpecialFeaturesOptIns String to determine the opt-in status of the IAB defined special feature. + /// NOTE: Must be called after AppLovin MAX SDK has been initialized. + /// + /// Special feature ID. + /// true if the user opted in for the special feature, false if not, or null if TC data is not available on disk. + /// IAB Europe Transparency and Consent Framework Policies (Appendix A) for special features + public static bool? GetSpecialFeatureOptInStatus(int specialFeatureId) + { + var specialFeatureOptInStatus = GetPlatformSpecificSpecialFeatureOptInStatus(specialFeatureId); + return GetConsentStatusValue(specialFeatureOptInStatus); + } + +#if UNITY_IOS + [DllImport("__Internal")] + private static extern int _MaxGetSpecialFeatureOptInStatus(int specialFeatureIdentifier); +#endif + + private static int GetPlatformSpecificSpecialFeatureOptInStatus(int specialFeatureId) + { +#if UNITY_EDITOR + return -1; +#elif UNITY_IOS + return _MaxGetSpecialFeatureOptInStatus(specialFeatureId); +#elif UNITY_ANDROID + return MaxUnityPluginClass.CallStatic("getSpecialFeatureOptInStatus", specialFeatureId); +#else + return -1; +#endif + } + + private static bool? GetConsentStatusValue(int consentStatus) + { + if (consentStatus == -1) + { + return null; + } + else + { + return consentStatus == 1; + } + } + /// /// Compares AppLovin MAX Unity mediation adapter plugin versions. Returns , , /// or as the first version is less than, equal to, or greater than the second. @@ -493,7 +555,6 @@ public class MaxSdkUtils iosComparison = VersionComparisonResult.Lesser; } - // If either one of the Android or iOS version is greater, the entire version should be greater. return (androidComparison == VersionComparisonResult.Greater || iosComparison == VersionComparisonResult.Greater) ? VersionComparisonResult.Greater : VersionComparisonResult.Lesser; } @@ -520,7 +581,7 @@ public class MaxSdkUtils var versionABetaNumber = 0; if (isVersionABeta) { - var components = versionA.Split(new[] {"-beta"}, StringSplitOptions.None); + var components = versionA.Split(new[] { "-beta" }, StringSplitOptions.None); versionA = components[0]; versionABetaNumber = int.TryParse(components[1], out piece) ? piece : 0; } @@ -529,7 +590,7 @@ public class MaxSdkUtils var versionBBetaNumber = 0; if (isVersionBBeta) { - var components = versionB.Split(new[] {"-beta"}, StringSplitOptions.None); + var components = versionB.Split(new[] { "-beta" }, StringSplitOptions.None); versionB = components[0]; versionBBetaNumber = int.TryParse(components[1], out piece) ? piece : 0; } diff --git a/MaxSdk/Scripts/MaxSdkiOS.cs b/MaxSdk/Scripts/MaxSdkiOS.cs index 4254776..d128f1a 100644 --- a/MaxSdk/Scripts/MaxSdkiOS.cs +++ b/MaxSdk/Scripts/MaxSdkiOS.cs @@ -15,7 +15,7 @@ public class MaxSdkiOS : MaxSdkBase static MaxSdkiOS() { - InitCallbacks(); + InitializeEventExecutor(); } #if UNITY_IOS @@ -34,6 +34,7 @@ public class MaxSdkiOS : MaxSdkBase /// /// This method must be called before any other SDK operation /// + /// AppLovin SDK key. Must not be null. public static void SetSdkKey(string sdkKey) { _MaxSetSdkKey(sdkKey); @@ -82,7 +83,7 @@ public class MaxSdkiOS : MaxSdkBase /// For example, a username or email. We'll include this in the postback when we ping your currency endpoint from our server. /// /// - /// The user identifier to be set. + /// The user identifier to be set. Must not be null. public static void SetUserId(string userId) { _MaxSetUserId(userId); @@ -156,8 +157,8 @@ public class MaxSdkiOS : MaxSdkBase /// /// Returns the arbitrary ad value for a given ad unit identifier with key. Returns null if no ad is loaded. /// - /// - /// Ad value key + /// Ad unit identifier for which to get the ad value for. Must not be null. + /// Ad value key. Must not be null. /// Arbitrary ad value for a given key, or null if no ad is loaded. public static string GetAdValue(string adUnitIdentifier, string key) { @@ -305,8 +306,8 @@ public class MaxSdkiOS : MaxSdkBase /// /// Create a new banner. /// - /// Ad unit identifier of the banner to create - /// Banner position + /// Ad unit identifier of the banner to create. Must not be null. + /// Banner position. Must not be null. public static void CreateBanner(string adUnitIdentifier, BannerPosition bannerPosition) { ValidateAdUnitIdentifier(adUnitIdentifier, "create banner"); @@ -319,7 +320,7 @@ public class MaxSdkiOS : MaxSdkBase /// /// Create a new banner with a custom position. /// - /// Ad unit identifier of the banner to create + /// Ad unit identifier of the banner to create. Must not be null. /// The X coordinate (horizontal position) of the banner relative to the top left corner of the screen. /// The Y coordinate (vertical position) of the banner relative to the top left corner of the screen. /// @@ -339,7 +340,7 @@ public class MaxSdkiOS : MaxSdkBase /// NOTE: The method loads the first banner ad and initiates an automated banner refresh process. /// You only need to call this method if you pause banner refresh. /// - /// Ad unit identifier of the banner to load + /// Ad unit identifier of the banner to load. Must not be null. public static void LoadBanner(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "load banner"); @@ -352,7 +353,7 @@ public class MaxSdkiOS : MaxSdkBase /// /// Set the banner placement for an ad unit identifier to tie the future ad events to. /// - /// Ad unit identifier of the banner to set the placement for + /// Ad unit identifier of the banner to set the placement for. Must not be null. /// Placement to set public static void SetBannerPlacement(string adUnitIdentifier, string placement) { @@ -366,7 +367,7 @@ public class MaxSdkiOS : MaxSdkBase /// /// Starts or resumes auto-refreshing of the banner for the given ad unit identifier. /// - /// Ad unit identifier of the banner for which to start auto-refresh + /// Ad unit identifier of the banner for which to start auto-refresh. Must not be null. public static void StartBannerAutoRefresh(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "start banner auto-refresh"); @@ -379,7 +380,7 @@ public class MaxSdkiOS : MaxSdkBase /// /// Pauses auto-refreshing of the banner for the given ad unit identifier. /// - /// Ad unit identifier of the banner for which to stop auto-refresh + /// Ad unit identifier of the banner for which to stop auto-refresh. Must not be null. public static void StopBannerAutoRefresh(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "stop banner auto-refresh"); @@ -392,8 +393,8 @@ public class MaxSdkiOS : MaxSdkBase /// /// Updates the position of the banner to the new position provided. /// - /// The ad unit identifier of the banner for which to update the position - /// A new position for the banner + /// The ad unit identifier of the banner for which to update the position. Must not be null. + /// A new position for the banner. Must not be null. public static void UpdateBannerPosition(string adUnitIdentifier, BannerPosition bannerPosition) { ValidateAdUnitIdentifier(adUnitIdentifier, "update banner position"); @@ -406,7 +407,7 @@ public class MaxSdkiOS : MaxSdkBase /// /// Updates the position of the banner to the new coordinates provided. /// - /// The ad unit identifier of the banner for which to update the position + /// The ad unit identifier of the banner for which to update the position. Must not be null. /// The X coordinate (horizontal position) of the banner relative to the top left corner of the screen. /// The Y coordinate (vertical position) of the banner relative to the top left corner of the screen. /// @@ -424,7 +425,7 @@ public class MaxSdkiOS : MaxSdkBase /// /// Overrides the width of the banner in points. /// - /// The ad unit identifier of the banner for which to override the width for + /// The ad unit identifier of the banner for which to override the width for. Must not be null. /// The desired width of the banner in points public static void SetBannerWidth(string adUnitIdentifier, float width) { @@ -438,7 +439,7 @@ public class MaxSdkiOS : MaxSdkBase /// /// Show banner at a position determined by the 'CreateBanner' call. /// - /// Ad unit identifier of the banner to show + /// Ad unit identifier of the banner to show. Must not be null. public static void ShowBanner(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "show banner"); @@ -451,7 +452,7 @@ public class MaxSdkiOS : MaxSdkBase /// /// Remove banner from the ad view and destroy it. /// - /// Ad unit identifier of the banner to destroy + /// Ad unit identifier of the banner to destroy. Must not be null. public static void DestroyBanner(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "destroy banner"); @@ -464,7 +465,7 @@ public class MaxSdkiOS : MaxSdkBase /// /// Hide banner. /// - /// Ad unit identifier of the banner to hide + /// Ad unit identifier of the banner to hide. Must not be null. public static void HideBanner(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "hide banner"); @@ -477,7 +478,7 @@ public class MaxSdkiOS : MaxSdkBase /// /// Set non-transparent background color for banners to be fully functional. /// - /// Ad unit identifier of the banner to set background color for + /// Ad unit identifier of the banner to set background color for. Must not be null. /// A background color to set for the ad public static void SetBannerBackgroundColor(string adUnitIdentifier, Color color) { @@ -491,8 +492,8 @@ public class MaxSdkiOS : MaxSdkBase /// /// Set an extra parameter for the banner ad. /// - /// Ad unit identifier of the banner to set the extra parameter for. - /// The key for the extra parameter. + /// Ad unit identifier of the banner to set the extra parameter for. Must not be null. + /// The key for the extra parameter. Must not be null. /// The value for the extra parameter. public static void SetBannerExtraParameter(string adUnitIdentifier, string key, string value) { @@ -509,8 +510,8 @@ public class MaxSdkiOS : MaxSdkBase /// /// Set a local extra parameter for the banner ad. /// - /// Ad unit identifier of the banner to set the local extra parameter for. - /// The key for the local extra parameter. + /// Ad unit identifier of the banner to set the local extra parameter for. Must not be null. + /// The key for the local extra parameter. Must not be null. /// The value for the local extra parameter. Accepts the following types: , null, IList, IDictionary, string, primitive types public static void SetBannerLocalExtraParameter(string adUnitIdentifier, string key, object value) { @@ -533,7 +534,7 @@ public class MaxSdkiOS : MaxSdkBase /// /// The custom data to tie the showing banner ad to, for ILRD and rewarded postbacks via the {CUSTOM_DATA} macro. Maximum size is 8KB. /// - /// Banner ad unit identifier of the banner to set the custom data for. + /// Banner ad unit identifier of the banner to set the custom data for. Must not be null. /// The custom data to be set. public static void SetBannerCustomData(string adUnitIdentifier, string customData) { @@ -548,7 +549,7 @@ public class MaxSdkiOS : MaxSdkBase /// The banner position on the screen. When setting the banner position via or , /// the banner is placed within the safe area of the screen. This returns the absolute position of the banner on screen. /// - /// Ad unit identifier of the banner for which to get the position on screen. + /// Ad unit identifier of the banner for which to get the position on screen. Must not be null. /// A representing the banner position on screen. public static Rect GetBannerLayout(string adUnitIdentifier) { @@ -567,8 +568,8 @@ public class MaxSdkiOS : MaxSdkBase /// /// Create a new MREC. /// - /// Ad unit identifier of the MREC to create - /// MREC position + /// Ad unit identifier of the MREC to create. Must not be null. + /// MREC position. Must not be null. public static void CreateMRec(string adUnitIdentifier, AdViewPosition mrecPosition) { ValidateAdUnitIdentifier(adUnitIdentifier, "create MREC"); @@ -581,7 +582,7 @@ public class MaxSdkiOS : MaxSdkBase /// /// Create a new MREC with a custom position. /// - /// Ad unit identifier of the MREC to create + /// Ad unit identifier of the MREC to create. Must not be null. /// The X coordinate (horizontal position) of the MREC relative to the top left corner of the screen. /// The Y coordinate (vertical position) of the MREC relative to the top left corner of the screen. /// @@ -601,7 +602,7 @@ public class MaxSdkiOS : MaxSdkBase /// NOTE: The method loads the first MREC ad and initiates an automated MREC refresh process. /// You only need to call this method if you pause MREC refresh. /// - /// Ad unit identifier of the MREC to load + /// Ad unit identifier of the MREC to load. Must not be null. public static void LoadMRec(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "load MREC"); @@ -614,7 +615,7 @@ public class MaxSdkiOS : MaxSdkBase /// /// Set the MREC placement for an ad unit identifier to tie the future ad events to. /// - /// Ad unit identifier of the MREC to set the placement for + /// Ad unit identifier of the MREC to set the placement for. Must not be null. /// Placement to set public static void SetMRecPlacement(string adUnitIdentifier, string placement) { @@ -628,7 +629,7 @@ public class MaxSdkiOS : MaxSdkBase /// /// Starts or resumes auto-refreshing of the MREC for the given ad unit identifier. /// - /// Ad unit identifier of the MREC for which to start auto-refresh + /// Ad unit identifier of the MREC for which to start auto-refresh. Must not be null. public static void StartMRecAutoRefresh(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "start MREC auto-refresh"); @@ -641,7 +642,7 @@ public class MaxSdkiOS : MaxSdkBase /// /// Pauses auto-refreshing of the MREC for the given ad unit identifier. /// - /// Ad unit identifier of the MREC for which to stop auto-refresh + /// Ad unit identifier of the MREC for which to stop auto-refresh. Must not be null. public static void StopMRecAutoRefresh(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "stop MREC auto-refresh"); @@ -654,8 +655,8 @@ public class MaxSdkiOS : MaxSdkBase /// /// Updates the position of the MREC to the new position provided. /// - /// The ad unit identifier of the MREC for which to update the position - /// A new position for the MREC + /// The ad unit identifier of the MREC for which to update the position. Must not be null. + /// A new position for the MREC. Must not be null. public static void UpdateMRecPosition(string adUnitIdentifier, AdViewPosition mrecPosition) { ValidateAdUnitIdentifier(adUnitIdentifier, "update MREC position"); @@ -668,7 +669,7 @@ public class MaxSdkiOS : MaxSdkBase /// /// Updates the position of the MREC to the new coordinates provided. /// - /// The ad unit identifier of the MREC for which to update the position + /// The ad unit identifier of the MREC for which to update the position. Must not be null. /// The X coordinate (horizontal position) of the MREC relative to the top left corner of the screen. /// The Y coordinate (vertical position) of the MREC relative to the top left corner of the screen. /// @@ -686,7 +687,7 @@ public class MaxSdkiOS : MaxSdkBase /// /// Show MREC at a position determined by the 'CreateMRec' call. /// - /// Ad unit identifier of the MREC to show + /// Ad unit identifier of the MREC to show. Must not be null. public static void ShowMRec(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "show MREC"); @@ -699,7 +700,7 @@ public class MaxSdkiOS : MaxSdkBase /// /// Remove MREC from the ad view and destroy it. /// - /// Ad unit identifier of the MREC to destroy + /// Ad unit identifier of the MREC to destroy. Must not be null. public static void DestroyMRec(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "destroy MREC"); @@ -712,7 +713,7 @@ public class MaxSdkiOS : MaxSdkBase /// /// Hide MREC. /// - /// Ad unit identifier of the MREC to hide + /// Ad unit identifier of the MREC to hide. Must not be null. public static void HideMRec(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "hide MREC"); @@ -725,8 +726,8 @@ public class MaxSdkiOS : MaxSdkBase /// /// Set an extra parameter for the MREC ad. /// - /// Ad unit identifier of the MREC to set the extra parameter for. - /// The key for the extra parameter. + /// Ad unit identifier of the MREC to set the extra parameter for. Must not be null. + /// The key for the extra parameter. Must not be null. /// The value for the extra parameter. public static void SetMRecExtraParameter(string adUnitIdentifier, string key, string value) { @@ -743,8 +744,8 @@ public class MaxSdkiOS : MaxSdkBase /// /// Set a local extra parameter for the MREC ad. /// - /// Ad unit identifier of the MREC to set the local extra parameter for. - /// The key for the local extra parameter. + /// Ad unit identifier of the MREC to set the local extra parameter for. Must not be null. + /// The key for the local extra parameter. Must not be null. /// The value for the local extra parameter. Accepts the following types: , null, IList, IDictionary, string, primitive types public static void SetMRecLocalExtraParameter(string adUnitIdentifier, string key, object value) { @@ -767,7 +768,7 @@ public class MaxSdkiOS : MaxSdkBase /// /// The custom data to tie the showing MREC ad to, for ILRD and rewarded postbacks via the {CUSTOM_DATA} macro. Maximum size is 8KB. /// - /// MREC Ad unit identifier of the banner to set the custom data for. + /// MREC Ad unit identifier of the banner to set the custom data for. Must not be null. /// The custom data to be set. public static void SetMRecCustomData(string adUnitIdentifier, string customData) { @@ -782,7 +783,7 @@ public class MaxSdkiOS : MaxSdkBase /// The MREC position on the screen. When setting the banner position via or , /// the banner is placed within the safe area of the screen. This returns the absolute position of the MREC on screen. /// - /// Ad unit identifier of the MREC for which to get the position on screen. + /// Ad unit identifier of the MREC for which to get the position on screen. Must not be null. /// A representing the banner position on screen. public static Rect GetMRecLayout(string adUnitIdentifier) { @@ -793,121 +794,6 @@ public class MaxSdkiOS : MaxSdkBase #endregion - #region Cross Promo Ads - - [DllImport("__Internal")] - private static extern void _MaxCreateCrossPromoAd(string adUnitIdentifier, float x, float y, float width, float height, float rotation); - - /// - /// Create a new cross promo ad with a custom position. - /// - /// Ad unit identifier of the cross promo ad to create - /// The X coordinate (horizontal position) of the cross promo ad relative to the top left corner of the screen. - /// The Y coordinate (vertical position) of the cross promo ad relative to the top left corner of the screen. - /// The width of the cross promo ad. - /// The height of the cross promo ad. - /// The rotation of the cross promo ad in degrees. - /// - /// The cross promo is placed within the safe area of the screen. You can use this to get the absolute position Rect of the cross promo ad on screen. - /// - public static void CreateCrossPromoAd(string adUnitIdentifier, float x, float y, float width, float height, float rotation) - { - ValidateAdUnitIdentifier(adUnitIdentifier, "create cross promo ad"); - _MaxCreateCrossPromoAd(adUnitIdentifier, x, y, width, height, rotation); - } - - [DllImport("__Internal")] - private static extern void _MaxSetCrossPromoAdPlacement(string adUnitIdentifier, string placement); - - /// - /// Set the cross promo ad placement for an ad unit identifier to tie the future ad events to. - /// - /// Ad unit identifier of the cross promo ad to set the placement for - /// Placement to set - public static void SetCrossPromoAdPlacement(string adUnitIdentifier, string placement) - { - ValidateAdUnitIdentifier(adUnitIdentifier, "set cross promo ad placement"); - _MaxSetCrossPromoAdPlacement(adUnitIdentifier, placement); - } - - [DllImport("__Internal")] - private static extern void _MaxUpdateCrossPromoAdPosition(string adUnitIdentifier, float x, float y, float width, float height, float rotation); - - /// - /// Updates the position of the cross promo ad to the new coordinates provided. - /// - /// The ad unit identifier of the cross promo ad for which to update the position - /// The X coordinate (horizontal position) of the cross promo ad relative to the top left corner of the screen. - /// The Y coordinate (vertical position) of the cross promo ad relative to the top left corner of the screen. - /// The width of the cross promo ad. - /// The height of the cross promo ad. - /// The rotation of the cross promo ad in degrees. - /// - /// The cross promo ad is placed within the safe area of the screen. You can use this to get the absolute position Rect of the cross promo ad on screen. - /// - public static void UpdateCrossPromoAdPosition(string adUnitIdentifier, float x, float y, float width, float height, float rotation) - { - ValidateAdUnitIdentifier(adUnitIdentifier, "update cross promo ad position"); - _MaxUpdateCrossPromoAdPosition(adUnitIdentifier, x, y, width, height, rotation); - } - - [DllImport("__Internal")] - private static extern void _MaxShowCrossPromoAd(string adUnitIdentifier); - - /// - /// Show cross promo ad at a position determined by the 'CreateCrossPromoAd' call. - /// - /// Ad unit identifier of the cross promo ad to show - public static void ShowCrossPromoAd(string adUnitIdentifier) - { - ValidateAdUnitIdentifier(adUnitIdentifier, "show cross promo ad"); - _MaxShowCrossPromoAd(adUnitIdentifier); - } - - [DllImport("__Internal")] - private static extern void _MaxDestroyCrossPromoAd(string adUnitIdentifier); - - /// - /// Remove cross promo ad from the ad view and destroy it. - /// - /// Ad unit identifier of the cross promo ad to destroy - public static void DestroyCrossPromoAd(string adUnitIdentifier) - { - ValidateAdUnitIdentifier(adUnitIdentifier, "destroy cross promo ad"); - _MaxDestroyCrossPromoAd(adUnitIdentifier); - } - - [DllImport("__Internal")] - private static extern void _MaxHideCrossPromoAd(string adUnitIdentifier); - - /// - /// Hide cross promo ad. - /// - /// Ad unit identifier of the cross promo ad to hide - public static void HideCrossPromoAd(string adUnitIdentifier) - { - ValidateAdUnitIdentifier(adUnitIdentifier, "hide cross promo ad"); - _MaxHideCrossPromoAd(adUnitIdentifier); - } - - [DllImport("__Internal")] - private static extern string _MaxGetCrossPromoAdLayout(string adUnitIdentifier); - - /// - /// The cross promo ad position on the screen. When setting the cross promo ad position via or , - /// the cross promo ad is placed within the safe area of the screen. This returns the absolute position of the cross promo ad on screen. - /// - /// Ad unit identifier of the cross promo ad for which to get the position on screen. - /// A representing the banner position on screen. - public static Rect GetCrossPromoAdLayout(string adUnitIdentifier) - { - ValidateAdUnitIdentifier(adUnitIdentifier, "get cross promo ad layout"); - var positionRect = _MaxGetCrossPromoAdLayout(adUnitIdentifier); - return GetRectFromString(positionRect); - } - - #endregion - #region Interstitials [DllImport("__Internal")] @@ -916,7 +802,7 @@ public class MaxSdkiOS : MaxSdkBase /// /// Start loading an interstitial. /// - /// Ad unit identifier of the interstitial to load + /// Ad unit identifier of the interstitial to load. Must not be null. public static void LoadInterstitial(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "load interstitial"); @@ -929,7 +815,7 @@ public class MaxSdkiOS : MaxSdkBase /// /// Check if interstitial ad is loaded and ready to be displayed. /// - /// Ad unit identifier of the interstitial ad to check if it's ready to be displayed. + /// Ad unit identifier of the interstitial ad to check if it's ready to be displayed. Must not be null. /// True if the ad is ready to be displayed public static bool IsInterstitialReady(string adUnitIdentifier) { @@ -943,7 +829,7 @@ public class MaxSdkiOS : MaxSdkBase /// /// Present loaded interstitial for a given placement to tie ad events to. Note: if the interstitial is not ready to be displayed nothing will happen. /// - /// Ad unit identifier of the interstitial to load + /// Ad unit identifier of the interstitial to load. Must not be null. /// The placement to tie the showing ad's events to /// The custom data to tie the showing ad's events to. Maximum size is 8KB. public static void ShowInterstitial(string adUnitIdentifier, string placement = null, string customData = null) @@ -966,8 +852,8 @@ public class MaxSdkiOS : MaxSdkBase /// /// Set an extra parameter for the ad. /// - /// Ad unit identifier of the interstitial to set the extra parameter for. - /// The key for the extra parameter. + /// Ad unit identifier of the interstitial to set the extra parameter for. Must not be null. + /// The key for the extra parameter. Must not be null. /// The value for the extra parameter. public static void SetInterstitialExtraParameter(string adUnitIdentifier, string key, string value) { @@ -984,8 +870,8 @@ public class MaxSdkiOS : MaxSdkBase /// /// Set a local extra parameter for the ad. /// - /// Ad unit identifier of the interstitial to set the local extra parameter for. - /// The key for the local extra parameter. + /// Ad unit identifier of the interstitial to set the local extra parameter for. Must not be null. + /// The key for the local extra parameter. Must not be null. /// The value for the local extra parameter. Accepts the following types: , null, IList, IDictionary, string, primitive types public static void SetInterstitialLocalExtraParameter(string adUnitIdentifier, string key, object value) { @@ -1012,7 +898,7 @@ public class MaxSdkiOS : MaxSdkBase /// /// Start loading an app open ad. /// - /// Ad unit identifier of the app open ad to load + /// Ad unit identifier of the app open ad to load. Must not be null. public static void LoadAppOpenAd(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "load app open ad"); @@ -1025,7 +911,7 @@ public class MaxSdkiOS : MaxSdkBase /// /// Check if app open ad ad is loaded and ready to be displayed. /// - /// Ad unit identifier of the app open ad ad to check if it's ready to be displayed. + /// Ad unit identifier of the app open ad ad to check if it's ready to be displayed. Must not be null. /// True if the ad is ready to be displayed public static bool IsAppOpenAdReady(string adUnitIdentifier) { @@ -1039,7 +925,7 @@ public class MaxSdkiOS : MaxSdkBase /// /// Present loaded app open ad for a given placement to tie ad events to. Note: if the app open ad is not ready to be displayed nothing will happen. /// - /// Ad unit identifier of the app open ad to load + /// Ad unit identifier of the app open ad to load. Must not be null. /// The placement to tie the showing ad's events to /// The custom data to tie the showing ad's events to. Maximum size is 8KB. public static void ShowAppOpenAd(string adUnitIdentifier, string placement = null, string customData = null) @@ -1062,8 +948,8 @@ public class MaxSdkiOS : MaxSdkBase /// /// Set an extra parameter for the ad. /// - /// Ad unit identifier of the app open ad to set the extra parameter for. - /// The key for the extra parameter. + /// Ad unit identifier of the app open ad to set the extra parameter for. Must not be null. + /// The key for the extra parameter. Must not be null. /// The value for the extra parameter. public static void SetAppOpenAdExtraParameter(string adUnitIdentifier, string key, string value) { @@ -1080,8 +966,8 @@ public class MaxSdkiOS : MaxSdkBase /// /// Set a local extra parameter for the ad. /// - /// Ad unit identifier of the app open ad to set the local extra parameter for. - /// The key for the local extra parameter. + /// Ad unit identifier of the app open ad to set the local extra parameter for. Must not be null. + /// The key for the local extra parameter. Must not be null. /// The value for the local extra parameter. Accepts the following types: , null, IList, IDictionary, string, primitive types public static void SetAppOpenAdLocalExtraParameter(string adUnitIdentifier, string key, object value) { @@ -1108,7 +994,7 @@ public class MaxSdkiOS : MaxSdkBase /// /// Start loading an rewarded ad. /// - /// Ad unit identifier of the rewarded ad to load + /// Ad unit identifier of the rewarded ad to load. Must not be null. public static void LoadRewardedAd(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "load rewarded ad"); @@ -1121,7 +1007,7 @@ public class MaxSdkiOS : MaxSdkBase /// /// Check if rewarded ad ad is loaded and ready to be displayed. /// - /// Ad unit identifier of the rewarded ad to check if it's ready to be displayed. + /// Ad unit identifier of the rewarded ad to check if it's ready to be displayed. Must not be null. /// True if the ad is ready to be displayed public static bool IsRewardedAdReady(string adUnitIdentifier) { @@ -1135,7 +1021,7 @@ public class MaxSdkiOS : MaxSdkBase /// /// Present loaded rewarded ad for a given placement to tie ad events to. Note: if the rewarded ad is not ready to be displayed nothing will happen. /// - /// Ad unit identifier of the interstitial to load + /// Ad unit identifier of the interstitial to load. Must not be null. /// The placement to tie the showing ad's events to /// The custom data to tie the showing ad's events to. Maximum size is 8KB. public static void ShowRewardedAd(string adUnitIdentifier, string placement = null, string customData = null) @@ -1158,8 +1044,8 @@ public class MaxSdkiOS : MaxSdkBase /// /// Set an extra parameter for the ad. /// - /// Ad unit identifier of the rewarded ad to set the extra parameter for. - /// The key for the extra parameter. + /// Ad unit identifier of the rewarded ad to set the extra parameter for. Must not be null. + /// The key for the extra parameter. Must not be null. /// The value for the extra parameter. public static void SetRewardedAdExtraParameter(string adUnitIdentifier, string key, string value) { @@ -1176,8 +1062,8 @@ public class MaxSdkiOS : MaxSdkBase /// /// Set a local extra parameter for the ad. /// - /// Ad unit identifier of the rewarded ad to set the local extra parameter for. - /// The key for the local extra parameter. + /// Ad unit identifier of the rewarded ad to set the local extra parameter for. Must not be null. + /// The key for the local extra parameter. Must not be null. /// The value for the local extra parameter. Accepts the following types: , null, IList, IDictionary, string, primitive types public static void SetRewardedAdLocalExtraParameter(string adUnitIdentifier, string key, object value) { @@ -1204,7 +1090,7 @@ public class MaxSdkiOS : MaxSdkBase /// /// Start loading an rewarded interstitial ad. /// - /// Ad unit identifier of the rewarded interstitial ad to load + /// Ad unit identifier of the rewarded interstitial ad to load. Must not be null. public static void LoadRewardedInterstitialAd(string adUnitIdentifier) { ValidateAdUnitIdentifier(adUnitIdentifier, "load rewarded interstitial ad"); @@ -1217,7 +1103,7 @@ public class MaxSdkiOS : MaxSdkBase /// /// Check if rewarded interstitial ad ad is loaded and ready to be displayed. /// - /// Ad unit identifier of the rewarded interstitial ad to check if it's ready to be displayed + /// Ad unit identifier of the rewarded interstitial ad to check if it's ready to be displayed. Must not be null. /// True if the ad is ready to be displayed public static bool IsRewardedInterstitialAdReady(string adUnitIdentifier) { @@ -1231,7 +1117,7 @@ public class MaxSdkiOS : MaxSdkBase /// /// Present loaded rewarded interstitial ad for a given placement to tie ad events to. Note: if the rewarded interstitial ad is not ready to be displayed nothing will happen. /// - /// Ad unit identifier of the rewarded interstitial to show + /// Ad unit identifier of the rewarded interstitial to show. Must not be null. /// The placement to tie the showing ad's events to /// The custom data to tie the showing ad's events to. Maximum size is 8KB. public static void ShowRewardedInterstitialAd(string adUnitIdentifier, string placement = null, string customData = null) @@ -1254,8 +1140,8 @@ public class MaxSdkiOS : MaxSdkBase /// /// Set an extra parameter for the ad. /// - /// Ad unit identifier of the rewarded interstitial ad to set the extra parameter for. - /// The key for the extra parameter. + /// Ad unit identifier of the rewarded interstitial ad to set the extra parameter for. Must not be null. + /// The key for the extra parameter. Must not be null. /// The value for the extra parameter. public static void SetRewardedInterstitialAdExtraParameter(string adUnitIdentifier, string key, string value) { @@ -1272,8 +1158,8 @@ public class MaxSdkiOS : MaxSdkBase /// /// Set a local extra parameter for the ad. /// - /// Ad unit identifier of the rewarded interstitial ad to set the local extra parameter for. - /// The key for the local extra parameter. + /// Ad unit identifier of the rewarded interstitial ad to set the local extra parameter for. Must not be null. + /// The key for the local extra parameter. Must not be null. /// The value for the local extra parameter. Accepts the following types: , null, IList, IDictionary, string, primitive types public static void SetRewardedInterstitialAdLocalExtraParameter(string adUnitIdentifier, string key, object value) { @@ -1300,7 +1186,7 @@ public class MaxSdkiOS : MaxSdkBase /// /// Track an event using AppLovin. /// - /// An event from the list of pre-defined events may be found in MaxEvents.cs as part of the AppLovin SDK framework. + /// An event from the list of pre-defined events may be found in MaxEvents.cs as part of the AppLovin SDK framework. Must not be null. /// A dictionary containing key-value pairs further describing this event. public static void TrackEvent(string name, IDictionary parameters = null) { @@ -1431,6 +1317,30 @@ public class MaxSdkiOS : MaxSdkBase _MaxSetExtraParameter(key, value); } + [DllImport("__Internal")] + private static extern IntPtr _MaxGetSafeAreaInsets(); + + /// + /// Get the native insets in pixels for the safe area. + /// These insets are used to position ads within the safe area of the screen. + /// + public static SafeAreaInsets GetSafeAreaInsets() + { + // Use an int array instead of json serialization for performance + var insetsPtr = _MaxGetSafeAreaInsets(); + var insets = new int[4]; + Marshal.Copy(insetsPtr, insets, 0, 4); + + // Convert from points to pixels + var screenDensity = MaxSdkUtils.GetScreenDensity(); + for (var i = 0; i < insets.Length; i++) + { + insets[i] *= (int) screenDensity; + } + + return new SafeAreaInsets(insets); + } + #endregion #region Private diff --git a/MaxSdk/Version.md b/MaxSdk/Version.md index 624e225..a8f16fc 100644 --- a/MaxSdk/Version.md +++ b/MaxSdk/Version.md @@ -1,3 +1,3 @@ # AppLovin MAX Unity Plugin -To get the latest changes, see the [AppLovin MAX Unity Changelog](https://dash.applovin.com/documentation/mediation/unity/changelog). +To get the latest changes, see the [AppLovin MAX Unity Changelog](https://developers.applovin.com/en/unity/changelog). diff --git a/Mediation.meta b/Mediation.meta index 3f88ba8..103dd6f 100644 --- a/Mediation.meta +++ b/Mediation.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: bf43583e6cbdf4100992c490f06b0236 +guid: dcf2020c4018447c9b91170c0f62d799 labels: - al_max - al_max_export_path-MaxSdk/Mediation diff --git a/Mediation/BidMachine.meta b/Mediation/BidMachine.meta index 886f559..4d8e78c 100644 --- a/Mediation/BidMachine.meta +++ b/Mediation/BidMachine.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 2517d55f5a88f4df0a0ad7ccb9536bbd +guid: cb8583c72675544e2a48b72f5842b9d4 labels: - al_max - al_max_export_path-MaxSdk/Mediation/BidMachine +- al_max_export_path-MaxSdk/Mediation~HEAD/BidMachine folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/BidMachine/Editor.meta b/Mediation/BidMachine/Editor.meta index ed614b2..8c9328d 100644 --- a/Mediation/BidMachine/Editor.meta +++ b/Mediation/BidMachine/Editor.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: a403837a1ff2b43a48d27bc3d8c38e0b +guid: 738f8b304e76240d9a74d548a9ef1eac labels: - al_max - al_max_export_path-MaxSdk/Mediation/BidMachine/Editor +- al_max_export_path-MaxSdk/Mediation~HEAD/BidMachine/Editor folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/BidMachine/Editor/Dependencies.xml b/Mediation/BidMachine/Editor/Dependencies.xml index 3374645..5257026 100644 --- a/Mediation/BidMachine/Editor/Dependencies.xml +++ b/Mediation/BidMachine/Editor/Dependencies.xml @@ -1,13 +1,13 @@ - + https://artifactory.bidmachine.io/bidmachine - + diff --git a/Mediation/BidMachine/Editor/Dependencies.xml.meta b/Mediation/BidMachine/Editor/Dependencies.xml.meta index e19405f..1c3a94c 100644 --- a/Mediation/BidMachine/Editor/Dependencies.xml.meta +++ b/Mediation/BidMachine/Editor/Dependencies.xml.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: ed022982473dc449790acd436b75f069 +guid: 05bed64f42dca4c34bd8d806db7fc640 labels: - al_max - al_max_export_path-MaxSdk/Mediation/BidMachine/Editor/Dependencies.xml +- al_max_export_path-MaxSdk/Mediation~HEAD/BidMachine/Editor/Dependencies.xml TextScriptImporter: externalObjects: {} userData: diff --git a/Mediation/ByteDance.meta b/Mediation/ByteDance.meta index 8e3115a..4a1f4a9 100644 --- a/Mediation/ByteDance.meta +++ b/Mediation/ByteDance.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 8d26d491d3a3a49099fa24d0661bc679 +guid: e2630939c2c7c4a4d8f68c0be1326912 labels: - al_max - al_max_export_path-MaxSdk/Mediation/ByteDance +- al_max_export_path-MaxSdk/Mediation~HEAD/ByteDance folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/ByteDance/Editor.meta b/Mediation/ByteDance/Editor.meta index e24e5a1..dfeaf02 100644 --- a/Mediation/ByteDance/Editor.meta +++ b/Mediation/ByteDance/Editor.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 134dbb9ef89ad4ce8903caf7e3521068 +guid: c3a7d329dc2ad4d6b812c867563af411 labels: - al_max - al_max_export_path-MaxSdk/Mediation/ByteDance/Editor +- al_max_export_path-MaxSdk/Mediation~HEAD/ByteDance/Editor folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/ByteDance/Editor/Dependencies.xml b/Mediation/ByteDance/Editor/Dependencies.xml index 1fede9e..24e33a8 100644 --- a/Mediation/ByteDance/Editor/Dependencies.xml +++ b/Mediation/ByteDance/Editor/Dependencies.xml @@ -1,13 +1,13 @@ - + https://artifact.bytedance.com/repository/pangle - + diff --git a/Mediation/ByteDance/Editor/Dependencies.xml.meta b/Mediation/ByteDance/Editor/Dependencies.xml.meta index 41d1ed1..fc8ed34 100644 --- a/Mediation/ByteDance/Editor/Dependencies.xml.meta +++ b/Mediation/ByteDance/Editor/Dependencies.xml.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 9e62a8eeacf00427189ab365487c6788 +guid: 2a9fe4b4b4c29455a88fe447e654b991 labels: - al_max - al_max_export_path-MaxSdk/Mediation/ByteDance/Editor/Dependencies.xml +- al_max_export_path-MaxSdk/Mediation~HEAD/ByteDance/Editor/Dependencies.xml TextScriptImporter: externalObjects: {} userData: diff --git a/Mediation/Chartboost.meta b/Mediation/Chartboost.meta index a37e1ee..a8c201a 100644 --- a/Mediation/Chartboost.meta +++ b/Mediation/Chartboost.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: cdf0a0280532549aa8edd2572cf9f30a +guid: 5a0754b40d15d4f3bbd74daa8ae53760 labels: - al_max - al_max_export_path-MaxSdk/Mediation/Chartboost +- al_max_export_path-MaxSdk/Mediation~HEAD/Chartboost folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/Chartboost/Editor.meta b/Mediation/Chartboost/Editor.meta index 2e2a4b2..7f71c3a 100644 --- a/Mediation/Chartboost/Editor.meta +++ b/Mediation/Chartboost/Editor.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: d9b83756149e3450fbe7adaef44acc7c +guid: 5f0d60b541006441b81dc6337d7cf525 labels: - al_max - al_max_export_path-MaxSdk/Mediation/Chartboost/Editor +- al_max_export_path-MaxSdk/Mediation~HEAD/Chartboost/Editor folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/Chartboost/Editor/Dependencies.xml b/Mediation/Chartboost/Editor/Dependencies.xml index eb84026..2cd6ec2 100644 --- a/Mediation/Chartboost/Editor/Dependencies.xml +++ b/Mediation/Chartboost/Editor/Dependencies.xml @@ -1,7 +1,7 @@ - + https://cboost.jfrog.io/artifactory/chartboost-ads/ @@ -9,6 +9,6 @@ - + diff --git a/Mediation/Chartboost/Editor/Dependencies.xml.meta b/Mediation/Chartboost/Editor/Dependencies.xml.meta index a5b328e..8a7b888 100644 --- a/Mediation/Chartboost/Editor/Dependencies.xml.meta +++ b/Mediation/Chartboost/Editor/Dependencies.xml.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: cc8d96477a13b42e6bfd4ae014091839 +guid: 9161fa56d0493406a993a9e823325e72 labels: - al_max - al_max_export_path-MaxSdk/Mediation/Chartboost/Editor/Dependencies.xml +- al_max_export_path-MaxSdk/Mediation~HEAD/Chartboost/Editor/Dependencies.xml TextScriptImporter: externalObjects: {} userData: diff --git a/Mediation/Facebook.meta b/Mediation/Facebook.meta index da1c256..9c35f8c 100644 --- a/Mediation/Facebook.meta +++ b/Mediation/Facebook.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: ec86cd1d78d9c4578b1b3d0b9f90a710 +guid: 7d6a70451ec9e474abcbe1c2312930ee labels: - al_max - al_max_export_path-MaxSdk/Mediation/Facebook +- al_max_export_path-MaxSdk/Mediation~HEAD/Facebook folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/Facebook/Editor.meta b/Mediation/Facebook/Editor.meta index 268e637..e7a74f1 100644 --- a/Mediation/Facebook/Editor.meta +++ b/Mediation/Facebook/Editor.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 9ac0f69a1efee49ce8d4cd94def5f714 +guid: 3eef9cb24832346bba46bd0e2b68804c labels: - al_max - al_max_export_path-MaxSdk/Mediation/Facebook/Editor +- al_max_export_path-MaxSdk/Mediation~HEAD/Facebook/Editor folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/Facebook/Editor/Dependencies.xml b/Mediation/Facebook/Editor/Dependencies.xml index 6bf87ae..e9c4ef1 100644 --- a/Mediation/Facebook/Editor/Dependencies.xml +++ b/Mediation/Facebook/Editor/Dependencies.xml @@ -5,9 +5,9 @@ Since FAN SDK depends on older versions of a few support and play service versions `com.applovin.mediation:facebook-adapter:x.y.z.a` resolves to `com.applovin.mediation:facebook-adapter:+` which pulls down the beta versions of FAN SDK. Note that forcing the adapter is enough to stop Jar Resolver from pulling the latest FAN SDK. --> - + - + diff --git a/Mediation/Facebook/Editor/Dependencies.xml.meta b/Mediation/Facebook/Editor/Dependencies.xml.meta index 53d8169..5bd3a48 100644 --- a/Mediation/Facebook/Editor/Dependencies.xml.meta +++ b/Mediation/Facebook/Editor/Dependencies.xml.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 2a0ec38138ef947f5b754b5bad86f92b +guid: de4de606c1f804ae29ac2dc10e50b153 labels: - al_max - al_max_export_path-MaxSdk/Mediation/Facebook/Editor/Dependencies.xml +- al_max_export_path-MaxSdk/Mediation~HEAD/Facebook/Editor/Dependencies.xml TextScriptImporter: externalObjects: {} userData: diff --git a/Mediation/Fyber.meta b/Mediation/Fyber.meta index faa443b..fb1fcfa 100644 --- a/Mediation/Fyber.meta +++ b/Mediation/Fyber.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: e71b6f14515d24ef888a2154168d7dd1 +guid: b69bcc046a0f942b083c5d524acd0e05 labels: - al_max - al_max_export_path-MaxSdk/Mediation/Fyber +- al_max_export_path-MaxSdk/Mediation~HEAD/Fyber folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/Fyber/Editor.meta b/Mediation/Fyber/Editor.meta index 9f2ae2d..02a8932 100644 --- a/Mediation/Fyber/Editor.meta +++ b/Mediation/Fyber/Editor.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: c295f0d2d07ef40d0b0ee0b7dc588112 +guid: 9353a92ae275b4ad290817705802cfd5 labels: - al_max - al_max_export_path-MaxSdk/Mediation/Fyber/Editor +- al_max_export_path-MaxSdk/Mediation~HEAD/Fyber/Editor folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/Fyber/Editor/Dependencies.xml b/Mediation/Fyber/Editor/Dependencies.xml index 4634674..9f5f74e 100644 --- a/Mediation/Fyber/Editor/Dependencies.xml +++ b/Mediation/Fyber/Editor/Dependencies.xml @@ -1,9 +1,9 @@ - + - + diff --git a/Mediation/Fyber/Editor/Dependencies.xml.meta b/Mediation/Fyber/Editor/Dependencies.xml.meta index f9d4b50..4538967 100644 --- a/Mediation/Fyber/Editor/Dependencies.xml.meta +++ b/Mediation/Fyber/Editor/Dependencies.xml.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: bcfbfa8036e6743f494cf165c5d9ebbd +guid: 19663f1a08f31409383df69efcae68e8 labels: - al_max - al_max_export_path-MaxSdk/Mediation/Fyber/Editor/Dependencies.xml +- al_max_export_path-MaxSdk/Mediation~HEAD/Fyber/Editor/Dependencies.xml TextScriptImporter: externalObjects: {} userData: diff --git a/Mediation/Fyber/Editor/PrivacyInfo.xcprivacy b/Mediation/Fyber/Editor/PrivacyInfo.xcprivacy new file mode 100644 index 0000000..f33055a --- /dev/null +++ b/Mediation/Fyber/Editor/PrivacyInfo.xcprivacy @@ -0,0 +1,102 @@ + + + + + NSPrivacyTrackingDomains + + NSPrivacyCollectedDataTypes + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypeOtherDataTypes + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeThirdPartyAdvertising + NSPrivacyCollectedDataTypePurposeAnalytics + + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypeCrashData + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeAppFunctionality + NSPrivacyCollectedDataTypePurposeAnalytics + + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypeOtherUsageData + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeAnalytics + NSPrivacyCollectedDataTypePurposeThirdPartyAdvertising + + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypeAdvertisingData + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeAnalytics + NSPrivacyCollectedDataTypePurposeThirdPartyAdvertising + + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypeDeviceID + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeAnalytics + NSPrivacyCollectedDataTypePurposeThirdPartyAdvertising + + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypeUserID + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeAnalytics + NSPrivacyCollectedDataTypePurposeThirdPartyAdvertising + + + + NSPrivacyAccessedAPITypes + + + NSPrivacyAccessedAPITypeReasons + + CA92.1 + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryUserDefaults + + + NSPrivacyTracking + + + diff --git a/Mediation/Fyber/Editor/PrivacyInfo.xcprivacy.meta b/Mediation/Fyber/Editor/PrivacyInfo.xcprivacy.meta new file mode 100644 index 0000000..755381b --- /dev/null +++ b/Mediation/Fyber/Editor/PrivacyInfo.xcprivacy.meta @@ -0,0 +1,31 @@ +fileFormatVersion: 2 +guid: 91350cee35c224b38b50c27772c5113b +labels: +- al_max +- al_max_export_path-MaxSdk/Mediation/Fyber/Editor/PrivacyInfo.xcprivacy +- al_max_export_path-MaxSdk/Mediation~HEAD/Fyber/Editor/PrivacyInfo.xcprivacy +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Mediation/Google.meta b/Mediation/Google.meta index 9132c5a..e11b283 100644 --- a/Mediation/Google.meta +++ b/Mediation/Google.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 65bddcfa0d4724edc9f072db3d50619b +guid: 6ad5197cdbf644485847d8fb29a420b6 labels: - al_max - al_max_export_path-MaxSdk/Mediation/Google +- al_max_export_path-MaxSdk/Mediation~HEAD/Google folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/Google/Editor.meta b/Mediation/Google/Editor.meta index c37cd69..0e69016 100644 --- a/Mediation/Google/Editor.meta +++ b/Mediation/Google/Editor.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 64d03e7c67a984b1aad2985e257164a3 +guid: dbd0fba122c414a7495b270531c03d1f labels: - al_max - al_max_export_path-MaxSdk/Mediation/Google/Editor +- al_max_export_path-MaxSdk/Mediation~HEAD/Google/Editor folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/Google/Editor/Dependencies.xml b/Mediation/Google/Editor/Dependencies.xml index e46e764..7117a84 100644 --- a/Mediation/Google/Editor/Dependencies.xml +++ b/Mediation/Google/Editor/Dependencies.xml @@ -2,9 +2,9 @@ - + - + diff --git a/Mediation/Google/Editor/Dependencies.xml.meta b/Mediation/Google/Editor/Dependencies.xml.meta index 22bd0a8..0f6a2ea 100644 --- a/Mediation/Google/Editor/Dependencies.xml.meta +++ b/Mediation/Google/Editor/Dependencies.xml.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 582315940e87e43119fceac61149e436 +guid: bed2adce7970b4794b5c8b4eb04b8d70 labels: - al_max - al_max_export_path-MaxSdk/Mediation/Google/Editor/Dependencies.xml +- al_max_export_path-MaxSdk/Mediation~HEAD/Google/Editor/Dependencies.xml TextScriptImporter: externalObjects: {} userData: diff --git a/Mediation/GoogleAdManager.meta b/Mediation/GoogleAdManager.meta index e2fcd86..65c78ee 100644 --- a/Mediation/GoogleAdManager.meta +++ b/Mediation/GoogleAdManager.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: d1f3261de05ff44b683b375ef22f9d02 +guid: 5a2b43e1f3e144dbcbc6aa5b450c0e16 labels: - al_max - al_max_export_path-MaxSdk/Mediation/GoogleAdManager +- al_max_export_path-MaxSdk/Mediation~HEAD/GoogleAdManager folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/GoogleAdManager/Editor.meta b/Mediation/GoogleAdManager/Editor.meta index 141895d..25608c1 100644 --- a/Mediation/GoogleAdManager/Editor.meta +++ b/Mediation/GoogleAdManager/Editor.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 19fca049bce7e47ac996d2880fbc43a0 +guid: 60cbbf6fbf3594ee88384433b9016bf7 labels: - al_max - al_max_export_path-MaxSdk/Mediation/GoogleAdManager/Editor +- al_max_export_path-MaxSdk/Mediation~HEAD/GoogleAdManager/Editor folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/GoogleAdManager/Editor/Dependencies.xml b/Mediation/GoogleAdManager/Editor/Dependencies.xml index 189df74..635f9cb 100644 --- a/Mediation/GoogleAdManager/Editor/Dependencies.xml +++ b/Mediation/GoogleAdManager/Editor/Dependencies.xml @@ -2,9 +2,9 @@ - + - + diff --git a/Mediation/GoogleAdManager/Editor/Dependencies.xml.meta b/Mediation/GoogleAdManager/Editor/Dependencies.xml.meta index 73a1ed8..dd787f9 100644 --- a/Mediation/GoogleAdManager/Editor/Dependencies.xml.meta +++ b/Mediation/GoogleAdManager/Editor/Dependencies.xml.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 86f0d2d61d3814f31be3b92dc006eaa5 +guid: 6879d254b74b64a9384ea463b083710a labels: - al_max - al_max_export_path-MaxSdk/Mediation/GoogleAdManager/Editor/Dependencies.xml +- al_max_export_path-MaxSdk/Mediation~HEAD/GoogleAdManager/Editor/Dependencies.xml TextScriptImporter: externalObjects: {} userData: diff --git a/Mediation/HyprMX/Editor/Dependencies.xml b/Mediation/HyprMX/Editor/Dependencies.xml deleted file mode 100644 index 1aedbe4..0000000 --- a/Mediation/HyprMX/Editor/Dependencies.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/Mediation/HyprMX/Editor/Dependencies.xml.meta b/Mediation/HyprMX/Editor/Dependencies.xml.meta deleted file mode 100644 index c114479..0000000 --- a/Mediation/HyprMX/Editor/Dependencies.xml.meta +++ /dev/null @@ -1,10 +0,0 @@ -fileFormatVersion: 2 -guid: 3cea11a37596149ce9dfb88bf2317b2d -labels: -- al_max -- al_max_export_path-MaxSdk/Mediation/HyprMX/Editor/Dependencies.xml -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Mediation/InMobi.meta b/Mediation/InMobi.meta index b084c24..5dc0555 100644 --- a/Mediation/InMobi.meta +++ b/Mediation/InMobi.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: c255b9935f2d34e549f2952442ba179a +guid: 6d6669637ce0e45d990df0a9744e3718 labels: - al_max - al_max_export_path-MaxSdk/Mediation/InMobi +- al_max_export_path-MaxSdk/Mediation~HEAD/InMobi folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/InMobi/Editor.meta b/Mediation/InMobi/Editor.meta index fa200df..7845382 100644 --- a/Mediation/InMobi/Editor.meta +++ b/Mediation/InMobi/Editor.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 6f8cceba06be048318f1772ff089513e +guid: 84e8f70cb0db54f8bbc5a31fcee4dd24 labels: - al_max - al_max_export_path-MaxSdk/Mediation/InMobi/Editor +- al_max_export_path-MaxSdk/Mediation~HEAD/InMobi/Editor folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/InMobi/Editor/Dependencies.xml b/Mediation/InMobi/Editor/Dependencies.xml index a1ed4d1..e0cc0e3 100644 --- a/Mediation/InMobi/Editor/Dependencies.xml +++ b/Mediation/InMobi/Editor/Dependencies.xml @@ -1,12 +1,12 @@ - + - + diff --git a/Mediation/InMobi/Editor/Dependencies.xml.meta b/Mediation/InMobi/Editor/Dependencies.xml.meta index 8a92321..e546452 100644 --- a/Mediation/InMobi/Editor/Dependencies.xml.meta +++ b/Mediation/InMobi/Editor/Dependencies.xml.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: f1c75ebcc7d8043369cbacd2c0931f64 +guid: 956544e622f4447da82415cb534d1e31 labels: - al_max - al_max_export_path-MaxSdk/Mediation/InMobi/Editor/Dependencies.xml +- al_max_export_path-MaxSdk/Mediation~HEAD/InMobi/Editor/Dependencies.xml TextScriptImporter: externalObjects: {} userData: diff --git a/Mediation/IronSource.meta b/Mediation/IronSource.meta index 071b8fc..bf36a7a 100644 --- a/Mediation/IronSource.meta +++ b/Mediation/IronSource.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 4cd1f6dac423e46c6b945be9139840a1 +guid: 233710faa34714ebe849e87e116ec944 labels: - al_max - al_max_export_path-MaxSdk/Mediation/IronSource +- al_max_export_path-MaxSdk/Mediation~HEAD/IronSource folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/IronSource/Editor.meta b/Mediation/IronSource/Editor.meta index 82f21e5..fb4d05f 100644 --- a/Mediation/IronSource/Editor.meta +++ b/Mediation/IronSource/Editor.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 07ba0da9896ba451cb315e594d1a5cf7 +guid: 34f3ea4ef9439473ca8a8001a452714d labels: - al_max - al_max_export_path-MaxSdk/Mediation/IronSource/Editor +- al_max_export_path-MaxSdk/Mediation~HEAD/IronSource/Editor folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/IronSource/Editor/Dependencies.xml b/Mediation/IronSource/Editor/Dependencies.xml index 80ca59a..099c417 100644 --- a/Mediation/IronSource/Editor/Dependencies.xml +++ b/Mediation/IronSource/Editor/Dependencies.xml @@ -1,13 +1,13 @@ - + https://android-sdk.is.com/ - + diff --git a/Mediation/IronSource/Editor/Dependencies.xml.meta b/Mediation/IronSource/Editor/Dependencies.xml.meta index 8ec4264..2c502b4 100644 --- a/Mediation/IronSource/Editor/Dependencies.xml.meta +++ b/Mediation/IronSource/Editor/Dependencies.xml.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 7bd4c81ab75f74fa58d9b63ee1bb171b +guid: 3abf0601a5bc0460d9391a63671a1c29 labels: - al_max - al_max_export_path-MaxSdk/Mediation/IronSource/Editor/Dependencies.xml +- al_max_export_path-MaxSdk/Mediation~HEAD/IronSource/Editor/Dependencies.xml TextScriptImporter: externalObjects: {} userData: diff --git a/Mediation/MediationAdapters.txt.meta b/Mediation/MediationAdapters.txt.meta index 9c21d7c..109264f 100644 --- a/Mediation/MediationAdapters.txt.meta +++ b/Mediation/MediationAdapters.txt.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 6dbc0916533df44558be0780f1cdee2d +guid: de3543045917044cc9b1e19d4ba05d0a labels: - al_max - al_max_export_path-MaxSdk/Mediation/MediationAdapters.txt diff --git a/Mediation/Mintegral.meta b/Mediation/Mintegral.meta index c8af0f1..087d2c3 100644 --- a/Mediation/Mintegral.meta +++ b/Mediation/Mintegral.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: b179b418a7c854c959f267998d69c97f +guid: 21a7fc0e7ca48454ea08a21213aed628 labels: - al_max - al_max_export_path-MaxSdk/Mediation/Mintegral +- al_max_export_path-MaxSdk/Mediation~HEAD/Mintegral folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/Mintegral/Editor.meta b/Mediation/Mintegral/Editor.meta index f1e3e91..0d2918b 100644 --- a/Mediation/Mintegral/Editor.meta +++ b/Mediation/Mintegral/Editor.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: cb6cec540610743ef8013fd81dac62d5 +guid: bf7e53ef2815a4ce4a353006a74ece94 labels: - al_max - al_max_export_path-MaxSdk/Mediation/Mintegral/Editor +- al_max_export_path-MaxSdk/Mediation~HEAD/Mintegral/Editor folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/Mintegral/Editor/Dependencies.xml b/Mediation/Mintegral/Editor/Dependencies.xml index aab67f1..0d71bb6 100644 --- a/Mediation/Mintegral/Editor/Dependencies.xml +++ b/Mediation/Mintegral/Editor/Dependencies.xml @@ -1,7 +1,7 @@ - + https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea @@ -9,6 +9,6 @@ - + diff --git a/Mediation/Mintegral/Editor/Dependencies.xml.meta b/Mediation/Mintegral/Editor/Dependencies.xml.meta index f4c975f..13899ec 100644 --- a/Mediation/Mintegral/Editor/Dependencies.xml.meta +++ b/Mediation/Mintegral/Editor/Dependencies.xml.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 601cce40ce64b4e67a94ce92bcb561ec +guid: 91184486952bb4873b601d55ff816ad9 labels: - al_max - al_max_export_path-MaxSdk/Mediation/Mintegral/Editor/Dependencies.xml +- al_max_export_path-MaxSdk/Mediation~HEAD/Mintegral/Editor/Dependencies.xml TextScriptImporter: externalObjects: {} userData: diff --git a/Mediation/MobileFuse.meta b/Mediation/MobileFuse.meta index c9812a8..596e8c1 100644 --- a/Mediation/MobileFuse.meta +++ b/Mediation/MobileFuse.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 658575d78393447b7ab83cad98afe7ff +guid: e8bbe95079060473eabef2f7cccd9d8d labels: - al_max - al_max_export_path-MaxSdk/Mediation/MobileFuse +- al_max_export_path-MaxSdk/Mediation~HEAD/MobileFuse folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/MobileFuse/Editor.meta b/Mediation/MobileFuse/Editor.meta index 7c34371..e9cea36 100644 --- a/Mediation/MobileFuse/Editor.meta +++ b/Mediation/MobileFuse/Editor.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: e7d20afe7dca4408681433ab54b1b872 +guid: f565c966cedfc4a718c125c9a4495640 labels: - al_max - al_max_export_path-MaxSdk/Mediation/MobileFuse/Editor +- al_max_export_path-MaxSdk/Mediation~HEAD/MobileFuse/Editor folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/MobileFuse/Editor/Dependencies.xml.meta b/Mediation/MobileFuse/Editor/Dependencies.xml.meta index 0f6bc74..b699207 100644 --- a/Mediation/MobileFuse/Editor/Dependencies.xml.meta +++ b/Mediation/MobileFuse/Editor/Dependencies.xml.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 02f8fb577300f42f7908aa5e9b21d4d5 +guid: 8f73aa71e8b3641fd96edc278218e7c3 labels: - al_max - al_max_export_path-MaxSdk/Mediation/MobileFuse/Editor/Dependencies.xml +- al_max_export_path-MaxSdk/Mediation~HEAD/MobileFuse/Editor/Dependencies.xml TextScriptImporter: externalObjects: {} userData: diff --git a/Mediation/HyprMX.meta b/Mediation/Moloco.meta similarity index 64% rename from Mediation/HyprMX.meta rename to Mediation/Moloco.meta index 262c90a..2e95b5c 100644 --- a/Mediation/HyprMX.meta +++ b/Mediation/Moloco.meta @@ -1,8 +1,8 @@ fileFormatVersion: 2 -guid: 8dc9535583b704b6b99d4a8611b2bf58 +guid: 09d05d27690c64a7e83fbbabceaaa10a labels: - al_max -- al_max_export_path-MaxSdk/Mediation/HyprMX +- al_max_export_path-MaxSdk/Mediation/Moloco folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/HyprMX/Editor.meta b/Mediation/Moloco/Editor.meta similarity index 62% rename from Mediation/HyprMX/Editor.meta rename to Mediation/Moloco/Editor.meta index d8c9fb1..9299be4 100644 --- a/Mediation/HyprMX/Editor.meta +++ b/Mediation/Moloco/Editor.meta @@ -1,8 +1,8 @@ fileFormatVersion: 2 -guid: a2df7812aaa2840828da41d0ea199d2a +guid: a86a3a94db2fc4759a126a577b762257 labels: - al_max -- al_max_export_path-MaxSdk/Mediation/HyprMX/Editor +- al_max_export_path-MaxSdk/Mediation/Moloco/Editor folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/Moloco/Editor/Dependencies.xml b/Mediation/Moloco/Editor/Dependencies.xml new file mode 100644 index 0000000..6dec925 --- /dev/null +++ b/Mediation/Moloco/Editor/Dependencies.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/Moloco/Editor/ALMolocoAdapterDependencies.xml.meta b/Mediation/Moloco/Editor/Dependencies.xml.meta similarity index 84% rename from Moloco/Editor/ALMolocoAdapterDependencies.xml.meta rename to Mediation/Moloco/Editor/Dependencies.xml.meta index 3603b28..48c943c 100644 --- a/Moloco/Editor/ALMolocoAdapterDependencies.xml.meta +++ b/Mediation/Moloco/Editor/Dependencies.xml.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4285403e3608e4fc68d6ada86a902e2c +guid: a8dcf6082639f4c5aa7239a54a5a7208 labels: - al_max - al_max_export_path-MaxSdk/Mediation/Moloco/Editor/Dependencies.xml diff --git a/Mediation/OguryPresage.meta b/Mediation/OguryPresage.meta index c3931cc..4495d6c 100644 --- a/Mediation/OguryPresage.meta +++ b/Mediation/OguryPresage.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: ae3d550243f384da69dbc99904010d5f +guid: b3a52c271286d41e1964d237053cf4ed labels: - al_max - al_max_export_path-MaxSdk/Mediation/OguryPresage +- al_max_export_path-MaxSdk/Mediation~HEAD/OguryPresage folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/OguryPresage/Editor.meta b/Mediation/OguryPresage/Editor.meta index 632b915..b6016e2 100644 --- a/Mediation/OguryPresage/Editor.meta +++ b/Mediation/OguryPresage/Editor.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: e2b7e456bd328406faed59484e5eb362 +guid: 86c4224b9f5c8449389e50e4bec806c8 labels: - al_max - al_max_export_path-MaxSdk/Mediation/OguryPresage/Editor +- al_max_export_path-MaxSdk/Mediation~HEAD/OguryPresage/Editor folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/OguryPresage/Editor/Dependencies.xml b/Mediation/OguryPresage/Editor/Dependencies.xml index 2d5d6e4..fe086c8 100644 --- a/Mediation/OguryPresage/Editor/Dependencies.xml +++ b/Mediation/OguryPresage/Editor/Dependencies.xml @@ -1,13 +1,13 @@ - + https://maven.ogury.co - + diff --git a/Mediation/OguryPresage/Editor/Dependencies.xml.meta b/Mediation/OguryPresage/Editor/Dependencies.xml.meta index 5f7a630..85434a6 100644 --- a/Mediation/OguryPresage/Editor/Dependencies.xml.meta +++ b/Mediation/OguryPresage/Editor/Dependencies.xml.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 279ded09ad5324bffa3c5d6e7db9578e +guid: 8c0076ed158f64df9be1f044f888d9a5 labels: - al_max - al_max_export_path-MaxSdk/Mediation/OguryPresage/Editor/Dependencies.xml +- al_max_export_path-MaxSdk/Mediation~HEAD/OguryPresage/Editor/Dependencies.xml TextScriptImporter: externalObjects: {} userData: diff --git a/Mediation/Smaato.meta b/Mediation/Smaato.meta index af45ef7..0bf2491 100644 --- a/Mediation/Smaato.meta +++ b/Mediation/Smaato.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 6ee2d333aa7f94a828058d15045acd07 +guid: 015ddda2fe4ea49d1b0f6497631cf958 labels: - al_max - al_max_export_path-MaxSdk/Mediation/Smaato +- al_max_export_path-MaxSdk/Mediation~HEAD/Smaato folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/Smaato/Editor.meta b/Mediation/Smaato/Editor.meta index cccfbaa..bbe9aa1 100644 --- a/Mediation/Smaato/Editor.meta +++ b/Mediation/Smaato/Editor.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 0c78826a6fec148b5af5c462901e43cf +guid: 06993d059a7b94369949fedf7b0efd26 labels: - al_max - al_max_export_path-MaxSdk/Mediation/Smaato/Editor +- al_max_export_path-MaxSdk/Mediation~HEAD/Smaato/Editor folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/Smaato/Editor/Dependencies.xml b/Mediation/Smaato/Editor/Dependencies.xml index f748272..195176e 100644 --- a/Mediation/Smaato/Editor/Dependencies.xml +++ b/Mediation/Smaato/Editor/Dependencies.xml @@ -1,13 +1,13 @@ - + https://s3.amazonaws.com/smaato-sdk-releases/ - + diff --git a/Mediation/Smaato/Editor/Dependencies.xml.meta b/Mediation/Smaato/Editor/Dependencies.xml.meta index 8f3f98c..06b6cf9 100644 --- a/Mediation/Smaato/Editor/Dependencies.xml.meta +++ b/Mediation/Smaato/Editor/Dependencies.xml.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: c62a04e9cb46340ceb7a59499814bffa +guid: 6c676e02e77d944f7887c1fbffad6c76 labels: - al_max - al_max_export_path-MaxSdk/Mediation/Smaato/Editor/Dependencies.xml +- al_max_export_path-MaxSdk/Mediation~HEAD/Smaato/Editor/Dependencies.xml TextScriptImporter: externalObjects: {} userData: diff --git a/Mediation/UnityAds.meta b/Mediation/UnityAds.meta index 1232f22..1a52c06 100644 --- a/Mediation/UnityAds.meta +++ b/Mediation/UnityAds.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 525c0162ec7244372a8704eb492d9f0d +guid: 1fc688f4b8aa64db7bdeedb2c2060f8f labels: - al_max - al_max_export_path-MaxSdk/Mediation/UnityAds +- al_max_export_path-MaxSdk/Mediation~HEAD/UnityAds folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/UnityAds/Editor.meta b/Mediation/UnityAds/Editor.meta index ddb0128..6adf2a9 100644 --- a/Mediation/UnityAds/Editor.meta +++ b/Mediation/UnityAds/Editor.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 1b3f594e1b5ca4ae79e0071e013628b5 +guid: c3db447ec84cc42cb95c7000d150daef labels: - al_max - al_max_export_path-MaxSdk/Mediation/UnityAds/Editor +- al_max_export_path-MaxSdk/Mediation~HEAD/UnityAds/Editor folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/UnityAds/Editor/Dependencies.xml b/Mediation/UnityAds/Editor/Dependencies.xml index 2307475..80bd63e 100644 --- a/Mediation/UnityAds/Editor/Dependencies.xml +++ b/Mediation/UnityAds/Editor/Dependencies.xml @@ -1,9 +1,9 @@ - + - + diff --git a/Mediation/UnityAds/Editor/Dependencies.xml.meta b/Mediation/UnityAds/Editor/Dependencies.xml.meta index 1d3f503..ce31817 100644 --- a/Mediation/UnityAds/Editor/Dependencies.xml.meta +++ b/Mediation/UnityAds/Editor/Dependencies.xml.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 75d07a832b65343819cfc8a20c396c9a +guid: 8021d46f138554dfba6a6058fd37c634 labels: - al_max - al_max_export_path-MaxSdk/Mediation/UnityAds/Editor/Dependencies.xml +- al_max_export_path-MaxSdk/Mediation~HEAD/UnityAds/Editor/Dependencies.xml TextScriptImporter: externalObjects: {} userData: diff --git a/Mediation/Verve.meta b/Mediation/Verve.meta index bdb8631..3270bd2 100644 --- a/Mediation/Verve.meta +++ b/Mediation/Verve.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: bc61dbb6bba8940b597a8452dc6c556c +guid: 89598f675be104b839df7dae952b604a labels: - al_max - al_max_export_path-MaxSdk/Mediation/Verve +- al_max_export_path-MaxSdk/Mediation~HEAD/Verve folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/Verve/Editor.meta b/Mediation/Verve/Editor.meta index 4a4e87e..b16781a 100644 --- a/Mediation/Verve/Editor.meta +++ b/Mediation/Verve/Editor.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: a141b3a8042714fefb4174419ec3ac7d +guid: 0e49c9d97ef9d4150a0335ec0c80bc3d labels: - al_max - al_max_export_path-MaxSdk/Mediation/Verve/Editor +- al_max_export_path-MaxSdk/Mediation~HEAD/Verve/Editor folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/Verve/Editor/Dependencies.xml b/Mediation/Verve/Editor/Dependencies.xml index bd63e62..af063bc 100644 --- a/Mediation/Verve/Editor/Dependencies.xml +++ b/Mediation/Verve/Editor/Dependencies.xml @@ -1,12 +1,12 @@ - + https://verve.jfrog.io/artifactory/verve-gradle-release - + diff --git a/Mediation/Verve/Editor/Dependencies.xml.meta b/Mediation/Verve/Editor/Dependencies.xml.meta index efe782f..8eb9b81 100644 --- a/Mediation/Verve/Editor/Dependencies.xml.meta +++ b/Mediation/Verve/Editor/Dependencies.xml.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 8d2df032f9cc949f39137a9fd862e50d +guid: 0df9b5eb99971475da0ce8e0deeb9ce4 labels: - al_max - al_max_export_path-MaxSdk/Mediation/Verve/Editor/Dependencies.xml +- al_max_export_path-MaxSdk/Mediation~HEAD/Verve/Editor/Dependencies.xml TextScriptImporter: externalObjects: {} userData: diff --git a/Mediation/Vungle.meta b/Mediation/Vungle.meta index 3132bbb..a278d1c 100644 --- a/Mediation/Vungle.meta +++ b/Mediation/Vungle.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 8526f823ec3ed46629c70d981bd740c2 +guid: 42c233349e3b2436185ff3675e888d03 labels: - al_max - al_max_export_path-MaxSdk/Mediation/Vungle +- al_max_export_path-MaxSdk/Mediation~HEAD/Vungle folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/Vungle/Editor.meta b/Mediation/Vungle/Editor.meta index 49b1f35..be41da9 100644 --- a/Mediation/Vungle/Editor.meta +++ b/Mediation/Vungle/Editor.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 871241ce4cd6b4f12bcf910851ea900a +guid: 1f6e04ca16cdf4e28ba652b7dad6839c labels: - al_max - al_max_export_path-MaxSdk/Mediation/Vungle/Editor +- al_max_export_path-MaxSdk/Mediation~HEAD/Vungle/Editor folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/Vungle/Editor/Dependencies.xml b/Mediation/Vungle/Editor/Dependencies.xml index 6cf8c87..1823def 100644 --- a/Mediation/Vungle/Editor/Dependencies.xml +++ b/Mediation/Vungle/Editor/Dependencies.xml @@ -1,9 +1,9 @@ - + - + diff --git a/Mediation/Vungle/Editor/Dependencies.xml.meta b/Mediation/Vungle/Editor/Dependencies.xml.meta index a320489..cd9b365 100644 --- a/Mediation/Vungle/Editor/Dependencies.xml.meta +++ b/Mediation/Vungle/Editor/Dependencies.xml.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: f7c80d40bbfa64c91acbde53d1725d85 +guid: 8e0af49c27e0945729c4b8e9ed56a4a5 labels: - al_max - al_max_export_path-MaxSdk/Mediation/Vungle/Editor/Dependencies.xml +- al_max_export_path-MaxSdk/Mediation~HEAD/Vungle/Editor/Dependencies.xml TextScriptImporter: externalObjects: {} userData: diff --git a/Mediation/Yandex.meta b/Mediation/Yandex.meta index d2e675b..04a9c54 100644 --- a/Mediation/Yandex.meta +++ b/Mediation/Yandex.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 37406383ebad04e3894254d6259d8b47 +guid: 5cacd558d9a7740979f9a443f45c507b labels: - al_max - al_max_export_path-MaxSdk/Mediation/Yandex +- al_max_export_path-MaxSdk/Mediation~HEAD/Yandex folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/Yandex/Editor.meta b/Mediation/Yandex/Editor.meta index 2fa244c..6c75ca4 100644 --- a/Mediation/Yandex/Editor.meta +++ b/Mediation/Yandex/Editor.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: da5c76032402241c2a0e09285c2efeaf +guid: a13c4ded03b88486cb4b7f7f6cbe0df3 labels: - al_max - al_max_export_path-MaxSdk/Mediation/Yandex/Editor +- al_max_export_path-MaxSdk/Mediation~HEAD/Yandex/Editor folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/Yandex/Editor/Dependencies.xml b/Mediation/Yandex/Editor/Dependencies.xml index ac5cd5a..10c0495 100644 --- a/Mediation/Yandex/Editor/Dependencies.xml +++ b/Mediation/Yandex/Editor/Dependencies.xml @@ -1,9 +1,9 @@ - + - + diff --git a/Mediation/Yandex/Editor/Dependencies.xml.meta b/Mediation/Yandex/Editor/Dependencies.xml.meta index 643f1d2..d760078 100644 --- a/Mediation/Yandex/Editor/Dependencies.xml.meta +++ b/Mediation/Yandex/Editor/Dependencies.xml.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 47944d4ffaaab4067a1d8ce5cab191dc +guid: 56b6854b39dd74540b2b2464583a616a labels: - al_max - al_max_export_path-MaxSdk/Mediation/Yandex/Editor/Dependencies.xml +- al_max_export_path-MaxSdk/Mediation~HEAD/Yandex/Editor/Dependencies.xml TextScriptImporter: externalObjects: {} userData: diff --git a/Moloco/Editor/ALMolocoAdapterDependencies.xml b/Moloco/Editor/ALMolocoAdapterDependencies.xml deleted file mode 100644 index 0b24e7a..0000000 --- a/Moloco/Editor/ALMolocoAdapterDependencies.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/Moloco/Moloco.asmdef b/Moloco/Moloco.asmdef deleted file mode 100644 index eedfdb1..0000000 --- a/Moloco/Moloco.asmdef +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "Moloco" -} diff --git a/Moloco/Moloco.asmdef.meta b/Moloco/Moloco.asmdef.meta deleted file mode 100644 index 814b033..0000000 --- a/Moloco/Moloco.asmdef.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: d5456fec572384e828c8ac8565043709 -timeCreated: 1700133547 \ No newline at end of file diff --git a/Moloco/Scripts/Editor/Moloco.Editor.asmdef b/Moloco/Scripts/Editor/Moloco.Editor.asmdef deleted file mode 100644 index fe350b8..0000000 --- a/Moloco/Scripts/Editor/Moloco.Editor.asmdef +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "Moloco.Editor", - "includePlatforms": [ - "Editor" - ] -} \ No newline at end of file diff --git a/Moloco/Scripts/Editor/Moloco.Editor.asmdef.meta b/Moloco/Scripts/Editor/Moloco.Editor.asmdef.meta deleted file mode 100644 index 0577ca1..0000000 --- a/Moloco/Scripts/Editor/Moloco.Editor.asmdef.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 8e16e974e6af41fab383d3dcd2d5866e -timeCreated: 1701005033 \ No newline at end of file diff --git a/Moloco/Scripts/Editor/MolocoPostProcessBuildiOS.cs.meta b/Moloco/Scripts/Editor/MolocoPostProcessBuildiOS.cs.meta deleted file mode 100644 index d03fe4c..0000000 --- a/Moloco/Scripts/Editor/MolocoPostProcessBuildiOS.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: c652888c174cc466f992f1fc1a713fb7 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Moloco/Scripts/Editor/PodfileEditor.cs b/Moloco/Scripts/Editor/PodfileEditor.cs deleted file mode 100644 index f58585a..0000000 --- a/Moloco/Scripts/Editor/PodfileEditor.cs +++ /dev/null @@ -1,63 +0,0 @@ -#if UNITY_IOS || UNITY_IPHONE - -using System.IO; -using System.Linq; -using UnityEditor; -using UnityEditor.Callbacks; -using UnityEngine; - -namespace Moloco.Scripts.Editor -{ - public class PodfileEditor - { - // [PostProcessBuild(45)] // Add to the Podfile after it's generated (40) but before "pod install" (50) - public static void OnPostProcessBuild(BuildTarget buildTarget, string pathToBuiltProject) - { - if (buildTarget != BuildTarget.iOS) - { - return; - } - - string podfilePath = Path.Combine(pathToBuiltProject, "Podfile"); - - if (File.Exists(podfilePath)) - { - var codeSigningStyle = PlayerSettings.iOS.appleEnableAutomaticSigning ? "Automatic" : "Manual"; - var teamId = PlayerSettings.iOS.appleDeveloperTeamID; - var provisioningProfileId = PlayerSettings.iOS.iOSManualProvisioningProfileID; - var provisioningProfileType = PlayerSettings.iOS.iOSManualProvisioningProfileType; - - string[] molocoTargets = - { - "MolocoSDKiOS-MolocoSDK", - "MolocoCustomAdapter-MolocoCustomAdapter", - "MolocoCustomAdapterAppLovin-MolocoCustomAdapterAppLovin", - "MolocoCustomAdapterIronSource-MolocoCustomAdapterIronSource" - }; - var molocoTargetsString = string.Join(", ", molocoTargets.Select(element => $"'{element}'")); - - using var sw = File.AppendText(podfilePath); - sw.WriteLine("\n\n\npost_install do |installer|"); - sw.WriteLine(" installer.pods_project.targets.each do |target|"); - sw.WriteLine(" target.build_configurations.each do |config|"); - sw.WriteLine(" if [" + molocoTargetsString + "].include? target.name"); - sw.WriteLine(" config.build_settings['CODE_SIGN_STYLE'] = '" + codeSigningStyle + "'"); - sw.WriteLine(" config.build_settings['DEVELOPMENT_TEAM'] = '" + teamId + "'"); - if (!PlayerSettings.iOS.appleEnableAutomaticSigning) - { - sw.WriteLine(" config.build_settings['PROVISIONING_PROFILE_APP'] = '" + provisioningProfileId + "\'"); - } - sw.WriteLine(" end"); - sw.WriteLine(" end"); - sw.WriteLine(" end"); - sw.WriteLine("end"); - } - else - { - Debug.LogWarning("Podfile not found in the Xcode project."); - } - } - } -} - -#endif \ No newline at end of file diff --git a/Moloco/Scripts/Editor/PodfileEditor.cs.meta b/Moloco/Scripts/Editor/PodfileEditor.cs.meta deleted file mode 100644 index cc339f4..0000000 --- a/Moloco/Scripts/Editor/PodfileEditor.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 930ff57270fca425885f84404dbfaafc -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/OpenWrapSDK/Editor/OpenWrapSDKDependencies.xml b/OpenWrapSDK/Editor/OpenWrapSDKDependencies.xml index bdbc57e..6df94d9 100644 --- a/OpenWrapSDK/Editor/OpenWrapSDKDependencies.xml +++ b/OpenWrapSDK/Editor/OpenWrapSDKDependencies.xml @@ -1,19 +1,20 @@ - + - + + https://github.com/CocoaPods/Specs - - - - https://repo.pubmatic.com/artifactory/public-repos - - - - + + + + + https://repo.pubmatic.com/artifactory/public-repos + + + diff --git a/OpenWrapSDK/Platform/Android/Models/POBDataProviderClient.cs b/OpenWrapSDK/Platform/Android/Models/POBDataProviderClient.cs index 2baa717..33fa93e 100644 --- a/OpenWrapSDK/Platform/Android/Models/POBDataProviderClient.cs +++ b/OpenWrapSDK/Platform/Android/Models/POBDataProviderClient.cs @@ -116,7 +116,7 @@ namespace OpenWrapSDK.Android if (dataProvider != null && segment != null) { POBLog.Info(Tag, POBLogStrings.ClientRemoveSegmentLog); - dataProvider.Call("removeSegment", segment.Identifier); + dataProvider.Call("removeSegment", segment.Identifier); } else { diff --git a/OpenWrapSDK/Platform/Android/Models/POBRequestClient.cs b/OpenWrapSDK/Platform/Android/Models/POBRequestClient.cs index 00d7d6d..dc30e48 100644 --- a/OpenWrapSDK/Platform/Android/Models/POBRequestClient.cs +++ b/OpenWrapSDK/Platform/Android/Models/POBRequestClient.cs @@ -134,7 +134,9 @@ namespace OpenWrapSDK.Android { if (RequestObject != null) { - return RequestObject.Call("getVersionId"); + AndroidJavaObject versionIdObj = RequestObject.Call("getVersionId"); + return versionIdObj.Call("intValue"); + } return 0; } @@ -210,7 +212,8 @@ namespace OpenWrapSDK.Android { if (RequestObject != null) { - RequestObject.Call("setVersionId", versionId); + AndroidJavaObject versionIdObj = new AndroidJavaObject(POBConstants.IntegerClassName,versionId); + RequestObject.Call("setVersionId", versionIdObj); } } } diff --git a/OpenWrapSDK/Platform/Android/Models/POBUserInfoClient.cs b/OpenWrapSDK/Platform/Android/Models/POBUserInfoClient.cs index f3468e8..c4a2d76 100644 --- a/OpenWrapSDK/Platform/Android/Models/POBUserInfoClient.cs +++ b/OpenWrapSDK/Platform/Android/Models/POBUserInfoClient.cs @@ -87,20 +87,6 @@ namespace OpenWrapSDK.Android } } - /// - /// Country code using ISO-3166-1-alpha-3. - /// - public string Country - { - set - { - if (userInfo != null) - { - userInfo.Call("setCountry", value); - } - } - } - /// /// City of user /// diff --git a/OpenWrapSDK/Platform/Android/OpenWrapSDKClient.cs b/OpenWrapSDK/Platform/Android/OpenWrapSDKClient.cs index 54d4e75..6e31703 100644 --- a/OpenWrapSDK/Platform/Android/OpenWrapSDKClient.cs +++ b/OpenWrapSDK/Platform/Android/OpenWrapSDKClient.cs @@ -75,22 +75,6 @@ namespace OpenWrapSDK.Android OpenWrapSDKClass.CallStatic("allowLocationAccess", allow); } - /// - /// Set the CCPA compliant string, it helps publisher toward compliance with the California Consumer Privacy Act (CCPA). - /// For more details refer https://www.iab.com/guidelines/ccpa-framework/ - /// Make sure that the string value you use is compliant with the IAB Specification, refer - /// https://iabtechlab.com/wp-content/uploads/2019/11/U.S.-Privacy-String-v1.0-IAB-Tech-Lab.pdf - ///

- /// If this is not set, SDK looks for app's default SharedPreference with key 'IABUSPrivacy_String' - /// If CCPA is applied through both options, the SDK will honour only API property. - /// If both are not set then CCPA parameter is omitted from an ad request. - ///

- /// is the CCPA compliant string - public static void SetCCPA(string ccpaString) - { - OpenWrapSDKClass.CallStatic("setCCPA", ccpaString); - } - /// /// Indicates whether the visitor is COPPA-specific or not. /// For COPPA(Children's Online Privacy Protection Act) compliance, if the visitor's age is @@ -105,34 +89,6 @@ namespace OpenWrapSDK.Android OpenWrapSDKClass.CallStatic("setCoppa", enable); } - /// - /// Sets GDPR consent string, A valid Base64 encoded consent string as per - /// https://github.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework. - /// The user consent string is optional, but highly recommended if the request is subject to GDPR - /// regulations(i.e.gdpr = true). The default sense of consent under GDPR is "opt-out" and - /// as such, an omitted consent string in a request subject to GDPR would be interpreted as - /// equivalent to the user fully opting out of all defined purposes for data use by all parties. - /// - /// consent string to convey user consent when GDPR regulations are in effect. - public static void SetGDPRConsent(string gdprConsent) - { - OpenWrapSDKClass.CallStatic("setGDPRConsent", gdprConsent); - } - - /// - /// Sets GDPR compliance, it indicates whether or not the ad request is GDPR(General Data Protection Regulation) compliant. - /// - /// - /// boolean value - /// - true : indicates GDPR compliant requests - /// - false : indicates that the request is not GDPR compliant - /// By default, this parameter is omitted in the ad request, indicating Unknown. - /// - public static void SetGDPREnabled(bool enable) - { - OpenWrapSDKClass.CallStatic("setGDPREnabled", enable); - } - /// /// Sets user's location and its source. It is useful in delivering geographically relevant ads. ///

diff --git a/OpenWrapSDK/Platform/Android/POBConstants.cs b/OpenWrapSDK/Platform/Android/POBConstants.cs index 489c3e1..e9f3eba 100644 --- a/OpenWrapSDK/Platform/Android/POBConstants.cs +++ b/OpenWrapSDK/Platform/Android/POBConstants.cs @@ -43,6 +43,8 @@ namespace OpenWrapSDK.Android internal readonly static string POBRewardedAdCallbackInterfaceName = "com.pubmatic.unity.openwrapsdk.POBUnityRewardedAdListener"; internal readonly static string POBExternalUserIdClassName = "com.pubmatic.sdk.common.models.POBExternalUserId"; internal readonly static string POBDataProviderClassName = "com.pubmatic.sdk.common.models.POBDataProvider"; + internal readonly static string IntegerClassName = "java.lang.Integer"; + } } #endif diff --git a/OpenWrapSDK/Platform/Common/Interfaces/IPOBUserInfoClient.cs b/OpenWrapSDK/Platform/Common/Interfaces/IPOBUserInfoClient.cs index b840771..ea10f98 100644 --- a/OpenWrapSDK/Platform/Common/Interfaces/IPOBUserInfoClient.cs +++ b/OpenWrapSDK/Platform/Common/Interfaces/IPOBUserInfoClient.cs @@ -45,11 +45,6 @@ namespace OpenWrapSDK.Common ///

POBGender Gender { set; } - /// - /// Country code using ISO-3166-1-alpha-3. - /// - string Country { set; } - /// /// City of user /// diff --git a/OpenWrapSDK/Platform/iOS/Models/POBUserInfoClient.cs b/OpenWrapSDK/Platform/iOS/Models/POBUserInfoClient.cs index 1175d17..f21e558 100644 --- a/OpenWrapSDK/Platform/iOS/Models/POBUserInfoClient.cs +++ b/OpenWrapSDK/Platform/iOS/Models/POBUserInfoClient.cs @@ -56,9 +56,6 @@ namespace OpenWrapSDK.iOS [DllImport("__Internal")] internal static extern void POBUSetUserInfoRegion(IntPtr userInfo, string region); - [DllImport("__Internal")] - internal static extern void POBUSetUserInfoCountry(IntPtr userInfo, string country); - [DllImport("__Internal")] internal static extern void POBUSetUserInfoKeywords(IntPtr userInfo, string keywords); @@ -127,20 +124,6 @@ namespace OpenWrapSDK.iOS } } - /// - /// Country code using ISO-3166-1-alpha-3. - /// - public string Country - { - set - { - if (userInfoPtr != IntPtr.Zero) - { - POBUSetUserInfoCountry(userInfoPtr, value); - } - } - } - /// /// City of user /// diff --git a/OpenWrapSDK/Platform/iOS/OpenWrapSDKClient.cs b/OpenWrapSDK/Platform/iOS/OpenWrapSDKClient.cs index 0835ad3..8cd465b 100644 --- a/OpenWrapSDK/Platform/iOS/OpenWrapSDKClient.cs +++ b/OpenWrapSDK/Platform/iOS/OpenWrapSDKClient.cs @@ -50,12 +50,6 @@ namespace OpenWrapSDK.iOS [DllImport("__Internal")] internal static extern void POBUSetLogLevel(int logLevel); - [DllImport("__Internal")] - internal static extern void POBUSetGDPREnabled(bool enable); - - [DllImport("__Internal")] - internal static extern void POBUSetGDPRConsent(string gdprConsent); - [DllImport("__Internal")] internal static extern void POBUAllowLocationAccess(bool enable); @@ -77,9 +71,6 @@ namespace OpenWrapSDK.iOS [DllImport("__Internal")] internal static extern void POBUAllowAVAudioSessionAccess(bool allow); - [DllImport("__Internal")] - internal static extern void POBUSetCCPA(string ccpaString); - [DllImport("__Internal")] internal static extern void POBUSetApplicationInfo(ref POBApplicationInfoInternal appInfoInternal); @@ -123,26 +114,11 @@ namespace OpenWrapSDK.iOS POBUAllowLocationAccess(allow); } - public static void SetCCPA(string ccpaString) - { - POBUSetCCPA(ccpaString); - } - public static void SetCOPPAEnabled(bool enable) { POBUSetCOPPAEnabled(enable); } - public static void SetGDPRConsent(string gdprConsent) - { - POBUSetGDPRConsent(gdprConsent); - } - - public static void SetGDPREnabled(bool enable) - { - POBUSetGDPREnabled(enable); - } - public static void SetLocation(double longitude, double latitude, POBLocSource source) { POBUSetLocation(longitude, latitude, ((int)source)); diff --git a/OpenWrapSDK/Plugins/OpenWrapSDK/iOS/POBUInterface.m b/OpenWrapSDK/Plugins/OpenWrapSDK/iOS/POBUInterface.m index d1b5b4b..ca918b3 100644 --- a/OpenWrapSDK/Plugins/OpenWrapSDK/iOS/POBUInterface.m +++ b/OpenWrapSDK/Plugins/OpenWrapSDK/iOS/POBUInterface.m @@ -38,16 +38,6 @@ void POBUSetLogLevel(NSInteger logLevel) { } } -// Set GDPR enabled -void POBUSetGDPREnabled(BOOL enable) { - [OpenWrapSDK setGDPREnabled:enable]; -} - -// Set GDPR consent -void POBUSetGDPRConsent(const char* gdprConsent) { - [OpenWrapSDK setGDPRConsent:[POBUUtil POBUNSStringFromCharsArray:gdprConsent]]; -} - // Set allow location access void POBUAllowLocationAccess(BOOL enable) { [OpenWrapSDK allowLocationAccess:enable]; @@ -86,11 +76,6 @@ void POBUAllowAVAudioSessionAccess(BOOL allow) { [OpenWrapSDK allowAVAudioSessionAccess:allow]; } -// Set CCPA -void POBUSetCCPA(const char *ccpaString) { - [OpenWrapSDK setCCPA:[POBUUtil POBUNSStringFromCharsArray:ccpaString]]; -} - // Set POBApplicationInfo void POBUSetApplicationInfo(POBApplicationInfoInternal *appInfoInternal) { POBApplicationInfo *applicationInfo = [[POBApplicationInfo alloc] init]; diff --git a/OpenWrapSDK/Plugins/OpenWrapSDK/iOS/POBUModelsInterface.m b/OpenWrapSDK/Plugins/OpenWrapSDK/iOS/POBUModelsInterface.m index fee9e54..66b45bd 100644 --- a/OpenWrapSDK/Plugins/OpenWrapSDK/iOS/POBUModelsInterface.m +++ b/OpenWrapSDK/Plugins/OpenWrapSDK/iOS/POBUModelsInterface.m @@ -57,11 +57,6 @@ void POBUSetUserInfoRegion(POBUUserInfoRef userInfo, const char *region) { internalUserInfo.region = [POBUUtil POBUNSStringFromCharsArray:region]; } -void POBUSetUserInfoCountry(POBUUserInfoRef userInfo, const char *country) { - POBUserInfo *internalUserInfo = (__bridge POBUserInfo *)userInfo; - internalUserInfo.country = [POBUUtil POBUNSStringFromCharsArray:country]; -} - void POBUSetUserInfoKeywords(POBUUserInfoRef userInfo, const char *keywords) { POBUserInfo *internalUserInfo = (__bridge POBUserInfo *)userInfo; internalUserInfo.keywords = [POBUUtil POBUNSStringFromCharsArray:keywords]; @@ -178,7 +173,7 @@ void POBUBidSetHasWon(POBUTypeBidRef bid, bool hasWon) { // Get the PubMatic partner id const char* POBUBidGetPubMaticPartnerId(POBUTypeBidRef bid) { POBBid *internalBid = (__bridge POBBid *)bid; - return [POBUUtil POBUCharArrayFromNSString:internalBid.pubmaticPartnerId]; + return [POBUUtil POBUCharArrayFromNSString:internalBid.partner]; } /// Get targeting information diff --git a/OpenWrapSDK/Public/Models/POBUserInfo.cs b/OpenWrapSDK/Public/Models/POBUserInfo.cs index b9850d9..f1d396c 100644 --- a/OpenWrapSDK/Public/Models/POBUserInfo.cs +++ b/OpenWrapSDK/Public/Models/POBUserInfo.cs @@ -38,7 +38,6 @@ namespace OpenWrapSDK private string zip; private string city; private string region; - private string country; private string keywords; #endregion @@ -130,23 +129,6 @@ namespace OpenWrapSDK } } - /// - /// Country code using ISO-3166-1-alpha-3. - /// - public string Country - { - get => country; - - set - { - country = value; - if (client != null) - { - client.Country = value; - } - } - } - /// /// City of user /// diff --git a/OpenWrapSDK/Public/POBOpenWrapSDK.cs b/OpenWrapSDK/Public/POBOpenWrapSDK.cs index 6c2924c..997819a 100644 --- a/OpenWrapSDK/Public/POBOpenWrapSDK.cs +++ b/OpenWrapSDK/Public/POBOpenWrapSDK.cs @@ -31,7 +31,7 @@ namespace OpenWrapSDK private static List externalUserIds = new List(); // OpenWrap SDK plugin version. Please make sure to update it with every release. - private static readonly string OpenWrapSDKPluginVersion = "3.0.0"; + private static readonly string OpenWrapSDKPluginVersion = "3.1.0"; private static readonly string Tag = "POBOpenWrapSDK"; @@ -70,34 +70,6 @@ namespace OpenWrapSDK #endif } - /// - /// Sets GDPR compliance, it indicates whether or not the ad request is GDPR(General Data Protection Regulation) compliant. - /// - true : indicates GDPR compliant requests - ///
- false : indicates that the request is not GDPR compliant
- ///
- /// bool value - public static void SetGDPREnabled(bool enable) - { -#if UNITY_IOS - iOS.OpenWrapSDKClient.SetGDPREnabled(enable); -#else - Android.OpenWrapSDKClient.SetGDPREnabled(enable); -#endif - } - - /// - /// Sets GDPR consent string, A valid Base64 encoded consent string as per - /// - /// - public static void SetGDPRConsent(string gdprConsent) - { -#if UNITY_IOS - iOS.OpenWrapSDKClient.SetGDPRConsent(gdprConsent); -#else - Android.OpenWrapSDKClient.SetGDPRConsent(gdprConsent); -#endif - } - /// /// Used to enable/disable location access. ///
This value decides whether the OpenWrap SDK should access device location usings Core Location APIs to serve location-based ads. When set to NO, the SDK will not attempt to access device location. When set to YES, the SDK will periodically try to fetch location efficiently. @@ -202,24 +174,6 @@ namespace OpenWrapSDK } #endif - /// - /// Set the CCPA compliant string, it helps publisher toward compliance with the California Consumer Privacy Act (CCPA). - ///
For more details refer https://www.iab.com/guidelines/ccpa-framework/ - ///
Make sure that the string value you use is compliant with the IAB Specification, refer https://iabtechlab.com/wp-content/uploads/2019/11/U.S.-Privacy-String-v1.0-IAB-Tech-Lab.pdf - ///
If this is not set, SDK looks for app's NSUserDefault with key 'IABUSPrivacy_String' - ///
If CCPA is applied through both options, the SDK will honour only API property. - ///
If both are not set then CCPA parameter is omitted from an ad request. - ///
- /// The CCPA compliant string - public static void SetCCPA(string ccpaString) - { -#if UNITY_IOS - iOS.OpenWrapSDKClient.SetCCPA(ccpaString); -#else - Android.OpenWrapSDKClient.SetCCPA(ccpaString); -#endif - } - /// /// Sets Application information, which contains various attributes about app, such as ///
application category, store URL, domain, etc for more relevant ads. diff --git a/Moloco.meta b/TradPlus.meta similarity index 77% rename from Moloco.meta rename to TradPlus.meta index 9671811..e349572 100644 --- a/Moloco.meta +++ b/TradPlus.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: e1f46a63334734c8481955bddc4b6d1c +guid: 847129090316e467da07d301d7fe2d6a folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Moloco/Scripts/Editor.meta b/TradPlus/Editor.meta similarity index 77% rename from Moloco/Scripts/Editor.meta rename to TradPlus/Editor.meta index f011e99..6c84103 100644 --- a/Moloco/Scripts/Editor.meta +++ b/TradPlus/Editor.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 63ffaa4af1ddc4c28b3939f81c9ebf26 +guid: 69cd91ede3fae4b81ad4140db9a8cca5 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/TradPlus/Editor/TradPlusDependencies.xml b/TradPlus/Editor/TradPlusDependencies.xml new file mode 100644 index 0000000..832c8a3 --- /dev/null +++ b/TradPlus/Editor/TradPlusDependencies.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TradPlus/Editor/TradPlusDependencies.xml.meta b/TradPlus/Editor/TradPlusDependencies.xml.meta new file mode 100644 index 0000000..32f20b7 --- /dev/null +++ b/TradPlus/Editor/TradPlusDependencies.xml.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1405ccdb3982d419293e71b7e1a12c4e +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TradPlus/Editor/TradPlusProguards.txt b/TradPlus/Editor/TradPlusProguards.txt new file mode 100644 index 0000000..088a00a --- /dev/null +++ b/TradPlus/Editor/TradPlusProguards.txt @@ -0,0 +1,3 @@ +-keep public class com.tradplus.** { *; } +-keep class com.tradplus.ads.** { *; } +-keep class com.applovin.mediation.adapters.** { *; } \ No newline at end of file diff --git a/TradPlus/Editor/TradPlusProguards.txt.meta b/TradPlus/Editor/TradPlusProguards.txt.meta new file mode 100644 index 0000000..04717a6 --- /dev/null +++ b/TradPlus/Editor/TradPlusProguards.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8513cd65de204676993b21103ed7f456 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Moloco/Scripts.meta b/TradPlus/Plugins.meta similarity index 77% rename from Moloco/Scripts.meta rename to TradPlus/Plugins.meta index f615a18..33f4212 100644 --- a/Moloco/Scripts.meta +++ b/TradPlus/Plugins.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: f5455d04fd4f045d1a9312ce39a5902a +guid: 41d3732c46b754419835a90e185809c4 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Moloco/Editor.meta b/TradPlus/Plugins/Android.meta similarity index 77% rename from Moloco/Editor.meta rename to TradPlus/Plugins/Android.meta index 3106fe6..157a237 100644 --- a/Moloco/Editor.meta +++ b/TradPlus/Plugins/Android.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 610d1cb8415d649f8ae9c669633471f6 +guid: d03bc529bb55c463cb001cf6806b9df4 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/TradPlus/Plugins/Android/customsdk_ads_1.0.1.aar b/TradPlus/Plugins/Android/customsdk_ads_1.0.1.aar new file mode 100755 index 0000000..b97ea3e Binary files /dev/null and b/TradPlus/Plugins/Android/customsdk_ads_1.0.1.aar differ diff --git a/TradPlus/Plugins/Android/customsdk_ads_1.0.1.aar.meta b/TradPlus/Plugins/Android/customsdk_ads_1.0.1.aar.meta new file mode 100644 index 0000000..66aea15 --- /dev/null +++ b/TradPlus/Plugins/Android/customsdk_ads_1.0.1.aar.meta @@ -0,0 +1,32 @@ +fileFormatVersion: 2 +guid: b5f5cda033cb644c58010d2c6a2ab7c7 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Android: Android + second: + enabled: 1 + settings: {} + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/TradPlus/Plugins/iOS.meta b/TradPlus/Plugins/iOS.meta new file mode 100644 index 0000000..3e48be0 --- /dev/null +++ b/TradPlus/Plugins/iOS.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b51eede93c8924b12b0f4db8599021ba +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TradPlus/Plugins/iOS/ALMCMediationAdapter.framework.meta b/TradPlus/Plugins/iOS/ALMCMediationAdapter.framework.meta new file mode 100644 index 0000000..33f6586 --- /dev/null +++ b/TradPlus/Plugins/iOS/ALMCMediationAdapter.framework.meta @@ -0,0 +1,80 @@ +fileFormatVersion: 2 +guid: a58c90f860c614882b4f598ca8d59999 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 0 + - first: + Android: Android + second: + enabled: 0 + settings: + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + iPhone: iOS + second: + enabled: 1 + settings: + AddToEmbeddedBinaries: false + CPU: AnyCPU + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/TradPlus/Plugins/iOS/ALMCMediationAdapter.framework/ALMCMediationAdapter b/TradPlus/Plugins/iOS/ALMCMediationAdapter.framework/ALMCMediationAdapter new file mode 100644 index 0000000..d4429b8 Binary files /dev/null and b/TradPlus/Plugins/iOS/ALMCMediationAdapter.framework/ALMCMediationAdapter differ diff --git a/TradPlus/Plugins/iOS/ALMCMediationAdapter.framework/ALMCMediationAdapter.meta b/TradPlus/Plugins/iOS/ALMCMediationAdapter.framework/ALMCMediationAdapter.meta new file mode 100644 index 0000000..c8f8c38 --- /dev/null +++ b/TradPlus/Plugins/iOS/ALMCMediationAdapter.framework/ALMCMediationAdapter.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1405ccdb3982d419293e71b7e1a12c00 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TradPlus/Plugins/iOS/ALMCMediationAdapter.framework/Headers.meta b/TradPlus/Plugins/iOS/ALMCMediationAdapter.framework/Headers.meta new file mode 100644 index 0000000..8f9fbb1 --- /dev/null +++ b/TradPlus/Plugins/iOS/ALMCMediationAdapter.framework/Headers.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b51eede93c8924b12b0f4db859902101 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TradPlus/Plugins/iOS/ALMCMediationAdapter.framework/Headers/ALMCMediationAdapter.h b/TradPlus/Plugins/iOS/ALMCMediationAdapter.framework/Headers/ALMCMediationAdapter.h new file mode 100644 index 0000000..947b01d --- /dev/null +++ b/TradPlus/Plugins/iOS/ALMCMediationAdapter.framework/Headers/ALMCMediationAdapter.h @@ -0,0 +1,12 @@ + + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface ALMCMediationAdapter : ALMediationAdapter + +@end + +NS_ASSUME_NONNULL_END diff --git a/TradPlus/Plugins/iOS/ALMCMediationAdapter.framework/Headers/ALMCMediationAdapter.h.meta b/TradPlus/Plugins/iOS/ALMCMediationAdapter.framework/Headers/ALMCMediationAdapter.h.meta new file mode 100644 index 0000000..be5a493 --- /dev/null +++ b/TradPlus/Plugins/iOS/ALMCMediationAdapter.framework/Headers/ALMCMediationAdapter.h.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1405ccdb3982d419293e71b7e1a11c00 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TradPlus/Plugins/iOS/ALMCMediationAdapter.framework/Info.plist b/TradPlus/Plugins/iOS/ALMCMediationAdapter.framework/Info.plist new file mode 100644 index 0000000..7289ec9 Binary files /dev/null and b/TradPlus/Plugins/iOS/ALMCMediationAdapter.framework/Info.plist differ diff --git a/TradPlus/Plugins/iOS/ALMCMediationAdapter.framework/Info.plist.meta b/TradPlus/Plugins/iOS/ALMCMediationAdapter.framework/Info.plist.meta new file mode 100644 index 0000000..6e707cf --- /dev/null +++ b/TradPlus/Plugins/iOS/ALMCMediationAdapter.framework/Info.plist.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1405ccdb3982d419293e71b7e1a11c03 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TradPlus/Plugins/iOS/ALMCMediationAdapter.framework/Modules.meta b/TradPlus/Plugins/iOS/ALMCMediationAdapter.framework/Modules.meta new file mode 100644 index 0000000..dde32ca --- /dev/null +++ b/TradPlus/Plugins/iOS/ALMCMediationAdapter.framework/Modules.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b51eede93c8924b12b0f4db859902102 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TradPlus/Plugins/iOS/ALMCMediationAdapter.framework/Modules/module.modulemap b/TradPlus/Plugins/iOS/ALMCMediationAdapter.framework/Modules/module.modulemap new file mode 100644 index 0000000..00e8b3f --- /dev/null +++ b/TradPlus/Plugins/iOS/ALMCMediationAdapter.framework/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module ALMCMediationAdapter { + umbrella header "ALMCMediationAdapter.h" + + export * + module * { export * } +} diff --git a/TradPlus/Plugins/iOS/ALMCMediationAdapter.framework/Modules/module.modulemap.meta b/TradPlus/Plugins/iOS/ALMCMediationAdapter.framework/Modules/module.modulemap.meta new file mode 100644 index 0000000..e8d0885 --- /dev/null +++ b/TradPlus/Plugins/iOS/ALMCMediationAdapter.framework/Modules/module.modulemap.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1405ccdb3982d419293e71b7e1a11c01 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/package.json b/package.json index e8fdc95..c53bfa2 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "com.guru.unity.max", "displayName": "Guru Max", - "version": "1.1.5", - "description": "Guru 整合 AppLovinMax 插件", + "version": "1.2.0", + "description": "Guru 整合 AppLovin Max 插件", "unity": "2020.3", "author": { "name": "Guru Game"