【广告】Admob中介unityads和facebook的SDK

iOS_release
zhangaotian 2024-07-01 15:18:31 +08:00
parent b59504d994
commit 44ed2646a5
33 changed files with 605 additions and 0 deletions

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 65352826fdec54240ae3a3823d497c2c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 225389cc07c074a6abce35c18707f4c4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3c91dfc0387ca4d9f8feaae12e773aff
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,30 @@
<!--
Copyright 2018 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<dependencies>
<androidPackages>
<androidPackage spec="com.google.ads.mediation:facebook:6.17.0.0">
<repositories>
<repository>https://repo.maven.apache.org/maven2/</repository>
<repository>https://dl.google.com/dl/android/maven2/</repository>
</repositories>
</androidPackage>
</androidPackages>
<iosPods>
<iosPod name="GoogleMobileAdsMediationFacebook" version="6.15.0.0"/>
</iosPods>
</dependencies>

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 003a66f8ca8eb45498267392d638f4e2
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a7d31de17eeeb444393739d807fbdf0a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: fa7eb7d76bbd540539c97af33232bf2f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,45 @@
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using UnityEngine;
using GoogleMobileAds.Mediation.UnityAds;
using GoogleMobileAds.Mediation.UnityAds.Common;
namespace GoogleMobileAds.Mediation.UnityAds.Api
{
public class UnityAds
{
internal static readonly IUnityAdsClient client =
UnityAdsClientFactory.CreateUnityAdsClient();
public static void SetConsentMetaData(string key, bool metaDataValue)
{
client.SetConsentMetaData(key, metaDataValue);
}
}
}
namespace GoogleMobileAds.Api.Mediation.UnityAds
{
[System.Obsolete("Use `GoogleMobileAds.Mediation.UnityAds.Api.UnityAds` instead.")]
public class UnityAds
{
public static void SetConsentMetaData(string key, bool metaDataValue)
{
GoogleMobileAds.Mediation.UnityAds.Api.UnityAds.SetConsentMetaData(key, metaDataValue);
}
}
}

View File

@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: c4507aa403d4b46e581efaffd089125b
timeCreated: 1526597658
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 46de7dd7a88394a9d91723791341509e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,34 @@
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using System;
using System.Reflection;
using UnityEngine;
namespace GoogleMobileAds.Mediation.UnityAds.Common
{
public class DummyClient : IUnityAdsClient
{
public DummyClient ()
{
Debug.Log ("Dummy " + MethodBase.GetCurrentMethod ().Name);
}
public void SetConsentMetaData(string key, bool metaDataValue)
{
Debug.Log ("Dummy " + MethodBase.GetCurrentMethod ().Name);
}
}
}

View File

@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: 6a8cdf5ebecd2467eb26aaaa539246c9
timeCreated: 1526597900
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,23 @@
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using System;
namespace GoogleMobileAds.Mediation.UnityAds.Common
{
public interface IUnityAdsClient
{
void SetConsentMetaData(string key, bool metaDataValue);
}
}

View File

@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: 6198fac152078472d9a1e4565b028cd7
timeCreated: 1526597908
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a6ed2fd8b6a88400cb0a84d409e566b1
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,40 @@
<!--
Copyright 2017 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<dependencies>
<androidPackages>
<androidPackage spec="com.google.ads.mediation:unity:4.12.0.0">
<repositories>
<repository>https://repo.maven.apache.org/maven2/</repository>
<repository>https://dl.google.com/dl/android/maven2/</repository>
</repositories>
</androidPackage>
<!-- If using the Unity Ads Service from Unity3D, comment out this dependency to avoid
including the Unity Android SDK twice. -->
<androidPackage spec="com.unity3d.ads:unity-ads:4.12.0">
<repositories>
<repository>https://repo.maven.apache.org/maven2/</repository>
</repositories>
</androidPackage>
</androidPackages>
<iosPods>
<iosPod name="GoogleMobileAdsMediationUnity" version="4.12.0.0"/>
</iosPods>
</dependencies>

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: faff02429033e4718b69e106ace6ca8a
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 60e9c3a7a4cea4a24aa0585acc95bee4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d2307a6125bb246e8b78bf7f81aaeaed
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,61 @@
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#if UNITY_ANDROID
using System.Reflection;
using UnityEngine;
using GoogleMobileAds.Mediation.UnityAds.Common;
namespace GoogleMobileAds.Mediation.UnityAds.Android
{
public class UnityAdsClient : IUnityAdsClient
{
private const string UNITY_PLAYER_CLASS_NAME = "com.unity3d.player.UnityPlayer";
private const string UNITY_ADS_METADATA_CLASS_NAME = "com.unity3d.ads.metadata.MetaData";
private static UnityAdsClient instance = new UnityAdsClient();
private UnityAdsClient() { }
public static UnityAdsClient Instance
{
get
{
return instance;
}
}
public void SetConsentMetaData(string key, bool metaDataValue)
{
AndroidJavaClass unityPlayer = new AndroidJavaClass(UNITY_PLAYER_CLASS_NAME);
AndroidJavaObject currentActivity =
unityPlayer.GetStatic<AndroidJavaObject> ("currentActivity");
AndroidJavaObject unityAdsMetaData =
new AndroidJavaObject(UNITY_ADS_METADATA_CLASS_NAME, currentActivity);
bool success = unityAdsMetaData.Call<bool>("set", key, metaDataValue);
if (success)
{
unityAdsMetaData.Call("commit");
}
else
{
MonoBehaviour.print("[UnityAds Plugin] Failed to update consent MetaData.");
}
}
}
}
#endif

