-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release Verve Adapter 4.3.0 supports SDK 3.0.4
- Loading branch information
1 parent
c67c2b3
commit 82764ca
Showing
24 changed files
with
1,697 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
version=$(git rev-parse --verify HEAD --short) | ||
|
||
cd .. | ||
|
||
echo 'Adding Git Hash To '${PROJECT_DIR}'' | ||
cd ${PROJECT_DIR}/${PROJECT_NAME} | ||
sed -i -e 's/Githash.*/Githash = @"'$version'";/g' ${PROJECT_NAME}.h | ||
rm -f ${PROJECT_NAME}.h-e | ||
cd ../BuildScript | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
printf '\e[1;32m%-6s\e[m\n' "<----==============================BUILD PASSED==============================---->" | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
if [ -n "$RW_MULTIPLATFORM_BUILD_IN_PROGRESS" ]; then | ||
exit 0 | ||
fi | ||
export RW_MULTIPLATFORM_BUILD_IN_PROGRESS=1 | ||
|
||
ADAPTER_WORKSPACE="${PROJECT_DIR}/${PROJECT_NAME}.xcworkspace" | ||
|
||
|
||
|
||
|
||
#Remove framework if exists. | ||
if [ -d "${PROJECT_DIR}/ReleaseCandidates/${PROJECT_NAME}" ]; then | ||
rm -rf "${PROJECT_DIR}/ReleaseCandidates/${PROJECT_NAME}" | ||
fi | ||
|
||
|
||
|
||
createFramework() { | ||
|
||
xcrun xcodebuild -workspace "${ADAPTER_WORKSPACE}" \ | ||
-scheme "${PROJECT_NAME}" \ | ||
-configuration "${CONFIGURATION}" \ | ||
-sdk "$1" \ | ||
ONLY_ACTIVE_ARCH=NO \ | ||
BUILD_LIBRARY_FOR_DISTRIBUTION=NO \ | ||
SKIP_INSTALL=NO \ | ||
ARCHS="$2" \ | ||
BUILD_DIR="${BUILD_DIR}" \ | ||
OBJROOT="${OBJROOT}/DependentBuilds" \ | ||
BUILD_ROOT="${BUILD_ROOT}" \ | ||
SYMROOT="${SYMROOT}" $ACTION | ||
|
||
|
||
} | ||
|
||
|
||
createFramework "iphoneos" "arm64 x86_64" | ||
createFramework "iphonesimulator" "arm64 x86_64" | ||
|
||
|
||
|
||
|
||
#Create dynamic framework using the frameworks generated above. | ||
xcodebuild -create-xcframework \ | ||
-framework "${BUILD_DIR}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework" \ | ||
-framework "${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${PROJECT_NAME}.framework" \ | ||
-output "${PROJECT_DIR}/ReleaseCandidates/${PROJECT_NAME}/${PROJECT_NAME}.xcframework" |
547 changes: 547 additions & 0 deletions
547
Adapters/Verve/ISVerveAdapter.xcodeproj/project.pbxproj
Large diffs are not rendered by default.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
Adapters/Verve/ISVerveAdapter.xcodeproj/project.xcworkspace/contents.xcworkspacedata
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
.../Verve/ISVerveAdapter.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>IDEDidComputeMac32BitWarning</key> | ||
<true/> | ||
</dict> | ||
</plist> |
10 changes: 10 additions & 0 deletions
10
Adapters/Verve/ISVerveAdapter.xcworkspace/contents.xcworkspacedata
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
Adapters/Verve/ISVerveAdapter.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>IDEDidComputeMac32BitWarning</key> | ||
<true/> | ||
</dict> | ||
</plist> |
21 changes: 21 additions & 0 deletions
21
Adapters/Verve/ISVerveAdapter/Banner/ISVerveBannerAdapter.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// | ||
// ISVerveBannerAdapter.h | ||
// ISVerveAdapter | ||
// | ||
// Copyright © 2024 ironSource. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "ISVerveAdapter+Internal.h" | ||
#if __has_include(<HyBid/HyBid-Swift.h>) | ||
#import <HyBid/HyBid-Swift.h> | ||
#else | ||
#import "HyBid-Swift.h" | ||
#endif | ||
|
||
|
||
@interface ISVerveBannerAdapter : ISBaseBannerAdapter | ||
|
||
- (instancetype)initWithVerveAdapter:(ISVerveAdapter *)adapter; | ||
|
||
@end |
166 changes: 166 additions & 0 deletions
166
Adapters/Verve/ISVerveAdapter/Banner/ISVerveBannerAdapter.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,166 @@ | ||
// | ||
// ISVerveBannerAdapter.m | ||
// ISVerveAdapter | ||
// | ||
// Copyright © 2024 ironSource. All rights reserved. | ||
// | ||
|
||
#import "ISVerveBannerAdapter.h" | ||
#import "ISVerveBannerDelegate.h" | ||
|
||
@interface ISVerveBannerAdapter () | ||
|
||
@property (nonatomic, weak) ISVerveAdapter *adapter; | ||
@property (nonatomic, strong) HyBidAdView *ad; | ||
@property (nonatomic, strong) ISVerveBannerDelegate *verveAdDelegate; | ||
@property (nonatomic, weak) id<ISBannerAdapterDelegate> smashDelegate; | ||
|
||
@end | ||
|
||
@implementation ISVerveBannerAdapter | ||
|
||
- (instancetype)initWithVerveAdapter:(ISVerveAdapter *)adapter { | ||
self = [super init]; | ||
if (self) { | ||
_adapter = adapter; | ||
_smashDelegate = nil; | ||
_ad = nil; | ||
_verveAdDelegate = nil; | ||
} | ||
return self; | ||
} | ||
|
||
- (void)initBannerForBiddingWithUserId:(NSString *)userId | ||
adapterConfig:(ISAdapterConfig *)adapterConfig | ||
delegate:(id<ISBannerAdapterDelegate>)delegate { | ||
NSString *appToken = [self getStringValueFromAdapterConfig:adapterConfig | ||
forKey:kAppToken]; | ||
|
||
/* Configuration Validation */ | ||
if (![self.adapter isConfigValueValid:appToken]) { | ||
NSError *error = [self.adapter errorForMissingCredentialFieldWithName:kAppToken]; | ||
LogAdapterApi_Internal(@"error = %@", error); | ||
[delegate adapterBannerInitFailedWithError:error]; | ||
return; | ||
} | ||
|
||
NSString *adUnitId = [self getStringValueFromAdapterConfig:adapterConfig | ||
forKey:kZoneId]; | ||
/* Configuration Validation */ | ||
if (![self.adapter isConfigValueValid:adUnitId]) { | ||
NSError *error = [self.adapter errorForMissingCredentialFieldWithName:kZoneId]; | ||
LogAdapterApi_Internal(@"error = %@", error); | ||
[delegate adapterBannerInitFailedWithError:error]; | ||
return; | ||
} | ||
|
||
self.smashDelegate = delegate; | ||
|
||
LogAdapterApi_Internal(@"appToken = %@, adUnitId = %@", appToken, adUnitId); | ||
|
||
switch ([self.adapter getInitState]) { | ||
case INIT_STATE_NONE: | ||
case INIT_STATE_IN_PROGRESS: | ||
[self.adapter initSDKWithAppToken:appToken]; | ||
break; | ||
case INIT_STATE_SUCCESS: | ||
[delegate adapterBannerInitSuccess]; | ||
break; | ||
case INIT_STATE_FAILED: | ||
LogAdapterApi_Internal(@"init failed - appToken = %@", appToken); | ||
[delegate adapterBannerInitFailedWithError:[ISError createError:ERROR_CODE_INIT_FAILED | ||
withMessage:@"Verve SDK init failed"]]; | ||
break; | ||
} | ||
} | ||
|
||
- (void)loadBannerForBiddingWithAdapterConfig:(ISAdapterConfig *)adapterConfig | ||
adData:(NSDictionary *)adData | ||
serverData:(NSString *)serverData | ||
viewController:(UIViewController *)viewController | ||
size:(ISBannerSize *)size | ||
delegate:(id<ISBannerAdapterDelegate>)delegate { | ||
|
||
NSString *zoneId = [self getStringValueFromAdapterConfig:adapterConfig | ||
forKey:kZoneId]; | ||
LogAdapterApi_Internal(@"zoneId = %@", zoneId); | ||
|
||
// create banner ad delegate | ||
ISVerveBannerDelegate *bannerAdDelegate = [[ISVerveBannerDelegate alloc] | ||
initWithZoneId:zoneId | ||
andDelegate:delegate]; | ||
self.verveAdDelegate = bannerAdDelegate; | ||
|
||
dispatch_async(dispatch_get_main_queue(), ^{ | ||
self.ad = [[HyBidAdView alloc] initWithSize:[self getBannerSize:size]]; | ||
[self.ad renderAdWithContent: serverData | ||
withDelegate: self.verveAdDelegate]; | ||
}); | ||
} | ||
|
||
- (void)destroyBannerWithAdapterConfig:(ISAdapterConfig *)adapterConfig { | ||
NSString *zoneId = [self getStringValueFromAdapterConfig:adapterConfig | ||
forKey:kZoneId]; | ||
|
||
LogAdapterDelegate_Internal(@"zoneId = %@", zoneId); | ||
|
||
dispatch_async(dispatch_get_main_queue(), ^{ | ||
if (self.ad) { | ||
self.ad = nil; | ||
} | ||
if (self.ad && self.ad.delegate) { | ||
self.ad.delegate = nil; | ||
} | ||
}); | ||
|
||
self.smashDelegate = nil; | ||
self.verveAdDelegate = nil; | ||
} | ||
|
||
- (void)collectBannerBiddingDataWithAdapterConfig:(ISAdapterConfig *)adapterConfig | ||
adData:(NSDictionary *)adData | ||
delegate:(id<ISBiddingDataDelegate>)delegate { | ||
|
||
[self.adapter collectBiddingDataWithDelegate:delegate]; | ||
} | ||
|
||
#pragma mark - Init Delegate | ||
|
||
- (void)onNetworkInitCallbackSuccess { | ||
[self.smashDelegate adapterBannerInitSuccess]; | ||
} | ||
|
||
- (void)onNetworkInitCallbackFailed:(NSString *)errorMessage { | ||
NSError *error = [ISError createErrorWithDomain:kAdapterName | ||
code:ERROR_CODE_INIT_FAILED | ||
message:errorMessage]; | ||
[self.smashDelegate adapterBannerInitFailedWithError:error]; | ||
} | ||
|
||
#pragma mark - Memory Handling | ||
|
||
- (void)releaseMemoryWithAdapterConfig:(ISAdapterConfig *)adapterConfig { | ||
NSString *zoneId = [self getStringValueFromAdapterConfig:adapterConfig | ||
forKey:kZoneId]; | ||
LogAdapterDelegate_Internal(@"zoneId = %@", zoneId); | ||
|
||
[self destroyBannerWithAdapterConfig:adapterConfig]; | ||
} | ||
|
||
#pragma mark - Helper Methods | ||
|
||
- (HyBidAdSize *)getBannerSize:(ISBannerSize *)ironSourceAdSize { | ||
if ([ironSourceAdSize.sizeDescription isEqualToString:kSizeRectangle]) { | ||
return HyBidAdSize.SIZE_300x250; | ||
} else if ([ironSourceAdSize.sizeDescription isEqualToString:kSizeSmart]) { | ||
if (UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad){ | ||
return HyBidAdSize.SIZE_728x90; | ||
} else { | ||
return HyBidAdSize.SIZE_320x50; | ||
} | ||
} else { | ||
return HyBidAdSize.SIZE_320x50; | ||
} | ||
} | ||
|
||
@end |
19 changes: 19 additions & 0 deletions
19
Adapters/Verve/ISVerveAdapter/Banner/ISVerveBannerDelegate.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// ISVerveBannerDelegate.h | ||
// ISVerveAdapter | ||
// | ||
// Copyright © 2024 ironSource Mobile Ltd. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import <IronSource/ISBaseAdapter+Internal.h> | ||
#import <HyBid/HyBid.h> | ||
|
||
@interface ISVerveBannerDelegate : NSObject <HyBidAdViewDelegate> | ||
|
||
@property (nonatomic, strong) NSString* zoneId; | ||
@property (nonatomic, weak) id<ISBannerAdapterDelegate> delegate; | ||
|
||
- (instancetype)initWithZoneId:(NSString *)adUnitId | ||
andDelegate:(id<ISBannerAdapterDelegate>)delegate; | ||
@end |
53 changes: 53 additions & 0 deletions
53
Adapters/Verve/ISVerveAdapter/Banner/ISVerveBannerDelegate.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// | ||
// ISVerveBannerDelegate.m | ||
// ISVerveAdapter | ||
// | ||
// Copyright © 2024 ironSource Mobile Ltd. All rights reserved. | ||
// | ||
|
||
#import "ISVerveBannerDelegate.h" | ||
#import "ISVerveBannerAdapter.h" | ||
|
||
@implementation ISVerveBannerDelegate | ||
|
||
- (instancetype)initWithZoneId:(NSString *)zoneId | ||
andDelegate:(id<ISBannerAdapterDelegate>)delegate { | ||
self = [super init]; | ||
if (self) { | ||
_zoneId = zoneId; | ||
_delegate = delegate; | ||
} | ||
return self; | ||
} | ||
|
||
/// calls this method when ad successfully loaded and ready to be displayed. | ||
/// @param adView adView object that was loaded | ||
- (void)adViewDidLoad:(HyBidAdView *)adView { | ||
LogAdapterDelegate_Internal(@"zoneId = %@", self.zoneId); | ||
[self.delegate adapterBannerDidLoad:adView]; | ||
} | ||
/// calls this method when ad was not loaded for some reasons | ||
/// @param adView adView object that was loaded | ||
/// @param error the reason of failing loading | ||
- (void)adView:(HyBidAdView *)adView didFailWithError:(NSError *)error { | ||
LogAdapterDelegate_Internal(@"zoneId = %@ with error = %@", self.zoneId, error); | ||
NSError *smashError = error.code == HyBidErrorCodeNoFill ? [ISError createError:ERROR_BN_LOAD_NO_FILL | ||
withMessage:@"Verve no fill"] : error; | ||
|
||
[self.delegate adapterBannerDidFailToLoadWithError:smashError]; | ||
|
||
} | ||
|
||
/// calls this method when user clicked on the ad | ||
/// @param adView adView object that was clicked | ||
- (void)adViewDidTrackClick:(HyBidAdView *)adView { | ||
LogAdapterDelegate_Internal(@"zoneId = %@", self.zoneId); | ||
[self.delegate adapterBannerDidClick]; | ||
} | ||
/// calls this method when ad was displayed and is viewable by the user | ||
- (void)adViewDidTrackImpression:(HyBidAdView *)adView { | ||
LogAdapterDelegate_Internal(@"zoneId = %@", self.zoneId); | ||
[self.delegate adapterBannerDidShow]; | ||
} | ||
|
||
@end |
Oops, something went wrong.