From cd00d7bda0f4e8c0524e25dd0d08d4ca7210f2c9 Mon Sep 17 00:00:00 2001 From: huyufei Date: Wed, 17 Apr 2024 10:29:11 +0800 Subject: [PATCH] update: pubmatic sdk -> 3.1.0 iOS+Android -> 3.4.0 --- .../Editor/OpenWrapSDKDependencies.xml | 21 ++++---- .../Android/Models/POBDataProviderClient.cs | 2 +- .../Android/Models/POBRequestClient.cs | 7 ++- .../Android/Models/POBUserInfoClient.cs | 14 ------ .../Platform/Android/OpenWrapSDKClient.cs | 44 ----------------- OpenWrapSDK/Platform/Android/POBConstants.cs | 2 + .../Common/Interfaces/IPOBUserInfoClient.cs | 5 -- .../Platform/iOS/Models/POBUserInfoClient.cs | 17 ------- OpenWrapSDK/Platform/iOS/OpenWrapSDKClient.cs | 24 ---------- .../Plugins/OpenWrapSDK/iOS/POBUInterface.m | 15 ------ .../OpenWrapSDK/iOS/POBUModelsInterface.m | 7 +-- OpenWrapSDK/Public/Models/POBUserInfo.cs | 18 ------- OpenWrapSDK/Public/POBOpenWrapSDK.cs | 48 +------------------ 13 files changed, 21 insertions(+), 203 deletions(-) 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.