Skip to content

Commit

Permalink
Pull request #953: v8.11.0
Browse files Browse the repository at this point in the history
Merge in MOBILE-SDK/app_mobile-sdk-ios from v8.11.0 to master

* commit '813547c7007981c4580d078557a119c9a64e2cc7':
  Updated SDK version
  Pull request #946: 6273926 [iOS] Added DSA Support
  Readme file udpate ios
  Fixed framework build issue
  • Loading branch information
asharmaa committed Feb 15, 2024
2 parents efb4463 + 813547c commit 0854031
Show file tree
Hide file tree
Showing 26 changed files with 637 additions and 29 deletions.
4 changes: 2 additions & 2 deletions AppNexusSDK.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "AppNexusSDK"
s.version = "8.10.2"
s.version = "8.11.0"
s.platform = :ios, "12.0"

s.summary = "AppNexus iOS Mobile Advertising SDK"
Expand All @@ -10,7 +10,7 @@ Our mobile advertising SDK gives developers a fast and convenient way to monetiz
DESC

s.homepage = "https://github.com/appnexus/mobile-sdk-ios"
s.source = { :git => "https://github.com/appnexus/mobile-sdk-ios.git", :tag => "#{s.version}" }
s.source = { :git => "https://github.com/appnexus/mobile-sdk-ios.git", :branch => "master" }
s.author = { "AppNexus Mobile Engineering" => "[email protected]" }
s.license = { :type => "Apache License, Version 2.0", :file => "LICENSE" }

Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
Appnexus iOS SDK
=====================

> [!CAUTION]
> We no longer release source code updates of iOS SDK to Github. This is not a deprecation of our SDK, only an open-source deprecation as we are taking our Android and iOS Mobile SDKs private.
> Future updates starting from SDK v9.0 will be released only as compiled .xcframework binary file and will be available for apps to download and integrate through CocoaPods, Swift Package Manager, Carthage and Direct download.
> Please contact your account managers or submit a ticket via the Customer Support Portal: https://help.xandr.com/ if you have any questions.
See the documentation on our wiki here: https://docs.xandr.com/bundle/mobile-sdk/page/xandr-mobile-sdks.html

Get the latest release notes here: https://github.com/appnexus/mobile-sdk-ios/releases
Get the latest release notes here: https://docs.xandr.com/bundle/mobile-sdk/page/ios-sdk-release-notes.html