View File

@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: c98936878987344338357027692b2499
timeCreated: 1526600283
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: aea78a7e2c0464e90852553cb5f0e8aa
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,38 @@
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using System;
using UnityEngine;
using GoogleMobileAds.Mediation.UnityAds.Common;
namespace GoogleMobileAds.Mediation.UnityAds
{
public class UnityAdsClientFactory
{
public static IUnityAdsClient CreateUnityAdsClient()
{
#if UNITY_EDITOR
return new GoogleMobileAds.Mediation.UnityAds.Common.DummyClient();
#elif UNITY_ANDROID
return GoogleMobileAds.Mediation.UnityAds.Android.UnityAdsClient.Instance;
#elif UNITY_IOS
return GoogleMobileAds.Mediation.UnityAds.iOS.UnityAdsClient.Instance;
#else
return new GoogleMobileAds.Mediation.UnityAds.Common.DummyClient();
#endif
}
}
}

View File

@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: e0735edcd2cb14762811a3f496fb9ae3
timeCreated: 1526600283
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f90aaa0800c074971b15b3b035f0f2a7
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,30 @@
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#if UNITY_IOS
using System;
using System.Runtime.InteropServices;
namespace GoogleMobileAds.Mediation.UnityAds.iOS
{
// Externs used by the iOS component
internal class Externs
{
[DllImport("__Internal")]
internal static extern void GADUMSetConsentMetaData(string key, bool metaDataValue);
}
}
#endif

View File

@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: cec7e68a8408c45218e12932e45d8c60
timeCreated: 1526600283
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,43 @@
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#if UNITY_IOS
using UnityEngine;
using GoogleMobileAds.Mediation.UnityAds.Common;
namespace GoogleMobileAds.Mediation.UnityAds.iOS
{
public class UnityAdsClient : IUnityAdsClient
{
private static UnityAdsClient instance = new UnityAdsClient();
private UnityAdsClient() {}
public static UnityAdsClient Instance
{
get
{
return instance;
}
}
public void SetConsentMetaData(string key, bool metaDataValue)
{
Externs.GADUMSetConsentMetaData(key, metaDataValue);
}
}
}
#endif

View File

@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: ec9b8664065c14666a1737bc05fa2bc0
timeCreated: 1526600283
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ef1575cc6ad814c9fa4772b4247016ca
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e05e89399536641ffadb6e04e466784a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,21 @@
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#import <UnityAds/UnityAds.h>
void GADUMSetConsentMetaData(const char* key, BOOL consent) {
UADSMetaData* unityAdsMetaData = [[UADSMetaData alloc] init];
[unityAdsMetaData set:@(key) value:@(consent)];
[unityAdsMetaData commit];
}

View File

@ -0,0 +1,31 @@
fileFormatVersion: 2
guid: 8d905e1f5a0d04ed281ce21e5d30f838
timeCreated: 1526600286
licenseType: Pro
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
iPhone: iOS
second:
enabled: 1
settings: {}
userData:
assetBundleName:
assetBundleVariant: