Skip to content

Commit

Permalink
Nend/8.0.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins committed Mar 10, 2023
1 parent 406f26d commit 110abf2
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 31 deletions.
12 changes: 5 additions & 7 deletions Nend/AppLovinMediationNendAdapter.podspec
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
Pod::Spec.new do |s|

s.authors =
{
'AppLovin Corporation' => '[email protected]'
}
s.authors = 'AppLovin Corporation'
s.name = 'AppLovinMediationNendAdapter'
s.version = '7.4.0.0'
s.version = '8.0.0.0'
s.platform = :ios, '10.0'
s.summary = 'Nend adapter used for mediation with the AppLovin MAX SDK'
s.homepage = "https://github.com/CocoaPods/Specs/search?o=desc&q=#{s.name}&s=indexed"
Expand All @@ -29,14 +26,15 @@ s.source =

s.vendored_frameworks = "#{s.name}-#{s.version}/#{s.name}.xcframework"

s.dependency 'NendSDK_iOS', '= 7.4.0'
s.dependency 'NendSDK_iOS', '= 8.0.0'
s.dependency 'AppLovinSDK'

s.pod_target_xcconfig =
{
'VALID_ARCHS' => 'arm64 arm64e armv7 armv7s x86_64',
'VALID_ARCHS[sdk=iphoneos*]' => 'arm64 arm64e armv7 armv7s',
'VALID_ARCHS[sdk=iphonesimulator*]' => 'arm64 arm64e x86_64'
'VALID_ARCHS[sdk=iphonesimulator*]' => 'arm64 arm64e x86_64',
'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386'
}

s.description = <<-DESC
Expand Down
7 changes: 7 additions & 0 deletions Nend/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 8.0.0.0
* Certified with Nend SDK 8.0.0.

## x.x.x.x
* Disable bitcode, as Apple deprecated it in Xcode 14 (https://developer.apple.com/documentation/xcode-release-notes/xcode-14-release-notes).
* Add additional details for ad display failures.

## 7.4.0.0
* Certified with Nend SDK 7.4.0.
* Distribute adapter as an XCFramework.
Expand Down
6 changes: 4 additions & 2 deletions Nend/NendAdapter.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_BITCODE = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
FRAMEWORK_SEARCH_PATHS = "";
Expand Down Expand Up @@ -277,6 +278,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_BITCODE = NO;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
FRAMEWORK_SEARCH_PATHS = "";
Expand Down Expand Up @@ -305,13 +307,13 @@
CODE_SIGN_STYLE = Manual;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = X8JXXK4FF5;
ENABLE_BITCODE = NO;
EXCLUDED_ARCHS = i386;
FRAMEWORK_SEARCH_PATHS = "../../iOS-Workspace/Pods/**";
HEADER_SEARCH_PATHS = "";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LIBRARY_SEARCH_PATHS = "$(inherited)";
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "-fembed-bitcode-marker";
OTHER_LDFLAGS = "$(inherited)";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand All @@ -327,13 +329,13 @@
CODE_SIGN_STYLE = Manual;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = X8JXXK4FF5;
ENABLE_BITCODE = NO;
EXCLUDED_ARCHS = i386;
FRAMEWORK_SEARCH_PATHS = "../../iOS-Workspace/Pods/**";
HEADER_SEARCH_PATHS = "";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LIBRARY_SEARCH_PATHS = "$(inherited)";
ONLY_ACTIVE_ARCH = NO;
OTHER_CFLAGS = "-fembed-bitcode";
OTHER_LDFLAGS = "$(inherited)";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand Down
2 changes: 1 addition & 1 deletion Nend/NendAdapter/ALNendMediationAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

NS_ASSUME_NONNULL_BEGIN

@interface ALNendMediationAdapter : ALMediationAdapter<MAInterstitialAdapter, MARewardedAdapter, MAAdViewAdapter>
@interface ALNendMediationAdapter : ALMediationAdapter <MAInterstitialAdapter, MARewardedAdapter, MAAdViewAdapter>

@end

Expand Down
45 changes: 24 additions & 21 deletions Nend/NendAdapter/ALNendMediationAdapter.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,29 @@
#import <NendAd/NendAd.h>
#import <NendAd/NADLogger.h>

#define ADAPTER_VERSION @"7.4.0.0"
#define ADAPTER_VERSION @"8.0.0.0"
#define NSSTRING(_X) ( (_X != NULL) ? [NSString stringWithCString: _X encoding: NSStringEncodingConversionAllowLossy] : nil)

@interface ALNendMediationAdapterInterstitialAdDelegate : NSObject<NADInterstitialVideoDelegate>
@interface ALNendMediationAdapterInterstitialAdDelegate : NSObject <NADInterstitialVideoDelegate>
@property (nonatomic, weak) ALNendMediationAdapter *parentAdapter;
@property (nonatomic, strong) id<MAInterstitialAdapterDelegate> delegate;
- (instancetype)initWithParentAdapter:(ALNendMediationAdapter *)parentAdapter andNotify:(id<MAInterstitialAdapterDelegate>)delegate;
@end

@interface ALNendMediationAdapterRewardedAdDelegate : NSObject<NADRewardedVideoDelegate>
@interface ALNendMediationAdapterRewardedAdDelegate : NSObject <NADRewardedVideoDelegate>
@property (nonatomic, weak) ALNendMediationAdapter *parentAdapter;
@property (nonatomic, strong) id<MARewardedAdapterDelegate> delegate;
@property (nonatomic, assign, getter=hasGrantedReward) BOOL grantedReward;
- (instancetype)initWithParentAdapter:(ALNendMediationAdapter *)parentAdapter andNotify:(id<MARewardedAdapterDelegate>)delegate;
@end

@interface ALNendMediationAdapterAdViewDelegate : NSObject<NADViewDelegate>
@interface ALNendMediationAdapterAdViewDelegate : NSObject <NADViewDelegate>
@property (nonatomic, weak) ALNendMediationAdapter *parentAdapter;
@property (nonatomic, strong) id<MAAdViewAdapterDelegate> delegate;
- (instancetype)initWithParentAdapter:(ALNendMediationAdapter *)parentAdapter andNotify:(id<MAAdViewAdapterDelegate>)delegate;
@end

@interface ALNendMediationAdapter()
@interface ALNendMediationAdapter ()

@property (nonatomic, strong) NADInterstitialVideo *interstitialVideo;
@property (nonatomic, strong) NADRewardedVideo *rewardedVideo;
Expand All @@ -48,13 +48,12 @@ @implementation ALNendMediationAdapter

static NSString *const kMAConfigKeyApiKey = @"api_key";
static NSString *const kMAConfigKeySetMediationId = @"set_mediation_identifier";
static NSString *const kMAConfigKeyUserId = @"user_id";

#pragma mark - MAAdapter Methods

- (NSString *)SDKVersion
{
NSString *sdkVersionString = NSSTRING((char *)NendAdVersionString);
NSString *sdkVersionString = NSSTRING((char *) NendAdVersionString);

@try
{
Expand Down Expand Up @@ -124,11 +123,6 @@ - (void)loadInterstitialAdForParameters:(id<MAAdapterResponseParameters>)paramet
[self.interstitialVideo setMediationName: self.mediationTag];
}

if ( [serverParameters al_containsValueForKey: kMAConfigKeyUserId] )
{
[self.interstitialVideo setUserId: [serverParameters al_stringForKey: kMAConfigKeyUserId]];
}

[self.interstitialVideo loadAd];
}

Expand All @@ -153,7 +147,14 @@ - (void)showInterstitialAdForParameters:(id<MAAdapterResponseParameters>)paramet
else
{
[self log: @"Interstitial ad not ready"];
[delegate didFailToDisplayInterstitialAdWithError: [MAAdapterError errorWithCode: -4205 errorString: @"Ad Display Failed"]];

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
[delegate didFailToDisplayInterstitialAdWithError: [MAAdapterError errorWithCode: -4205
errorString: @"Ad Display Failed"
thirdPartySdkErrorCode: 0
thirdPartySdkErrorMessage: @"Interstitial ad not ready"]];
#pragma clang diagnostic pop
}
}