**To file an issue or request an enhancement please visit the AppNexus Customer Support Portal (https://help.xandr.com). **We do not accept GitHub issues.**

## Use Cocoapods?

Easily include the AppNexus SDK in your Podfile:

```
platform :ios, '10.0'
platform :ios, '12.0'
target 'MyAmazingApp' do
pod 'AppNexusSDK'
Expand Down
11 changes: 11 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 8.11.0

### Announcements:
This is the last minor release in SDK v8.x.
The next major release will be SDK v9.0 and as already announced we will no longer release source code updates of iOS and Android Mobile SDKs to Github. This is not a deprecation of our SDKs, only an open-source deprecation as we are taking our Android and iOS Mobile SDKs private.
There will be no breaking changes from v8.x to v9.0 but keep in mind any new functional changes going forward will be developed only in version v9.x.

### New Feature
+ 6273926 Support for Digital Services Act (DSA) [https://docs.xandr.com/bundle/mobile-sdk/page/ios-sdk-release-notes.html]


## 8.10.2

### Improvement/Bug Fixes
Expand Down
3 changes: 3 additions & 0 deletions sdk/AppNexusNativeMacOSSDK/AppNexusNativeMacOSSDK.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,6 @@ FOUNDATION_EXPORT const unsigned char AppNexusNativeSDKVersionString[];
#import <AppNexusNativeMacOSSDK/XandrAd.h>
#import <AppNexusNativeMacOSSDK/XandrNativeAdView.h>
#import <AppNexusNativeMacOSSDK/ANMultiAdRequest.h>
#import <AppNexusNativeMacOSSDK/ANDSASettings.h>
#import <AppNexusNativeMacOSSDK/ANDSAResponseInfo.h>
#import <AppNexusNativeMacOSSDK/ANDSATransparencyInfo.h>
3 changes: 3 additions & 0 deletions sdk/AppNexusNativeSDK/AppNexusNativeSDK.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,6 @@ FOUNDATION_EXPORT const unsigned char AppNexusNativeSDKVersionString[];

#import <AppNexusNativeSDK/ANUserId.h>
#import <AppNexusNativeSDK/XandrAd.h>
#import <AppNexusNativeSDK/ANDSASettings.h>
#import <AppNexusNativeSDK/ANDSAResponseInfo.h>
#import <AppNexusNativeSDK/ANDSATransparencyInfo.h>
2 changes: 1 addition & 1 deletion sdk/AppNexusNativeSDK/SDK-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>8.10.2</string>
<string>8.11.0</string>
<key>LSApplicationCategoryType</key>
<string></string>
<key>CFBundleVersion</key>
Expand Down
3 changes: 3 additions & 0 deletions sdk/AppNexusNativeStaticSDK/AppNexusNativeStaticSDK.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,6 @@ FOUNDATION_EXPORT const unsigned char AppNexusNativeStaticSDKVersionString[];

#import <AppNexusNativeStaticSDK/ANUserId.h>
#import <AppNexusNativeStaticSDK/XandrAd.h>
#import <AppNexusNativeStaticSDK/ANDSASettings.h>
#import <AppNexusNativeStaticSDK/ANDSAResponseInfo.h>
#import <AppNexusNativeStaticSDK/ANDSATransparencyInfo.h>
2 changes: 1 addition & 1 deletion sdk/AppNexusNativeStaticSDK/SDK-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>8.10.2</string>
<string>8.11.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
</dict>
Expand Down
82 changes: 70 additions & 12 deletions sdk/AppNexusSDK.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions sdk/AppNexusSDK/AppNexusSDK.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ FOUNDATION_EXPORT const unsigned char AppNexusSDKVersionString[];
#import <AppNexusSDK/ANUSPrivacySettings.h>
#import <AppNexusSDK/ANUserId.h>
#import <AppNexusSDK/XandrAd.h>



#import <AppNexusSDK/ANDSASettings.h>
#import <AppNexusSDK/ANDSAResponseInfo.h>
#import <AppNexusSDK/ANDSATransparencyInfo.h>
2 changes: 1 addition & 1 deletion sdk/AppNexusSDK/SDK-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>8.10.2</string>
<string>8.11.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion sdk/sourcefiles/internal/ANAdResponseInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@

@implementation ANAdResponseInfo

@synthesize creativeId, adType, memberId, placementId, contentSource, networkName;
@synthesize creativeId, adType, memberId, placementId, contentSource, networkName, dsaResponseInfo;

@end
4 changes: 2 additions & 2 deletions sdk/sourcefiles/internal/ANGlobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@


#if !APPNEXUS_NATIVE_MACOS_SDK
#define AN_SDK_VERSION @"8.10.2"
#define AN_SDK_VERSION @"8.11.0"
#else
#define AN_SDK_VERSION @"8.10.2-mac"
#define AN_SDK_VERSION @"8.11.0-mac"
#endif


Expand Down
10 changes: 9 additions & 1 deletion sdk/sourcefiles/internal/ANUniversalTagAdServerResponse.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#import "ANAdResponseInfo.h"
#import "ANGlobal.h"
#import "ANAdConstants.h"
#import "ANDSAResponseInfo.h"

#if !APPNEXUS_NATIVE_MACOS_SDK
#import "ANCSRAd.h"
Expand Down Expand Up @@ -63,6 +64,9 @@
static NSString *const kANUniversalTagAdServerResponseKeyAdsCPMPublisherCurrency = @"cpm_publisher_currency";
static NSString *const kANUniversalTagAdServerResponseKeyAdsPublisherCurrencyCode = @"publisher_currency_code";

// DSA
static NSString *const kANUniversalTagAdServerResponseKeyAdsDSA = @"dsa";

static NSString *const kANUniversalTagAdServerResponseKeyAdsCSMObject = @"csm";
static NSString *const kANUniversalTagAdServerResponseKeyAdsSSMObject = @"ssm";
static NSString *const kANUniversalTagAdServerResponseKeyAdsRTBObject = @"rtb";
Expand Down Expand Up @@ -295,6 +299,8 @@ + (nullable ANStandardAd *)generateStandardAdUnitFromHTMLContent: (nonnull NSStr
{
auctionId = [NSString stringWithFormat:@"%@",tag[kANUniversalTagAdServerResponseKeyAdsAuctionId]];
}

NSDictionary *dsaObject = adObject[kANUniversalTagAdServerResponseKeyAdsDSA];

//Initialise AdResponse object to expose all the public facing APIs from the UTv3 response
ANAdResponseInfo *adResponseInfo = [[ANAdResponseInfo alloc] init];
Expand All @@ -307,6 +313,9 @@ + (nullable ANStandardAd *)generateStandardAdUnitFromHTMLContent: (nonnull NSStr
adResponseInfo.cpm = cpm;
adResponseInfo.cpmPublisherCurrency = cpmPublisherCurrency;
adResponseInfo.publisherCurrencyCode = publisherCurrencyCode;
adResponseInfo.publisherCurrencyCode = publisherCurrencyCode;
adResponseInfo.dsaResponseInfo = [ANDSAResponseInfo dsaObjectFromAdObject: dsaObject];

#if !APPNEXUS_NATIVE_MACOS_SDK
ANVerificationScriptResource *omidVerificationScriptResource;
if([adType isEqualToString:kANUniversalTagAdServerResponseKeyNativeObject]){
Expand Down Expand Up @@ -468,7 +477,6 @@ + (nullable ANStandardAd *)generateStandardAdUnitFromHTMLContent: (nonnull NSStr
return [arrayOfAdUnits mutableCopy];
}


+ (NSArray *)adsArrayFromTag:(NSDictionary *)tag {
if ([tag[kANUniversalTagAdServerResponseKeyTagAds] isKindOfClass:[NSArray class]]) {
return tag[kANUniversalTagAdServerResponseKeyTagAds];
Expand Down
43 changes: 43 additions & 0 deletions sdk/sourcefiles/internal/ANUniversalTagRequestBuilder.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#import "ANAdProtocol.h"
#import "ANAdConstants.h"
#import "ANGPPSettings.h"
#import "ANDSASettings.h"
#import "ANDSATransparencyInfo.h"

#if !APPNEXUS_NATIVE_MACOS_SDK
#import "ANOMIDImplementation.h"
Expand Down Expand Up @@ -312,6 +314,12 @@ - (NSDictionary *)requestBody
requestDict[@"privacy"] = gppPrivacyObject;
}

// add DSA Privacy
NSDictionary *dsaPrivacyObject = [self getDSAPrivacyObject];
if (dsaPrivacyObject.allKeys.count > 0) {
requestDict[@"dsa"] = dsaPrivacyObject;
}

// add Facebook bidder token if available
NSArray *tpuids = [self appendFBToken];
if(tpuids != nil){
Expand Down Expand Up @@ -993,6 +1001,41 @@ - (NSDictionary *)contentLanguage
}
}

- (NSDictionary *)getDSAPrivacyObject {
NSMutableDictionary *dsaPrivacyObject = [NSMutableDictionary dictionary];
if ([ANDSASettings.sharedInstance dsaRequired] > -1) {
dsaPrivacyObject[@"dsarequired"] = @([ANDSASettings.sharedInstance dsaRequired]);
}
if ([ANDSASettings.sharedInstance pubRender] > -1) {
dsaPrivacyObject[@"pubrender"] = @([ANDSASettings.sharedInstance pubRender]);
}
if ([ANDSASettings.sharedInstance dataToPub] > -1) {
dsaPrivacyObject[@"datatopub"] = @([ANDSASettings.sharedInstance dataToPub]);
}

NSArray<ANDSATransparencyInfo *> *transparencyList = [ANDSASettings.sharedInstance transparencyList];
if (transparencyList && transparencyList.count > 0) {
NSMutableArray *transparencyArray = [NSMutableArray array];
for (ANDSATransparencyInfo *transparency in transparencyList) {
NSString *domain = [transparency domain];
if (domain.length != 0) {
NSMutableDictionary *transparencyObject = [NSMutableDictionary dictionary];
transparencyObject[@"domain"] = domain;

NSArray<NSNumber *> *dsaparams = [transparency dsaparams];
if (dsaparams) {
transparencyObject[@"dsaparams"] = dsaparams;
}

[transparencyArray addObject:transparencyObject];
}
}
dsaPrivacyObject[@"transparency"] = transparencyArray;
}

return dsaPrivacyObject;
}

#pragma mark - Class methods.

+ (NSNumberFormatter *)precisionNumberFormatter
Expand Down
69 changes: 69 additions & 0 deletions sdk/sourcefiles/internal/config/ANDSAResponseInfo.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/* Copyright 2024 APPNEXUS INC
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 "ANDSAResponseInfo.h"
#import "ANDSATransparencyInfo.h"

@implementation ANDSAResponseInfo

/**
* Process the DSA response from ad object.
*
* @param dsaObject NSDictionary that contains info of DSA.
* @return ANDSAResponseInfo if no issue happened during processing.
*/
+ (instancetype)dsaObjectFromAdObject:(NSDictionary *)dsaObject {
if (!dsaObject || ![dsaObject isKindOfClass:[NSDictionary class]]) {
return nil;
}

ANDSAResponseInfo *dsaResponseInfo = [[ANDSAResponseInfo alloc] init];

NSString *behalf = dsaObject[@"behalf"];
if (behalf && [behalf isKindOfClass:[NSString class]]) {
dsaResponseInfo.behalf = behalf;
}

NSString *paid = dsaObject[@"paid"];
if (paid && [paid isKindOfClass:[NSString class]]) {
dsaResponseInfo.paid = paid;
}

NSArray *transparencyArray = dsaObject[@"transparency"];
if (transparencyArray && [transparencyArray isKindOfClass:[NSArray class]]) {
NSMutableArray<ANDSATransparencyInfo *> *transparencyList = [NSMutableArray array];

for (NSDictionary *transparencyObject in transparencyArray) {
if ([transparencyObject isKindOfClass:[NSDictionary class]]) {
NSString *domain = transparencyObject[@"domain"];
NSArray<NSNumber *> *dsaparams = transparencyObject[@"dsaparams"];

ANDSATransparencyInfo *transparencyInfo = [[ANDSATransparencyInfo alloc] initWithDomain:domain andDSAParams:dsaparams];
[transparencyList addObject:transparencyInfo];
}
}

dsaResponseInfo.transparencyList = transparencyList;
}

NSInteger adRender = [dsaObject[@"adrender"] intValue];
if (adRender >= 0) {
dsaResponseInfo.adRender = adRender;
}

return dsaResponseInfo;
}

@end
32 changes: 32 additions & 0 deletions sdk/sourcefiles/internal/config/ANDSASettings.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/* Copyright 2024 APPNEXUS INC
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 "ANDSASettings.h"

@implementation ANDSASettings

+ (instancetype)sharedInstance {
static dispatch_once_t onceToken;
static ANDSASettings *dsaSettingsInstance;
dispatch_once(&onceToken, ^{
dsaSettingsInstance = [[ANDSASettings alloc] init];
dsaSettingsInstance.dsaRequired = -1;
dsaSettingsInstance.pubRender = -1;
dsaSettingsInstance.dataToPub = -1;
});
return dsaSettingsInstance;
}

@end
32 changes: 32 additions & 0 deletions sdk/sourcefiles/internal/config/ANDSATransparencyInfo.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/* Copyright 2024 APPNEXUS INC
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 "ANDSATransparencyInfo.h"

@implementation ANDSATransparencyInfo

/**
* Initializes an ANDSATransparencyInfo instance with the specified domain and DSA params.
*/
- (instancetype)initWithDomain:(NSString *)domain andDSAParams:(NSArray<NSNumber *> *)dsaparams {
self = [super init];
if (self) {
_domain = domain;
_dsaparams = dsaparams;
}
return self;
}

@end
Loading

0 comments on commit 0854031

Please sign in to comment.