Expand All @@ -175,11 +176,6 @@ - (void)loadRewardedAdForParameters:(id<MAAdapterResponseParameters>)parameters
[self.rewardedVideo setMediationName: self.mediationTag];
}

if ( [serverParameters al_containsValueForKey: kMAConfigKeyUserId] )
{
[self.rewardedVideo setUserId: [serverParameters al_stringForKey: kMAConfigKeyUserId]];
}

[self.rewardedVideo loadAd];
}

Expand All @@ -206,7 +202,14 @@ - (void)showRewardedAdForParameters:(id<MAAdapterResponseParameters>)parameters
else
{
[self log: @"Rewarded ad not ready"];
[delegate didFailToDisplayRewardedAdWithError: [MAAdapterError errorWithCode: -4205 errorString: @"Ad Display Failed"]];

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
[delegate didFailToDisplayRewardedAdWithError: [MAAdapterError errorWithCode: -4205
errorString: @"Ad Display Failed"
thirdPartySdkErrorCode: 0
thirdPartySdkErrorMessage: @"Rewarded ad not ready"]];
#pragma clang diagnostic pop
}
}

Expand Down Expand Up @@ -259,7 +262,7 @@ + (MAAdapterError *)toMaxError:(NSError *)nendError
adapterError = MAAdapterError.noConnection;
break;
}

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
return [MAAdapterError errorWithCode: adapterError.errorCode
Expand All @@ -274,7 +277,7 @@ + (MAAdapterError *)toMaxError:(NSError *)nendError
*/
+ (MAAdapterError *)toMaxErrorFromNendAdViewError:(NSError *)nendError
{
NADViewErrorCode nendErrorCode = (NADViewErrorCode)nendError.code;
NADViewErrorCode nendErrorCode = (NADViewErrorCode) nendError.code;
MAAdapterError *adapterError = MAAdapterError.unspecified;
switch ( nendErrorCode )
{
Expand Down

0 comments on commit 110abf2

Please sign in to comment.