message: Adding adapter files - Vungle

change_type: UNKNOWN

diff:
@@ -8,4 +8,5 @@ framework module VungleAdapter {
link framework "UIKit"
// Add any public headers here.
+ header "VungleAdNetworkExtras.h"
}

diff:
This is an adapter to be used in conjunction with the Google Mobile Ads SDK.
For requirements, instructions, and other info, see the
-[quick start guide](https://firebase.google.com/docs/admob/ios/quick-start).
+[quick start guide](https://developers.google.com/admob/ios/mediation/vungle).

diff:
7D1B6CA61DC2AD7700D8CABF /* Framework Script */,
);
dependencies = (
+ A8435CF61F152C9400AA595E /* PBXTargetDependency */,
);
name = Framework;
productName = Framework;
7DD2DCBD1DD12E3E00888FDB /* Static Library Script */,
);
dependencies = (
+ A8435CF41F152C8E00AA595E /* PBXTargetDependency */,
);
name = FatAdapter;
productName = FatAdapter;
/* End PBXAggregateTarget section */
/* Begin PBXBuildFile section */
- 7D1575701EB7FB9200059469 /* README.md in Sources */ = {isa = PBXBuildFile; fileRef = 7D15756F1EB7FB9200059469 /* README.md */; };
7D1575721EB7FBB200059469 /* VungleAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = 7D1575711EB7FBB200059469 /* VungleAdapter.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ A85428E01F11853A00C135E7 /* GADMAdapterVungleInterstitial.h in Headers */ = {isa = PBXBuildFile; fileRef = A85428D81F11853A00C135E7 /* GADMAdapterVungleInterstitial.h */; };
+ A85428E11F11853A00C135E7 /* GADMAdapterVungleInterstitial.m in Sources */ = {isa = PBXBuildFile; fileRef = A85428D91F11853A00C135E7 /* GADMAdapterVungleInterstitial.m */; };
+ A85428E21F11853A00C135E7 /* GADMAdapterVungleRewardBasedVideoAd.h in Headers */ = {isa = PBXBuildFile; fileRef = A85428DA1F11853A00C135E7 /* GADMAdapterVungleRewardBasedVideoAd.h */; };
+ A85428E31F11853A00C135E7 /* GADMAdapterVungleRewardBasedVideoAd.m in Sources */ = {isa = PBXBuildFile; fileRef = A85428DB1F11853A00C135E7 /* GADMAdapterVungleRewardBasedVideoAd.m */; };
+ A85428E41F11853A00C135E7 /* VungleAdNetworkExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = A85428DC1F11853A00C135E7 /* VungleAdNetworkExtras.h */; };
+ A85428E51F11853A00C135E7 /* VungleAdNetworkExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = A85428DD1F11853A00C135E7 /* VungleAdNetworkExtras.m */; };
+ A85428E61F11853A00C135E7 /* vungleHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = A85428DE1F11853A00C135E7 /* vungleHelper.h */; };
+ A85428E71F11853A00C135E7 /* vungleHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = A85428DF1F11853A00C135E7 /* vungleHelper.m */; };
/* End PBXBuildFile section */
+/* Begin PBXContainerItemProxy section */
+ A8435CF31F152C8E00AA595E /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 7DFABB151DA8682C00322E02 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 7DFABB1C1DA8682C00322E02;
+ remoteInfo = Adapter;
+ };
+ A8435CF51F152C9400AA595E /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 7DFABB151DA8682C00322E02 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 7DFABB1C1DA8682C00322E02;
+ remoteInfo = Adapter;
+ };
+/* End PBXContainerItemProxy section */
+
/* Begin PBXCopyFilesBuildPhase section */
7DFABB1B1DA8682C00322E02 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
- 7D15756F1EB7FB9200059469 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
7D1575711EB7FBB200059469 /* VungleAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VungleAdapter.h; sourceTree = "<group>"; };
7D264FF01DDD1B4E00027720 /* CHANGELOG.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = CHANGELOG.md; sourceTree = "<group>"; };
7D264FF21DDD1B9400027720 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
7DC8681F1DDA8D4400F0F1C4 /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; path = module.modulemap; sourceTree = "<group>"; };
7DE821BF1DB04B5000AA08CF /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
7DFABB1D1DA8682C00322E02 /* libAdapter.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libAdapter.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ A85428D81F11853A00C135E7 /* GADMAdapterVungleInterstitial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GADMAdapterVungleInterstitial.h; sourceTree = "<group>"; };
+ A85428D91F11853A00C135E7 /* GADMAdapterVungleInterstitial.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GADMAdapterVungleInterstitial.m; sourceTree = "<group>"; };
+ A85428DA1F11853A00C135E7 /* GADMAdapterVungleRewardBasedVideoAd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GADMAdapterVungleRewardBasedVideoAd.h; sourceTree = "<group>"; };
+ A85428DB1F11853A00C135E7 /* GADMAdapterVungleRewardBasedVideoAd.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GADMAdapterVungleRewardBasedVideoAd.m; sourceTree = "<group>"; };
+ A85428DC1F11853A00C135E7 /* VungleAdNetworkExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VungleAdNetworkExtras.h; sourceTree = "<group>"; };
+ A85428DD1F11853A00C135E7 /* VungleAdNetworkExtras.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VungleAdNetworkExtras.m; sourceTree = "<group>"; };
+ A85428DE1F11853A00C135E7 /* vungleHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vungleHelper.h; sourceTree = "<group>"; };
+ A85428DF1F11853A00C135E7 /* vungleHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = vungleHelper.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
7D15756E1EB7FB9200059469 /* VungleAdapter */ = {
isa = PBXGroup;
children = (
- 7D15756F1EB7FB9200059469 /* README.md */,
+ A85428D81F11853A00C135E7 /* GADMAdapterVungleInterstitial.h */,
+ A85428D91F11853A00C135E7 /* GADMAdapterVungleInterstitial.m */,
+ A85428DA1F11853A00C135E7 /* GADMAdapterVungleRewardBasedVideoAd.h */,
+ A85428DB1F11853A00C135E7 /* GADMAdapterVungleRewardBasedVideoAd.m */,
+ A85428DC1F11853A00C135E7 /* VungleAdNetworkExtras.h */,
+ A85428DD1F11853A00C135E7 /* VungleAdNetworkExtras.m */,
+ A85428DE1F11853A00C135E7 /* vungleHelper.h */,
+ A85428DF1F11853A00C135E7 /* vungleHelper.m */,
);
path = VungleAdapter;
sourceTree = "<group>";
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
+ A85428E41F11853A00C135E7 /* VungleAdNetworkExtras.h in Headers */,
+ A85428E01F11853A00C135E7 /* GADMAdapterVungleInterstitial.h in Headers */,
7D1575721EB7FBB200059469 /* VungleAdapter.h in Headers */,
+ A85428E21F11853A00C135E7 /* GADMAdapterVungleRewardBasedVideoAd.h in Headers */,
+ A85428E61F11853A00C135E7 /* vungleHelper.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- 7D1575701EB7FB9200059469 /* README.md in Sources */,
+ A85428E51F11853A00C135E7 /* VungleAdNetworkExtras.m in Sources */,
+ A85428E11F11853A00C135E7 /* GADMAdapterVungleInterstitial.m in Sources */,
+ A85428E71F11853A00C135E7 /* vungleHelper.m in Sources */,
+ A85428E31F11853A00C135E7 /* GADMAdapterVungleRewardBasedVideoAd.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
+/* Begin PBXTargetDependency section */
+ A8435CF41F152C8E00AA595E /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 7DFABB1C1DA8682C00322E02 /* Adapter */;
+ targetProxy = A8435CF31F152C8E00AA595E /* PBXContainerItemProxy */;
+ };
+ A8435CF61F152C9400AA595E /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 7DFABB1C1DA8682C00322E02 /* Adapter */;
+ targetProxy = A8435CF51F152C9400AA595E /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
/* Begin XCBuildConfiguration section */
7D1B6CA41DC2ACF900D8CABF /* Debug */ = {
isa = XCBuildConfiguration;
7DFABB271DA8682C00322E02 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(PROJECT_DIR)/Drop_Framework_And_Headers",
+ );
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
SKIP_INSTALL = YES;
};
7DFABB281DA8682C00322E02 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(PROJECT_DIR)/Drop_Framework_And_Headers",
+ );
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
SKIP_INSTALL = YES;
};

diff:
+#import <Foundation/Foundation.h>
+
+#import <GoogleMobileAds/Mediation/GADMAdNetworkAdapterProtocol.h>
+
+@interface GADMAdapterVungleInterstitial : NSObject<GADMAdNetworkAdapter>
+@end
\ No newline at end of file

diff:
+#import <GoogleMobileAds/Mediation/GADMAdNetworkConnectorProtocol.h>
+#import "GADMAdapterVungleInterstitial.h"
+#import "vungleHelper.h"
+
+static NSString *const kGADMAdapterVungleInterstitialKeyApplicationID = @"application_id";
+
+@interface GADMAdapterVungleInterstitial () <VungleDelegate>
+@property(nonatomic, weak) id<GADMAdNetworkConnector> connector;
+@end
+
+@implementation GADMAdapterVungleInterstitial
+
++ (NSString *)adapterVersion {
+ return [vungleHelper adapterVersion];
+}
+
++ (Class<GADAdNetworkExtras>)networkExtrasClass {
+ return [VungleAdNetworkExtras class];
+}
+
+- (instancetype)initWithGADMAdNetworkConnector:(id<GADMAdNetworkConnector>)connector {
+ self = [super init];
+ if (self) {
+ self.connector = connector;
+ [vungleHelper sharedInstance].interstitialDelegate = self;
+ }
+ return self;
+}
+
+
+- (void)dealloc {
+ [vungleHelper sharedInstance].interstitialDelegate = nil;
+}
+
+- (void)getBannerWithSize:(GADAdSize)adSize{
+ NSError *error = [NSError errorWithDomain:@"google"
+ code:0
+ userInfo:@{
+ NSLocalizedDescriptionKey : @"No ad fetched."
+ }];
+ [_connector adapter:self didFailAd:error];
+}
+
+- (void) loadAd {
+ if ([[vungleHelper sharedInstance] isAdPlayableFor:desiredPlacement]) {
+ [_connector adapterDidReceiveInterstitial:self];
+ } else {
+ [[vungleHelper sharedInstance] loadAd:InterstitialAdapter placement:desiredPlacement];
+ }
+}
+
+
+- (void)getInterstitial {
+ VungleAdNetworkExtras* extras = [_connector networkExtras];
+ desiredPlacement = extras.placement;
+ if (!extras || !extras.placements || [extras.placements count] == 0) {
+ NSLog(@"Placements should be specified!");
+ [_connector adapter:self didFailAd:[NSError errorWithDomain:@"GADMAdapterVungleInterstitial" code:0 userInfo:@{NSLocalizedDescriptionKey: @"Placements should be specified!"}]];
+ return;
+ }
+
+ if ([[vungleHelper sharedInstance] isInitialised]) {
+ [self loadAd];
+ } else {
+ NSDictionary *serverParameters = [_connector credentials];
+ NSString *applicationID = [serverParameters objectForKey:kGADMAdapterVungleInterstitialKeyApplicationID];
+ [[vungleHelper sharedInstance] initWithAppId:applicationID placements:extras.placements adapter:InterstitialAdapter];
+ }
+}
+
+- (void)stopBeingDelegate {
+ _connector = nil;
+ [vungleHelper sharedInstance].interstitialDelegate = nil;
+}
+
+- (BOOL)isBannerAnimationOK:(GADMBannerAnimationType)animType{
+ return YES;
+}
+
+- (void)presentInterstitialFromRootViewController:(UIViewController *)rootViewController{
+ if (![[vungleHelper sharedInstance] playAd:rootViewController adapter:InterstitialAdapter placement:desiredPlacement extras:[_connector networkExtras]]) {
+ [_connector adapterDidDismissInterstitial:self];
+ }
+}
+
+#pragma mark - vungleHelper delegates
+
+
+@synthesize desiredPlacement;
+
+-(void)initialized:(BOOL)isSuccess error:(NSError *)error {
+ if (isSuccess) {
+ if (desiredPlacement) {
+ [self loadAd];
+ }
+ } else {
+ [_connector adapter:self didFailAd:error];
+ }
+}
+
+-(void)adAvailable{
+ [_connector adapterDidReceiveInterstitial:self];
+}
+
+-(void)willShowAd{
+ [_connector adapterWillPresentInterstitial:self];
+}
+
+-(void)willLeaveApplication {
+ [_connector adapterWillLeaveApplication:self];
+}
+
+-(void)willCloseAd:(bool)completedView{
+ [_connector adapterWillDismissInterstitial:self];
+ [_connector adapterDidDismissInterstitial:self];
+}
+
+@end

diff:
+#import <Foundation/Foundation.h>
+
+#import <GoogleMobileAds/Mediation/GADMRewardBasedVideoAdNetworkAdapterProtocol.h>
+
+@interface GADMAdapterVungleRewardBasedVideoAd : NSObject<GADMRewardBasedVideoAdNetworkAdapter>
+@end

diff:
+#import <GoogleMobileAds/Mediation/GADMRewardBasedVideoAdNetworkConnectorProtocol.h>
+#import "GADMAdapterVungleRewardBasedVideoAd.h"
+#import "vungleHelper.h"
+#import "VungleAdNetworkExtras.h"
+
+static NSString *const kGADMAdapterVungleRewardBasedVideoAdKeyApplicationID = @"application_id";
+
+@interface GADMAdapterVungleRewardBasedVideoAd () <VungleDelegate>
+@property(nonatomic, weak) id<GADMRewardBasedVideoAdNetworkConnector> connector;
+@end
+
+@implementation GADMAdapterVungleRewardBasedVideoAd
+
++ (NSString *)adapterVersion {
+ return [vungleHelper adapterVersion];
+}
+
++ (Class<GADAdNetworkExtras>)networkExtrasClass {
+ return [VungleAdNetworkExtras class];
+}
+
+- (instancetype)initWithRewardBasedVideoAdNetworkConnector:(id<GADMRewardBasedVideoAdNetworkConnector>)connector {
+ self = [super init];
+ if (self) {
+ self.connector = connector;
+ [vungleHelper sharedInstance].rewardDelegate = self;
+ }
+ return self;
+}
+
+- (void)dealloc {
+ [vungleHelper sharedInstance].rewardDelegate = nil;
+}
+
+- (void)setUp {
+ NSDictionary *serverParameters = [_connector credentials];
+ NSString *applicationID = [serverParameters objectForKey:kGADMAdapterVungleRewardBasedVideoAdKeyApplicationID];
+ VungleAdNetworkExtras* extras = [_connector networkExtras];
+ if (!extras || !extras.placements || [extras.placements count] == 0) {
+ NSLog(@"Placements should be specified!");
+ [_connector adapter:self didFailToSetUpRewardBasedVideoAdWithError:[NSError errorWithDomain:@"GADMAdapterVungleRewardBasedVideoAd" code:0 userInfo:@{NSLocalizedDescriptionKey: @"Placements should be specified!"}]];
+ return;
+ }
+ vungleHelper* sdk = [vungleHelper sharedInstance];
+ if ([sdk isInitialised]) {
+ [_connector adapterDidSetUpRewardBasedVideoAd:self];
+ } else {
+ [sdk initWithAppId:applicationID placements:extras.placements adapter:RewardBasedAdapter];
+ }
+}
+
+- (void)requestRewardBasedVideoAd {
+ vungleHelper* sdk = [vungleHelper sharedInstance];
+ desiredPlacement = ((VungleAdNetworkExtras *)[_connector networkExtras]).placement;
+ if ([sdk isAdPlayableFor:desiredPlacement]) {
+ [_connector adapterDidReceiveRewardBasedVideoAd:self];
+ } else {
+ [sdk loadAd:RewardBasedAdapter placement:desiredPlacement];
+ }
+}
+
+- (void)presentRewardBasedVideoAdWithRootViewController:(UIViewController *)viewController {
+ if (![[vungleHelper sharedInstance] playAd:viewController adapter:RewardBasedAdapter placement:desiredPlacement extras:[_connector networkExtras]]) {
+ [_connector adapterDidCloseRewardBasedVideoAd:self];
+ }
+}
+
+- (void)stopBeingDelegate {
+ _connector = nil;
+ [vungleHelper sharedInstance].rewardDelegate = nil;
+}
+
+#pragma mark - vungleHelper delegates
+
+@synthesize desiredPlacement;
+
+-(void)initialized:(BOOL)isSuccess error:(NSError *)error{
+ if (isSuccess){
+ [_connector adapterDidSetUpRewardBasedVideoAd:self];
+ } else {
+ [_connector adapter:self didFailToSetUpRewardBasedVideoAdWithError:error];
+ }
+}
+
+-(void)adAvailable{
+ [_connector adapterDidReceiveRewardBasedVideoAd:self];
+}
+
+-(void)willShowAd{
+ [_connector adapterDidOpenRewardBasedVideoAd:self];
+ [_connector adapterDidStartPlayingRewardBasedVideoAd:self];
+}
+
+-(void)willLeaveApplication {
+ [_connector adapterWillLeaveApplication:self];
+}
+
+-(void)willCloseAd:(bool)completedView{
+ if (completedView){
+ GADAdReward* reward = [[GADAdReward alloc] initWithRewardType:@"vungle" rewardAmount:[NSDecimalNumber decimalNumberWithString:@"1"]];
+ [_connector adapter:self didRewardUserWithReward:reward];
+ }
+ [_connector adapterDidCloseRewardBasedVideoAd:self];
+}
+
+@end

change_type: DELETE

diff: -Place adapter source code files in this folder.

diff:
+#import <Foundation/Foundation.h>
+#import <VungleSDK/VungleSDK.h>
+
+#import "VungleAdNetworkExtras.h"
+
+typedef enum {
+ InterstitialAdapter = 1 << 1,
+ RewardBasedAdapter = 1 << 2
+} Adapter;
+
+@protocol VungleDelegate <NSObject>
+-(void)initialized:(BOOL)isSuccess error:(NSError *)error;
+-(void)adAvailable;
+-(void)willShowAd;
+-(void)willLeaveApplication;
+-(void)willCloseAd:(bool)completedView;
+@property (strong) NSString * desiredPlacement;
+@end
+
+@interface vungleHelper : NSObject<VungleSDKDelegate>
+@property (strong) id<VungleDelegate> interstitialDelegate;
+@property (strong) id<VungleDelegate> rewardDelegate;
+@property (readonly) BOOL isInitialising;
+@property (readonly) BOOL isInitialised;
+
++ (NSString *)adapterVersion;
+
++ (vungleHelper*) sharedInstance;
+
+-(void)initWithAppId:(NSString *)appId placements:(NSArray<NSString *>*)placements adapter:(Adapter)adapter;
+-(BOOL)isAdPlayableFor:(NSString *)placement;
+-(BOOL)playAd:(UIViewController *)viewController adapter:(Adapter)adapter placement:(NSString *)placement extras:(VungleAdNetworkExtras *)extras;
+-(void)loadAd:(Adapter)adapter placement:(NSString *)placement;
+@end

diff:
+#import "vungleHelper.h"
+
+@implementation vungleHelper
+
+static Adapter initializing = 0;
+static Adapter waiting = 0;
+static Adapter playing = 0;
+
++ (NSString *)adapterVersion {
+ return @"2.0.0";
+}
+
++ (vungleHelper*) sharedInstance{
+ static vungleHelper *instance = nil;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ instance = [[vungleHelper alloc] init];
+ });
+ return instance;
+}
+
+-(id)init{
+ self = [super init];
+ if (self){
+ [VungleSDK sharedSDK].delegate = self;
+ }
+ return self;
+}
+
+-(void)initWithAppId:(NSString *)appId placements:(NSArray<NSString *>*)placements adapter:(Adapter)adapter{
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ NSString *version = [[vungleHelper adapterVersion] stringByReplacingOccurrencesOfString:@"." withString:@"_"];
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wundeclared-selector"
+ [[VungleSDK sharedSDK] performSelector:@selector(setPluginName:version:) withObject:@"admob" withObject:version];
+#pragma clang diagnostic pop
+ });
+ VungleSDK* sdk = [VungleSDK sharedSDK];
+ if ([sdk isInitialized]) {
+ _isInitialised = true;
+ return;
+ }
+ initializing |= adapter;
+ if ([self isInitialising]) {
+ return;
+ }
+
+ _isInitialising = true;
+
+ NSError* err = nil;
+ [sdk startWithAppId:appId placements:placements error:&err];
+ if (err) {
+ [self initialized:false error:err];
+ }
+}
+
+-(BOOL)isAdPlayableFor:(NSString *)placement{
+ return [[VungleSDK sharedSDK] isAdCachedForPlacementID:placement];
+}
+
+-(void)loadAd:(Adapter)adapter placement:(NSString *)placement {
+ waiting |= adapter;
+ VungleSDK* sdk = [VungleSDK sharedSDK];
+ if ([sdk isAdCachedForPlacementID:placement]) {
+ [self vungleAdPlayabilityUpdate:true placementID:placement];
+ return;
+ }
+ [sdk loadPlacementWithID:placement error:nil];
+}
+
+- (BOOL)playAd:(UIViewController *)viewController adapter:(Adapter)adapter placement:(NSString *)placement extras:(VungleAdNetworkExtras *)extras {
+ if (![[VungleSDK sharedSDK] isAdCachedForPlacementID:placement]) {
+ return false;
+ }
+ NSMutableDictionary *options = [[NSMutableDictionary alloc] init];
+ NSError *error = nil;
+ bool startPlaying = true;
+ [VungleSDK sharedSDK].muted = extras.muted;
+ playing |= adapter;
+ if (![[VungleSDK sharedSDK] playAd:viewController options:options placementID:placement error:&error]){
+ playing &= ~adapter;
+ startPlaying = false;
+ }
+ if (error) {
+ NSLog(@"Adapter failed to present reward based video ad, error %@", [error localizedDescription]);
+ playing &= ~adapter;
+ startPlaying = false;
+ };
+ return startPlaying;
+}
+
+-(void)initialized:(BOOL)isSuccess error:(NSError *)error {
+ _isInitialising = false;
+ if (isSuccess) {
+ _isInitialised = true;
+ }
+ if ((initializing & InterstitialAdapter) && _interstitialDelegate && [_interstitialDelegate respondsToSelector:@selector(initialized:error:)]) {
+ initializing &= ~InterstitialAdapter;
+ [_interstitialDelegate initialized:isSuccess error:error];
+ }
+
+ if ((initializing & RewardBasedAdapter) && _rewardDelegate && [_rewardDelegate respondsToSelector:@selector(initialized:error:)]) {
+ initializing &= ~RewardBasedAdapter;
+ [_rewardDelegate initialized:isSuccess error:error];
+ }
+}
+
+#pragma mark - VungleSDKDelegate methods
+
+- (void)vungleWillShowAdForPlacementID:(nullable NSString *)placementID {
+ if ((playing & InterstitialAdapter) && _interstitialDelegate && [_interstitialDelegate respondsToSelector:@selector(willShowAd)]){
+ [_interstitialDelegate willShowAd];
+ }
+ if ((playing & RewardBasedAdapter) && _rewardDelegate && [_rewardDelegate respondsToSelector:@selector(willShowAd)]){
+ [_rewardDelegate willShowAd];
+ }
+}
+
+- (void)vungleWillCloseAdWithViewInfo:(nonnull VungleViewInfo *)info placementID:(nonnull NSString *)placementID {
+ if (playing & InterstitialAdapter){
+ playing &= ~InterstitialAdapter;
+ if (_interstitialDelegate && [_interstitialDelegate respondsToSelector:@selector(willCloseAd:)]){
+ [_interstitialDelegate willCloseAd:info.completedView];
+ }
+ }
+ if (playing & RewardBasedAdapter){
+ playing &= ~RewardBasedAdapter;
+ if (_rewardDelegate && [_rewardDelegate respondsToSelector:@selector(willCloseAd:)]){
+ [_rewardDelegate willCloseAd:info.completedView];
+ }
+ }
+}
+
+- (void)vungleAdPlayabilityUpdate:(BOOL)isAdPlayable placementID:(nullable NSString *)placementID {
+ if (isAdPlayable) {
+ if (waiting & InterstitialAdapter) {
+ if (_interstitialDelegate && [_interstitialDelegate respondsToSelector:@selector(desiredPlacement)]){
+ NSString* desired = [_interstitialDelegate desiredPlacement];
+ if (!desired || [desired isEqualToString:placementID]) {
+ waiting &= ~InterstitialAdapter;
+ if ([_interstitialDelegate respondsToSelector:@selector(adAvailable)]) {
+ [_interstitialDelegate adAvailable];
+ }
+ }
+ } else {
+ waiting &= ~InterstitialAdapter;
+ }
+ }
+ if (waiting & RewardBasedAdapter) {
+ if (_rewardDelegate && [_rewardDelegate respondsToSelector:@selector(desiredPlacement)]){
+ NSString* desired = [_rewardDelegate desiredPlacement];
+ if (!desired || [desired isEqualToString:placementID]) {
+ waiting &= ~RewardBasedAdapter;
+ if ([_rewardDelegate respondsToSelector:@selector(adAvailable)]) {
+ [_rewardDelegate adAvailable];
+ }
+ }
+ } else {
+ waiting &= ~RewardBasedAdapter;
+ }
+ }
+ }
+}
+
+- (void)vungleSDKDidInitialize {
+ [self initialized:true error:nil];
+}
+
+@end

original_message: Adding adapter files - Vungle


message: Updated property name and warniung message based on feedback

change_type: MODIFY

diff:
@@ -36,7 +36,7 @@ static NSString *const kGADMAdapterVungleInterstitialKeyApplicationID = @"applic
NSError *error = [NSError errorWithDomain:@"google"
code:0
userInfo:@{
- NSLocalizedDescriptionKey : @"No ad fetched."
+ NSLocalizedDescriptionKey : @"Vungle doesn't support banner ads."
}];
[_connector adapter:self didFailAd:error];
}
@@ -52,8 +52,8 @@ static NSString *const kGADMAdapterVungleInterstitialKeyApplicationID = @"applic
- (void)getInterstitial {
VungleAdNetworkExtras* extras = [_connector networkExtras];
- desiredPlacement = extras.placement;
- if (!extras || !extras.placements || [extras.placements count] == 0) {
+ desiredPlacement = extras.playingPlacement;
+ if (!extras || !extras.allPlacements || [extras.allPlacements count] == 0) {
NSLog(@"Placements should be specified!");
[_connector adapter:self didFailAd:[NSError errorWithDomain:@"GADMAdapterVungleInterstitial" code:0 userInfo:@{NSLocalizedDescriptionKey: @"Placements should be specified!"}]];
return;
@@ -64,7 +64,7 @@ static NSString *const kGADMAdapterVungleInterstitialKeyApplicationID = @"applic
} else {
NSDictionary *serverParameters = [_connector credentials];
NSString *applicationID = [serverParameters objectForKey:kGADMAdapterVungleInterstitialKeyApplicationID];
- [[vungleHelper sharedInstance] initWithAppId:applicationID placements:extras.placements adapter:InterstitialAdapter];
+ [[vungleHelper sharedInstance] initWithAppId:applicationID placements:extras.allPlacements adapter:InterstitialAdapter];
}
}

diff:
@@ -36,7 +36,7 @@ static NSString *const kGADMAdapterVungleRewardBasedVideoAdKeyApplicationID = @"
NSDictionary *serverParameters = [_connector credentials];
NSString *applicationID = [serverParameters objectForKey:kGADMAdapterVungleRewardBasedVideoAdKeyApplicationID];
VungleAdNetworkExtras* extras = [_connector networkExtras];
- if (!extras || !extras.placements || [extras.placements count] == 0) {
+ if (!extras || !extras.allPlacements || [extras.allPlacements count] == 0) {
NSLog(@"Placements should be specified!");
[_connector adapter:self didFailToSetUpRewardBasedVideoAdWithError:[NSError errorWithDomain:@"GADMAdapterVungleRewardBasedVideoAd" code:0 userInfo:@{NSLocalizedDescriptionKey: @"Placements should be specified!"}]];
return;
@@ -45,13 +45,13 @@ static NSString *const kGADMAdapterVungleRewardBasedVideoAdKeyApplicationID = @"
if ([sdk isInitialised]) {
[_connector adapterDidSetUpRewardBasedVideoAd:self];
} else {
- [sdk initWithAppId:applicationID placements:extras.placements adapter:RewardBasedAdapter];
+ [sdk initWithAppId:applicationID placements:extras.allPlacements adapter:RewardBasedAdapter];
}
}
- (void)requestRewardBasedVideoAd {
vungleHelper* sdk = [vungleHelper sharedInstance];
- desiredPlacement = ((VungleAdNetworkExtras *)[_connector networkExtras]).placement;
+ desiredPlacement = ((VungleAdNetworkExtras *)[_connector networkExtras]).playingPlacement;
if ([sdk isAdPlayableFor:desiredPlacement]) {
[_connector adapterDidReceiveRewardBasedVideoAd:self];
} else {

diff:
@property (nonatomic, assign) BOOL muted;
-@property (nonatomic, copy) NSArray<NSString *> * _Nonnull placements;
+@property (nonatomic, copy) NSArray<NSString *> * _Nonnull allPlacements;
-@property (nonatomic, copy) NSString * _Nonnull placement;
+@property (nonatomic, copy) NSString * _Nonnull playingPlacement;
@end

license: Apache License 2.0


message: Updated as per of feedback - added a fix to support multiple interstitial instances

diff:
@@ -22,14 +22,14 @@ static NSString *const kGADMAdapterVungleInterstitialKeyApplicationID = @"applic
self = [super init];
if (self) {
self.connector = connector;
- [vungleHelper sharedInstance].interstitialDelegate = self;
+ [[vungleHelper sharedInstance] addDelegate:self];
}
return self;
}
- (void)dealloc {
- [vungleHelper sharedInstance].interstitialDelegate = nil;
+ [self stopBeingDelegate];
}
- (void)getBannerWithSize:(GADAdSize)adSize{
@@ -42,11 +42,7 @@ static NSString *const kGADMAdapterVungleInterstitialKeyApplicationID = @"applic
}
- (void) loadAd {
- if ([[vungleHelper sharedInstance] isAdPlayableFor:desiredPlacement]) {
- [_connector adapterDidReceiveInterstitial:self];
- } else {
- [[vungleHelper sharedInstance] loadAd:InterstitialAdapter placement:desiredPlacement];
- }
+ [[vungleHelper sharedInstance] loadAd:desiredPlacement];
}
@@ -58,19 +54,15 @@ static NSString *const kGADMAdapterVungleInterstitialKeyApplicationID = @"applic
[_connector adapter:self didFailAd:[NSError errorWithDomain:@"GADMAdapterVungleInterstitial" code:0 userInfo:@{NSLocalizedDescriptionKey: @"Placements should be specified!"}]];
return;
}
-
- if ([[vungleHelper sharedInstance] isInitialised]) {
- [self loadAd];
- } else {
+ waitingInit = YES;
NSDictionary *serverParameters = [_connector credentials];
NSString *applicationID = [serverParameters objectForKey:kGADMAdapterVungleInterstitialKeyApplicationID];
- [[vungleHelper sharedInstance] initWithAppId:applicationID placements:extras.allPlacements adapter:InterstitialAdapter];
- }
+ [[vungleHelper sharedInstance] initWithAppId:applicationID placements:extras.allPlacements];
}
- (void)stopBeingDelegate {
_connector = nil;
- [vungleHelper sharedInstance].interstitialDelegate = nil;
+ [[vungleHelper sharedInstance] removeDelegate:self];
}
- (BOOL)isBannerAnimationOK:(GADMBannerAnimationType)animType{
@@ -78,7 +70,7 @@ static NSString *const kGADMAdapterVungleInterstitialKeyApplicationID = @"applic
}
- (void)presentInterstitialFromRootViewController:(UIViewController *)rootViewController {
- if (![[vungleHelper sharedInstance] playAd:rootViewController adapter:InterstitialAdapter placement:desiredPlacement extras:[_connector networkExtras]]) {
+ if (![[vungleHelper sharedInstance] playAd:rootViewController delegate:self extras:[_connector networkExtras]]) {
[_connector adapterDidDismissInterstitial:self];
}
}
@@ -88,8 +80,11 @@ static NSString *const kGADMAdapterVungleInterstitialKeyApplicationID = @"applic
@synthesize desiredPlacement;
+@synthesize waitingInit;
+
-(void)initialized:(BOOL)isSuccess error:(NSError *)error {
- if (isSuccess) {
+ waitingInit = NO;
+ if (isSuccess && desiredPlacement) {
if (desiredPlacement) {
[self loadAd];
}
@@ -113,6 +108,7 @@ static NSString *const kGADMAdapterVungleInterstitialKeyApplicationID = @"applic
-(void)willCloseAd:(bool)completedView{
[_connector adapterWillDismissInterstitial:self];
[_connector adapterDidDismissInterstitial:self];
+ desiredPlacement = nil;
}
@end

diff:
@@ -23,13 +23,13 @@ static NSString *const kGADMAdapterVungleRewardBasedVideoAdKeyApplicationID = @"
self = [super init];
if (self) {
self.connector = connector;
- [vungleHelper sharedInstance].rewardDelegate = self;
+ [[vungleHelper sharedInstance] addDelegate:self];
}
return self;
}
- (void)dealloc {
- [vungleHelper sharedInstance].rewardDelegate = nil;
+ [self stopBeingDelegate];
}
- (void)setUp {
@@ -41,40 +41,34 @@ static NSString *const kGADMAdapterVungleRewardBasedVideoAdKeyApplicationID = @"
[_connector adapter:self didFailToSetUpRewardBasedVideoAdWithError:[NSError errorWithDomain:@"GADMAdapterVungleRewardBasedVideoAd" code:0 userInfo:@{NSLocalizedDescriptionKey: @"Placements should be specified!"}]];
return;
}
- vungleHelper* sdk = [vungleHelper sharedInstance];
- if ([sdk isInitialised]) {
- [_connector adapterDidSetUpRewardBasedVideoAd:self];
- } else {
- [sdk initWithAppId:applicationID placements:extras.allPlacements adapter:RewardBasedAdapter];
- }
+ waitingInit = YES;
+ [[vungleHelper sharedInstance] initWithAppId:applicationID placements:extras.allPlacements];
}
- (void)requestRewardBasedVideoAd {
- vungleHelper* sdk = [vungleHelper sharedInstance];
desiredPlacement = ((VungleAdNetworkExtras *)[_connector networkExtras]).playingPlacement;
- if ([sdk isAdPlayableFor:desiredPlacement]) {
- [_connector adapterDidReceiveRewardBasedVideoAd:self];
- } else {
- [sdk loadAd:RewardBasedAdapter placement:desiredPlacement];
- }
+ [[vungleHelper sharedInstance] loadAd:desiredPlacement];
}
- (void)presentRewardBasedVideoAdWithRootViewController:(UIViewController *)viewController {
- if (![[vungleHelper sharedInstance] playAd:viewController adapter:RewardBasedAdapter placement:desiredPlacement extras:[_connector networkExtras]]) {
+ if (![[vungleHelper sharedInstance] playAd:viewController delegate:self extras:[_connector networkExtras]]) {
[_connector adapterDidCloseRewardBasedVideoAd:self];
}
}
- (void)stopBeingDelegate {
_connector = nil;
- [vungleHelper sharedInstance].rewardDelegate = nil;
+ [[vungleHelper sharedInstance] removeDelegate:self];
}
#pragma mark - vungleHelper delegates
@synthesize desiredPlacement;
+@synthesize waitingInit;
+
-(void)initialized:(BOOL)isSuccess error:(NSError *)error{
+ waitingInit = NO;
if (isSuccess){
[_connector adapterDidSetUpRewardBasedVideoAd:self];
} else {
@@ -101,6 +95,7 @@ static NSString *const kGADMAdapterVungleRewardBasedVideoAdKeyApplicationID = @"
[_connector adapter:self didRewardUserWithReward:reward];
}
[_connector adapterDidCloseRewardBasedVideoAd:self];
+ desiredPlacement = nil;
}
@end

diff:
#import "VungleAdNetworkExtras.h"
-typedef enum {
- InterstitialAdapter = 1 << 1,
- RewardBasedAdapter = 1 << 2
-} Adapter;
-
@protocol VungleDelegate <NSObject>
-(void)initialized:(BOOL)isSuccess error:(NSError *)error;
-(void)adAvailable;
-(void)willShowAd;
-(void)willLeaveApplication;
-(void)willCloseAd:(bool)completedView;
-@property (strong) NSString * desiredPlacement;
+@property (readonly, strong) NSString * desiredPlacement;
+@property (readonly, assign) BOOL waitingInit;
@end
@interface vungleHelper : NSObject<VungleSDKDelegate>
-@property (strong) id<VungleDelegate> interstitialDelegate;
-@property (strong) id<VungleDelegate> rewardDelegate;
@property (readonly) BOOL isInitialising;
-@property (readonly) BOOL isInitialised;
+ (NSString *)adapterVersion;
+ (vungleHelper*) sharedInstance;
--(void)initWithAppId:(NSString *)appId placements:(NSArray<NSString *>*)placements adapter:(Adapter)adapter;
--(BOOL)isAdPlayableFor:(NSString *)placement;
--(BOOL)playAd:(UIViewController *)viewController adapter:(Adapter)adapter placement:(NSString *)placement extras:(VungleAdNetworkExtras *)extras;
--(void)loadAd:(Adapter)adapter placement:(NSString *)placement;
+-(void)initWithAppId:(NSString *)appId placements:(NSArray<NSString *>*)placements;
+-(BOOL)playAd:(UIViewController *)viewController delegate:(id<VungleDelegate>)delegate extras:(VungleAdNetworkExtras *)extras;
+-(void)loadAd:(NSString *)placement;
+-(void)addDelegate:(id<VungleDelegate>)delegate;
+-(void)removeDelegate:(id<VungleDelegate>)delegate;
@end

diff:
#import "vungleHelper.h"
+@interface vungleHelper()
+@property (strong) NSMutableArray<id<VungleDelegate>> * delegates;
+@property (strong) id<VungleDelegate> playingDelegate;
+@end
+
@implementation vungleHelper
-static Adapter initializing = 0;
-static Adapter waiting = 0;
-static Adapter playing = 0;
+ (NSString *)adapterVersion {
- return @"2.0.0";
+ return @"5.1.0";
}
+ (vungleHelper*) sharedInstance{
@@ -23,11 +25,12 @@ static Adapter playing = 0;
self = [super init];
if (self){
[VungleSDK sharedSDK].delegate = self;
+ _delegates = [NSMutableArray array];
}
return self;
}
--(void)initWithAppId:(NSString *)appId placements:(NSArray<NSString *>*)placements adapter:(Adapter)adapter{
+-(void)initWithAppId:(NSString *)appId placements:(NSArray<NSString *>*)placements{
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
NSString *version = [[vungleHelper adapterVersion] stringByReplacingOccurrencesOfString:@"." withString:@"_"];
@@ -38,10 +41,9 @@ static Adapter playing = 0;
});
VungleSDK* sdk = [VungleSDK sharedSDK];
if ([sdk isInitialized]) {
- _isInitialised = true;
+ [self initialized:true error:nil];
return;
}
- initializing |= adapter;
if ([self isInitialising]) {
return;
}
@@ -55,111 +57,86 @@ static Adapter playing = 0;
}
}
--(BOOL)isAdPlayableFor:(NSString *)placement{
- return [[VungleSDK sharedSDK] isAdCachedForPlacementID:placement];
+-(void)addDelegate:(id<VungleDelegate>)delegate {
+ if (delegate && ![_delegates containsObject:delegate]) {
+ [_delegates addObject:delegate];
+ }
+}
+
+-(void)removeDelegate:(id<VungleDelegate>)delegate {
+ if (delegate && [_delegates containsObject:delegate]) {
+ [_delegates removeObject:delegate];
+ }
+}
+
+-(void)notifyAdIsReady:(NSString *)placement {
+ for (id<VungleDelegate> item in _delegates) {
+ if ([placement isEqualToString:item.desiredPlacement]) {
+ [item adAvailable];
+ }
+ }
}
--(void)loadAd:(Adapter)adapter placement:(NSString *)placement {
- waiting |= adapter;
+-(void)loadAd:(NSString *)placement {
+ if (placement) {
VungleSDK* sdk = [VungleSDK sharedSDK];
if ([sdk isAdCachedForPlacementID:placement]) {
- [self vungleAdPlayabilityUpdate:true placementID:placement];
+ [self notifyAdIsReady:placement];
return;
}
[sdk loadPlacementWithID:placement error:nil];
}
+}
-- (BOOL)playAd:(UIViewController *)viewController adapter:(Adapter)adapter placement:(NSString *)placement extras:(VungleAdNetworkExtras *)extras {
- if (![[VungleSDK sharedSDK] isAdCachedForPlacementID:placement]) {
+- (BOOL)playAd:(UIViewController *)viewController delegate:(id<VungleDelegate>)delegate extras:(VungleAdNetworkExtras *)extras {
+ if (!delegate || !delegate.desiredPlacement || ![[VungleSDK sharedSDK] isAdCachedForPlacementID:delegate.desiredPlacement]) {
return false;
}
NSMutableDictionary *options = [[NSMutableDictionary alloc] init];
NSError *error = nil;
bool startPlaying = true;
[VungleSDK sharedSDK].muted = extras.muted;
- playing |= adapter;
- if (![[VungleSDK sharedSDK] playAd:viewController options:options placementID:placement error:&error]){
- playing &= ~adapter;
+ if (extras.userId)
+ [options setObject:extras.userId forKey:VunglePlayAdOptionKeyUser];
+ if (![[VungleSDK sharedSDK] playAd:viewController options:options placementID:delegate.desiredPlacement error:&error]){
startPlaying = false;
}
if (error) {
NSLog(@"Adapter failed to present reward based video ad, error %@", [error localizedDescription]);
- playing &= ~adapter;
startPlaying = false;
};
+ if (startPlaying) {
+ _playingDelegate = delegate;
+ }
return startPlaying;
}
-(void)initialized:(BOOL)isSuccess error:(NSError *)error {
_isInitialising = false;
- if (isSuccess) {
- _isInitialised = true;
+ for (id<VungleDelegate> item in _delegates) {
+ if ([item waitingInit]) {
+ [item initialized:isSuccess error:error];
}
- if ((initializing & InterstitialAdapter) && _interstitialDelegate && [_interstitialDelegate respondsToSelector:@selector(initialized:error:)]) {
- initializing &= ~InterstitialAdapter;
- [_interstitialDelegate initialized:isSuccess error:error];
- }
-
- if ((initializing & RewardBasedAdapter) && _rewardDelegate && [_rewardDelegate respondsToSelector:@selector(initialized:error:)]) {
- initializing &= ~RewardBasedAdapter;
- [_rewardDelegate initialized:isSuccess error:error];
}
}
#pragma mark - VungleSDKDelegate methods
- (void)vungleWillShowAdForPlacementID:(nullable NSString *)placementID {
- if ((playing & InterstitialAdapter) && _interstitialDelegate && [_interstitialDelegate respondsToSelector:@selector(willShowAd)]){
- [_interstitialDelegate willShowAd];
- }
- if ((playing & RewardBasedAdapter) && _rewardDelegate && [_rewardDelegate respondsToSelector:@selector(willShowAd)]){
- [_rewardDelegate willShowAd];
+ if (_playingDelegate) {
+ [_playingDelegate willShowAd];
}
}
- (void)vungleWillCloseAdWithViewInfo:(nonnull VungleViewInfo *)info placementID:(nonnull NSString *)placementID {
- if (playing & InterstitialAdapter){
- playing &= ~InterstitialAdapter;
- if (_interstitialDelegate && [_interstitialDelegate respondsToSelector:@selector(willCloseAd:)]){
- [_interstitialDelegate willCloseAd:info.completedView];
- }
- }
- if (playing & RewardBasedAdapter){
- playing &= ~RewardBasedAdapter;
- if (_rewardDelegate && [_rewardDelegate respondsToSelector:@selector(willCloseAd:)]){
- [_rewardDelegate willCloseAd:info.completedView];
- }
+ if (_playingDelegate) {
+ [_playingDelegate willCloseAd:info.completedView];
}
}
- (void)vungleAdPlayabilityUpdate:(BOOL)isAdPlayable placementID:(nullable NSString *)placementID {
if (isAdPlayable) {
- if (waiting & InterstitialAdapter) {
- if (_interstitialDelegate && [_interstitialDelegate respondsToSelector:@selector(desiredPlacement)]){
- NSString* desired = [_interstitialDelegate desiredPlacement];
- if (!desired || [desired isEqualToString:placementID]) {
- waiting &= ~InterstitialAdapter;
- if ([_interstitialDelegate respondsToSelector:@selector(adAvailable)]) {
- [_interstitialDelegate adAvailable];
- }
- }
- } else {
- waiting &= ~InterstitialAdapter;
- }
- }
- if (waiting & RewardBasedAdapter) {
- if (_rewardDelegate && [_rewardDelegate respondsToSelector:@selector(desiredPlacement)]){
- NSString* desired = [_rewardDelegate desiredPlacement];
- if (!desired || [desired isEqualToString:placementID]) {
- waiting &= ~RewardBasedAdapter;
- if ([_rewardDelegate respondsToSelector:@selector(adAvailable)]) {
- [_rewardDelegate adAvailable];
- }
- }
- } else {
- waiting &= ~RewardBasedAdapter;
- }
- }
+ [self notifyAdIsReady:placementID];
}
}


message: Updated to support AdMob Dashboard change - certification process phase 2

diff:
#import "GADMAdapterVungleInterstitial.h"
#import "vungleHelper.h"
-static NSString *const kGADMAdapterVungleInterstitialKeyApplicationID = @"application_id";
-
@interface GADMAdapterVungleInterstitial () <VungleDelegate>
@property(nonatomic, weak) id<GADMAdNetworkConnector> connector;
@end
@@ -32,8 +30,7 @@ static NSString *const kGADMAdapterVungleInterstitialKeyApplicationID = @"applic
}
- (void)getBannerWithSize:(GADAdSize)adSize{
- NSError *error =
- [NSError errorWithDomain:@"google"
+ NSError *error = [NSError errorWithDomain:@"google"
code:0
userInfo:@{
NSLocalizedDescriptionKey : @"Vungle doesn't support banner ads."
@@ -46,24 +43,24 @@ static NSString *const kGADMAdapterVungleInterstitialKeyApplicationID = @"applic
}
- (void)getInterstitial {
- VungleAdNetworkExtras *extras = [_connector networkExtras];
- desiredPlacement = extras.playingPlacement;
- if (!extras || !extras.allPlacements || [extras.allPlacements count] == 0) {
- NSLog(@"Placements should be specified!");
- [_connector
- adapter:self
+ [vungleHelper parseServerParameters:[_connector credentials]
+ networkExtras:[_connector networkExtras]
+ result:^void(NSDictionary* error, NSString* appId, NSArray* placements) {
+ if (error) {
+ [_connector adapter:self
didFailAd:[NSError errorWithDomain:@"GADMAdapterVungleInterstitial"
code:0
- userInfo:@{
- NSLocalizedDescriptionKey : @"Placements should be specified!"
- }]];
+ userInfo:error]];
return;
}
+ desiredPlacement = [vungleHelper findPlacement:[_connector credentials] networkExtras:[_connector networkExtras]];
+ if (!desiredPlacement) {
+ desiredPlacement = [placements firstObject];
+ NSLog(@"'placementID' not specified. Used first from 'allPlacements': %@", desiredPlacement);
+ }
waitingInit = YES;
- NSDictionary *serverParameters = [_connector credentials];
- NSString *applicationID =
- [serverParameters objectForKey:kGADMAdapterVungleInterstitialKeyApplicationID];
- [[vungleHelper sharedInstance] initWithAppId:applicationID placements:extras.allPlacements];
+ [[vungleHelper sharedInstance] initWithAppId:appId placements:placements];
+ }];
}
- (void)stopBeingDelegate {

diff:
#import "vungleHelper.h"
#import "VungleAdNetworkExtras.h"
-static NSString *const kGADMAdapterVungleRewardBasedVideoAdKeyApplicationID = @"application_id";
-
@interface GADMAdapterVungleRewardBasedVideoAd () <VungleDelegate>
@property(nonatomic, weak) id<GADMRewardBasedVideoAdNetworkConnector> connector;
@end
@@ -34,27 +32,26 @@ static NSString *const kGADMAdapterVungleRewardBasedVideoAdKeyApplicationID = @"
}
- (void)setUp {
- NSDictionary *serverParameters = [_connector credentials];
- NSString *applicationID =
- [serverParameters objectForKey:kGADMAdapterVungleRewardBasedVideoAdKeyApplicationID];
- VungleAdNetworkExtras *extras = [_connector networkExtras];
- if (!extras || !extras.allPlacements || [extras.allPlacements count] == 0) {
- NSLog(@"Placements should be specified!");
- [_connector adapter:self
- didFailToSetUpRewardBasedVideoAdWithError:
- [NSError errorWithDomain:@"GADMAdapterVungleRewardBasedVideoAd"
+ [vungleHelper parseServerParameters:[_connector credentials]
+ networkExtras:[_connector networkExtras]
+ result:^void(NSDictionary* error, NSString* appId, NSArray* placements) {
+ if (error) {
+ [_connector adapter:self didFailToSetUpRewardBasedVideoAdWithError:[NSError errorWithDomain:@"GADMAdapterVungleRewardBasedVideoAd"
code:0
- userInfo:@{
- NSLocalizedDescriptionKey : @"Placements should be specified!"
- }]];
+ userInfo:error]];
return;
}
waitingInit = YES;
- [[vungleHelper sharedInstance] initWithAppId:applicationID placements:extras.allPlacements];
+ [[vungleHelper sharedInstance] initWithAppId:appId placements:placements];
+ }];
}
- (void)requestRewardBasedVideoAd {
- desiredPlacement = ((VungleAdNetworkExtras *)[_connector networkExtras]).playingPlacement;
+ desiredPlacement = [vungleHelper findPlacement:[_connector credentials] networkExtras:[_connector networkExtras]];
+ if (!desiredPlacement) {
+ desiredPlacement = [[vungleHelper sharedInstance].allPlacements firstObject];
+ NSLog(@"'placementID' not specified. Used first one from 'allPlacements': %@", desiredPlacement);
+ }
[[vungleHelper sharedInstance] loadAd:desiredPlacement];
}
@@ -101,8 +98,7 @@ static NSString *const kGADMAdapterVungleRewardBasedVideoAdKeyApplicationID = @"
-(void)willCloseAd:(bool)completedView{
if (completedView){
- GADAdReward *reward =
- [[GADAdReward alloc] initWithRewardType:@"vungle"
+ GADAdReward* reward = [[GADAdReward alloc] initWithRewardType:@"vungle"
rewardAmount:[NSDecimalNumber decimalNumberWithString:@"1"]];
[_connector adapter:self didRewardUserWithReward:reward];
}

diff:
@interface vungleHelper : NSObject<VungleSDKDelegate>
@property(readonly) BOOL isInitialising;
+@property(readonly, strong) NSArray *allPlacements;
+typedef void(^ParameterCB)(NSDictionary*, NSString*, NSArray<NSString*>*);
+ (NSString *)adapterVersion;
+ (vungleHelper *)sharedInstance;
++ (void)parseServerParameters:(NSDictionary*)serverParameters networkExtras:(VungleAdNetworkExtras*)networkExtras result:(ParameterCB)result;
++ (NSString*)findPlacement:(NSDictionary*)serverParameters networkExtras:(VungleAdNetworkExtras*)networkExtras;
- (void)initWithAppId:(NSString *)appId placements:(NSArray<NSString *>*)placements;
-- (BOOL)playAd:(UIViewController *)viewController
- delegate:(id<VungleDelegate>)delegate
- extras:(VungleAdNetworkExtras *)extras;
+- (BOOL)playAd:(UIViewController *)viewController delegate:(id<VungleDelegate>)delegate extras:(VungleAdNetworkExtras *)extras;
- (void)loadAd:(NSString *)placement;
- (void)addDelegate:(id<VungleDelegate>)delegate;
- (void)removeDelegate:(id<VungleDelegate>)delegate;

diff:
#import "vungleHelper.h"
+static NSString *const kApplicationID = @"application_id";
+static NSString *const kPlacementID = @"placementID";
+static NSString *const placementsDelimiter = @",";
+
@interface vungleHelper()
@property (strong) NSMutableArray<id<VungleDelegate>> * delegates;
@property (strong) id<VungleDelegate> playingDelegate;
@implementation vungleHelper
+
+ (NSString *)adapterVersion {
return @"5.1.0";
}
-(void)initWithAppId:(NSString *)appId placements:(NSArray<NSString *>*)placements{
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
- NSString *version =
- [[vungleHelper adapterVersion] stringByReplacingOccurrencesOfString:@"." withString:@"_"];
+ NSString *version = [[vungleHelper adapterVersion] stringByReplacingOccurrencesOfString:@"." withString:@"_"];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wundeclared-selector"
[[VungleSDK sharedSDK] performSelector:@selector(setPluginName:version:)
_isInitialising = true;
NSError* err = nil;
+ _allPlacements = placements;
[sdk startWithAppId:appId placements:placements error:&err];
if (err) {
[self initialized:false error:err];
}
}
++(void)parseServerParameters:(NSDictionary*)serverParameters networkExtras:(VungleAdNetworkExtras*)networkExtras result:(ParameterCB)result {
+ NSMutableArray* allPlacements = [NSMutableArray array];
+ if (networkExtras && networkExtras.allPlacements && [networkExtras.allPlacements count] > 0) {
+ [allPlacements addObjectsFromArray:networkExtras.allPlacements];
+ }
+
+ if (!serverParameters || ![serverParameters objectForKey:kApplicationID]) {
+ NSLog(@"Vungle app ID should be specified!");
+ result(@{NSLocalizedDescriptionKey: @"Vungle app ID should be specified!"}, nil, nil);
+ return;
+ }
+ NSString* appId = [serverParameters objectForKey:kApplicationID];
+ if ([appId containsString:placementsDelimiter]){
+ NSMutableArray* parts = [[appId componentsSeparatedByString:placementsDelimiter] mutableCopy];
+ appId = [parts objectAtIndex:0];
+ [parts removeObjectAtIndex:0];
+ if (allPlacements.count > 0) {
+ NSLog(@"'allPlacements' had a value in both serverParameters and networkExtras. Used combined value");
+ }
+ for(NSString* placement in parts) {
+ if (placement.length > 0 && ![allPlacements containsObject:placement]) {
+ [allPlacements addObject:placement];
+ }
+ }
+ }
+
+ if (allPlacements.count == 0) {
+ NSLog(@"At least one placement should be specified!");
+ result(@{NSLocalizedDescriptionKey: @"At least one placement should be specified!"}, nil, nil);
+ return;
+ }
+ result(nil, appId, allPlacements);
+}
+
++(NSString*)findPlacement:(NSDictionary*)serverParameters networkExtras:(VungleAdNetworkExtras*)networkExtras {
+ NSString* ret = nil;
+ if (serverParameters && [serverParameters objectForKey:kPlacementID]) {
+ ret = [serverParameters objectForKey:kPlacementID];
+ }
+ if (networkExtras && networkExtras.playingPlacement) {
+ if (ret)
+ NSLog(@"'placementID' had a value in both serverParameters and networkExtras. Used one from serverParameters");
+ else
+ ret = networkExtras.playingPlacement;
+ }
+
+ return ret;
+}
+
-(void)addDelegate:(id<VungleDelegate>)delegate {
if (delegate && ![_delegates containsObject:delegate]) {
[_delegates addObject:delegate];
}
}
-- (BOOL)playAd:(UIViewController *)viewController
- delegate:(id<VungleDelegate>)delegate
- extras:(VungleAdNetworkExtras *)extras {
- if (!delegate || !delegate.desiredPlacement ||
- ![[VungleSDK sharedSDK] isAdCachedForPlacementID:delegate.desiredPlacement]) {
+- (BOOL)playAd:(UIViewController *)viewController delegate:(id<VungleDelegate>)delegate extras:(VungleAdNetworkExtras *)extras {
+ if (!delegate || !delegate.desiredPlacement || ![[VungleSDK sharedSDK] isAdCachedForPlacementID:delegate.desiredPlacement]) {
return false;
}
NSMutableDictionary *options = [[NSMutableDictionary alloc] init];
NSError *error = nil;
bool startPlaying = true;
[VungleSDK sharedSDK].muted = extras.muted;
- if (extras.userId) [options setObject:extras.userId forKey:VunglePlayAdOptionKeyUser];
+ if (extras.userId)
+ [options setObject:extras.userId forKey:VunglePlayAdOptionKeyUser];
if (![[VungleSDK sharedSDK] playAd:viewController
options:options
placementID:delegate.desiredPlacement
startPlaying = false;
}
if (error) {
- NSLog(@"Adapter failed to present reward based video ad, error %@",
- [error localizedDescription]);
+ NSLog(@"Adapter failed to present reward based video ad, error %@", [error localizedDescription]);
startPlaying = false;
};
if (startPlaying) {
}
}
-- (void)vungleWillCloseAdWithViewInfo:(nonnull VungleViewInfo *)info
- placementID:(nonnull NSString *)placementID {
+- (void)vungleWillCloseAdWithViewInfo:(nonnull VungleViewInfo *)info placementID:(nonnull NSString *)placementID {
if (_playingDelegate) {
[_playingDelegate willCloseAd:info.completedView];
}


message: Removed function to obtain "all placement IDs" from AppID field

diff:
#import "vungleHelper.h"
+static NSString *const vungleAdapterVersion = @"5.1.0";
+
static NSString *const kApplicationID = @"application_id";
static NSString *const kPlacementID = @"placementID";
-static NSString *const placementsDelimiter = @",";
@interface vungleHelper()
@property (strong) NSMutableArray<id<VungleDelegate>> * delegates;
@@ -13,7 +14,7 @@ static NSString *const placementsDelimiter = @",";
+ (NSString *)adapterVersion {
- return @"5.1.0";
+ return vungleAdapterVersion;
}
+ (vungleHelper*) sharedInstance{
@@ -76,25 +77,13 @@ static NSString *const placementsDelimiter = @",";
return;
}
NSString* appId = [serverParameters objectForKey:kApplicationID];
- if ([appId containsString:placementsDelimiter]){
- NSMutableArray* parts = [[appId componentsSeparatedByString:placementsDelimiter] mutableCopy];
- appId = [parts objectAtIndex:0];
- [parts removeObjectAtIndex:0];
- if (allPlacements.count > 0) {
- NSLog(@"'allPlacements' had a value in both serverParameters and networkExtras. Used combined value");
- }
- for(NSString* placement in parts) {
- if (placement.length > 0 && ![allPlacements containsObject:placement]) {
- [allPlacements addObject:placement];
- }
- }
- }
if (allPlacements.count == 0) {
NSLog(@"At least one placement should be specified!");
result(@{NSLocalizedDescriptionKey: @"At least one placement should be specified!"}, nil, nil);
return;
}
+
result(nil, appId, allPlacements);
}
@@ -104,11 +93,12 @@ static NSString *const placementsDelimiter = @",";
ret = [serverParameters objectForKey:kPlacementID];
}
if (networkExtras && networkExtras.playingPlacement) {
- if (ret)
+ if (ret) {
NSLog(@"'placementID' had a value in both serverParameters and networkExtras. Used one from serverParameters");
- else
+ } else {
ret = networkExtras.playingPlacement;
}
+ }
return ret;
}


message: Compatible with Vungle SDK version 5.3.2

diff:
[_connector adapterWillLeaveApplication:self];
}
--(void)willCloseAd:(bool)completedView{
+- (void)willCloseAd:(BOOL)completedView {
[_connector adapterWillDismissInterstitial:self];
[_connector adapterDidDismissInterstitial:self];
desiredPlacement = nil;

diff:
[_connector adapterWillLeaveApplication:self];
}
--(void)willCloseAd:(bool)completedView{
+- (void)willCloseAd:(BOOL)completedView {
if (completedView){
GADAdReward* reward = [[GADAdReward alloc] initWithRewardType:@"vungle"
rewardAmount:[NSDecimalNumber decimalNumberWithString:@"1"]];

diff:
*/
@property (nonatomic, assign) BOOL muted;
+@property (nonatomic, assign) NSUInteger ordinal;
+
+@property (nonatomic, assign) NSTimeInterval flexViewAutoDismissSeconds;
@property (nonatomic, copy) NSArray<NSString *> * _Nonnull allPlacements;

diff:
- (void)adAvailable;
- (void)willShowAd;
- (void)willLeaveApplication;
-- (void)willCloseAd:(bool)completedView;
+- (void)willCloseAd:(BOOL)completedView;
@property(readonly, strong) NSString *desiredPlacement;
@property(readonly, assign) BOOL waitingInit;
@end

diff:
#import "vungleHelper.h"
-static NSString *const vungleAdapterVersion = @"5.3.0";
+static NSString *const vungleAdapterVersion = @"5.3.2";
static NSString *const kApplicationID = @"application_id";
static NSString *const kPlacementID = @"placementID";
@@ -144,6 +144,10 @@ static NSString *const kPlacementID = @"placementID";
[VungleSDK sharedSDK].muted = extras.muted;
if (extras.userId)
[options setObject:extras.userId forKey:VunglePlayAdOptionKeyUser];
+ if (extras.ordinal)
+ [options setObject:@(extras.ordinal) forKey:VunglePlayAdOptionKeyOrdinal];
+ if (extras.flexViewAutoDismissSeconds)
+ [options setObject:@(extras.flexViewAutoDismissSeconds) forKey:VunglePlayAdOptionKeyFlexViewAutoDismissSeconds];
if (![[VungleSDK sharedSDK] playAd:viewController
options:options
placementID:delegate.desiredPlacement
@@ -179,7 +183,7 @@ static NSString *const kPlacementID = @"placementID";
- (void)vungleWillCloseAdWithViewInfo:(nonnull VungleViewInfo *)info placementID:(nonnull NSString *)placementID {
if (_playingDelegate) {
- [_playingDelegate willCloseAd:info.completedView];
+ [_playingDelegate willCloseAd:[info.completedView boolValue]];
}
}


message: Removed duplicate logs

diff:
# Vungle Adapter for Google Mobile Ads SDK for iOS Changelog
+## VERSION 5.3.2.0
+- Verified compatibility with Vungle SDK 5.3.2.
+
## VERSION 5.3.0.0
- Updated the deployment target to iOS 8.
- Verified compatibility with Vungle SDK 5.3.0.
## VERSION 5.1.0.0
- Verified compatibility with Vungle SDK 5.1.0.
-
-## Changelog
-## VERSION 5.1.0.0
-- Compatibility with Vungle SDK 5.1.0
-
-
## Earlier versions
- Added support for interstitial and rewarded video ad formats.

original_message: Removed duplicate logs


message: Compatible to iOS SDK 5.4.0

diff:
-#import "GADMAdapterVungleInterstitial.h"
#import <GoogleMobileAds/Mediation/GADMAdNetworkConnectorProtocol.h>
+#import "GADMAdapterVungleInterstitial.h"
#import "vungleHelper.h"
@interface GADMAdapterVungleInterstitial () <VungleDelegate>
}
- (void)getBannerWithSize:(GADAdSize)adSize{
- NSError *error = [NSError
- errorWithDomain:@"google"
+ NSError *error = [NSError errorWithDomain:@"google"
code:0
- userInfo:@{NSLocalizedDescriptionKey : @"Vungle doesn't support banner ads."}];
+ userInfo:@{
+ NSLocalizedDescriptionKey : @"Vungle doesn't support banner ads."
+ }];
[_connector adapter:self didFailAd:error];
}
}
- (void)getInterstitial {
- [vungleHelper
- parseServerParameters:[_connector credentials]
+ [vungleHelper parseServerParameters:[_connector credentials]
networkExtras:[_connector networkExtras]
result:^void(NSDictionary* error, NSString* appId, NSArray* placements) {
if (error) {
- [_connector
- adapter:self
+ [_connector adapter:self
didFailAd:[NSError errorWithDomain:@"GADMAdapterVungleInterstitial"
code:0
userInfo:error]];
return;
}
- desiredPlacement = [vungleHelper findPlacement:[_connector credentials]
- networkExtras:[_connector networkExtras]];
+ desiredPlacement = [vungleHelper findPlacement:[_connector credentials] networkExtras:[_connector networkExtras]];
if (!desiredPlacement) {
desiredPlacement = [placements firstObject];
- NSLog(@"'placementID' not specified. Used first from 'allPlacements': %@",
- desiredPlacement);
+ NSLog(@"'placementID' not specified. Used first from 'allPlacements': %@", desiredPlacement);
}
waitingInit = YES;
[[vungleHelper sharedInstance] initWithAppId:appId placements:placements];

diff:
#import <GoogleMobileAds/Mediation/GADMRewardBasedVideoAdNetworkAdapterProtocol.h>
-@interface GADMAdapterVungleRewardBasedVideoAd
- : NSObject<GADMRewardBasedVideoAdNetworkAdapter>
+@interface GADMAdapterVungleRewardBasedVideoAd : NSObject<GADMRewardBasedVideoAdNetworkAdapter>
@end

diff:
-#import "GADMAdapterVungleRewardBasedVideoAd.h"
#import <GoogleMobileAds/Mediation/GADMRewardBasedVideoAdNetworkConnectorProtocol.h>
-#import "VungleAdNetworkExtras.h"
+#import "GADMAdapterVungleRewardBasedVideoAd.h"
#import "vungleHelper.h"
+#import "VungleAdNetworkExtras.h"
@interface GADMAdapterVungleRewardBasedVideoAd () <VungleDelegate>
@property(nonatomic, weak) id<GADMRewardBasedVideoAdNetworkConnector> connector;
}
- (void)setUp {
- [vungleHelper
- parseServerParameters:[_connector credentials]
+ [vungleHelper parseServerParameters:[_connector credentials]
networkExtras:[_connector networkExtras]
result:^void(NSDictionary* error, NSString* appId, NSArray* placements) {
if (error) {
- [_connector adapter:self
- didFailToSetUpRewardBasedVideoAdWithError:
- [NSError errorWithDomain:@"GADMAdapterVungleRewardBasedVideoAd"
+ [_connector adapter:self didFailToSetUpRewardBasedVideoAdWithError:[NSError errorWithDomain:@"GADMAdapterVungleRewardBasedVideoAd"
code:0
userInfo:error]];
return;
}
- (void)requestRewardBasedVideoAd {
- desiredPlacement = [vungleHelper findPlacement:[_connector credentials]
- networkExtras:[_connector networkExtras]];
+ desiredPlacement = [vungleHelper findPlacement:[_connector credentials] networkExtras:[_connector networkExtras]];
if (!desiredPlacement) {
desiredPlacement = [[vungleHelper sharedInstance].allPlacements firstObject];
- NSLog(@"'placementID' not specified. Used first one from 'allPlacements': %@",
- desiredPlacement);
+ NSLog(@"'placementID' not specified. Used first one from 'allPlacements': %@", desiredPlacement);
}
[[vungleHelper sharedInstance] loadAd:desiredPlacement];
}
- (void)willCloseAd:(BOOL)completedView {
if (completedView){
- GADAdReward* reward =
- [[GADAdReward alloc] initWithRewardType:@"vungle"
+ GADAdReward* reward = [[GADAdReward alloc] initWithRewardType:@"vungle"
rewardAmount:[NSDecimalNumber decimalNumberWithString:@"1"]];
[_connector adapter:self didRewardUserWithReward:reward];
}

diff:
@@ -22,15 +22,10 @@ typedef void (^ParameterCB)(NSDictionary *, NSString *, NSArray<NSString *> *);
+ (vungleHelper *)sharedInstance;
-+ (void)parseServerParameters:(NSDictionary *)serverParameters
- networkExtras:(VungleAdNetworkExtras *)networkExtras
- result:(ParameterCB)result;
-+ (NSString *)findPlacement:(NSDictionary *)serverParameters
- networkExtras:(VungleAdNetworkExtras *)networkExtras;
++ (void)parseServerParameters:(NSDictionary*)serverParameters networkExtras:(VungleAdNetworkExtras*)networkExtras result:(ParameterCB)result;
++ (NSString*)findPlacement:(NSDictionary*)serverParameters networkExtras:(VungleAdNetworkExtras*)networkExtras;
- (void)initWithAppId:(NSString *)appId placements:(NSArray<NSString *>*)placements;
-- (BOOL)playAd:(UIViewController *)viewController
- delegate:(id<VungleDelegate>)delegate
- extras:(VungleAdNetworkExtras *)extras;
+- (BOOL)playAd:(UIViewController *)viewController delegate:(id<VungleDelegate>)delegate extras:(VungleAdNetworkExtras *)extras;
- (void)loadAd:(NSString *)placement;
- (void)addDelegate:(id<VungleDelegate>)delegate;
- (void)removeDelegate:(id<VungleDelegate>)delegate;

diff:
#import "vungleHelper.h"
-static NSString *const vungleAdapterVersion = @"5.3.2";
+static NSString *const vungleAdapterVersion = @"5.4.0";
static NSString *const kApplicationID = @"application_id";
static NSString *const kPlacementID = @"placementID";
@@ -12,6 +12,7 @@ static NSString *const kPlacementID = @"placementID";
@implementation vungleHelper
+
+ (NSString *)adapterVersion {
return vungleAdapterVersion;
}
@@ -37,8 +38,7 @@ static NSString *const kPlacementID = @"placementID";
-(void)initWithAppId:(NSString *)appId placements:(NSArray<NSString *>*)placements{
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
- NSString *version =
- [[vungleHelper adapterVersion] stringByReplacingOccurrencesOfString:@"." withString:@"_"];
+ NSString *version = [[vungleHelper adapterVersion] stringByReplacingOccurrencesOfString:@"." withString:@"_"];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wundeclared-selector"
[[VungleSDK sharedSDK] performSelector:@selector(setPluginName:version:)
@@ -65,9 +65,7 @@ static NSString *const kPlacementID = @"placementID";
}
}
-+ (void)parseServerParameters:(NSDictionary *)serverParameters
- networkExtras:(VungleAdNetworkExtras *)networkExtras
- result:(ParameterCB)result {
++(void)parseServerParameters:(NSDictionary*)serverParameters networkExtras:(VungleAdNetworkExtras*)networkExtras result:(ParameterCB)result {
NSMutableArray* allPlacements = [NSMutableArray array];
if (networkExtras && networkExtras.allPlacements && [networkExtras.allPlacements count] > 0) {
[allPlacements addObjectsFromArray:networkExtras.allPlacements];
@@ -89,17 +87,14 @@ static NSString *const kPlacementID = @"placementID";
result(nil, appId, allPlacements);
}
-+ (NSString *)findPlacement:(NSDictionary *)serverParameters
- networkExtras:(VungleAdNetworkExtras *)networkExtras {
++(NSString*)findPlacement:(NSDictionary*)serverParameters networkExtras:(VungleAdNetworkExtras*)networkExtras {
NSString* ret = nil;
if (serverParameters && [serverParameters objectForKey:kPlacementID]) {
ret = [serverParameters objectForKey:kPlacementID];
}
if (networkExtras && networkExtras.playingPlacement) {
if (ret) {
- NSLog(
- @"'placementID' had a value in both serverParameters and networkExtras. Used one from "
- @"serverParameters");
+ NSLog(@"'placementID' had a value in both serverParameters and networkExtras. Used one from serverParameters");
} else {
ret = networkExtras.playingPlacement;
}
@@ -139,22 +134,20 @@ static NSString *const kPlacementID = @"placementID";
}
}
-- (BOOL)playAd:(UIViewController *)viewController
- delegate:(id<VungleDelegate>)delegate
- extras:(VungleAdNetworkExtras *)extras {
- if (!delegate || !delegate.desiredPlacement ||
- ![[VungleSDK sharedSDK] isAdCachedForPlacementID:delegate.desiredPlacement]) {
+- (BOOL)playAd:(UIViewController *)viewController delegate:(id<VungleDelegate>)delegate extras:(VungleAdNetworkExtras *)extras {
+ if (!delegate || !delegate.desiredPlacement || ![[VungleSDK sharedSDK] isAdCachedForPlacementID:delegate.desiredPlacement]) {
return false;
}
NSMutableDictionary *options = [[NSMutableDictionary alloc] init];
NSError *error = nil;
bool startPlaying = true;
[VungleSDK sharedSDK].muted = extras.muted;
- if (extras.userId) [options setObject:extras.userId forKey:VunglePlayAdOptionKeyUser];
- if (extras.ordinal) [options setObject:@(extras.ordinal) forKey:VunglePlayAdOptionKeyOrdinal];
+ if (extras.userId)
+ [options setObject:extras.userId forKey:VunglePlayAdOptionKeyUser];
+ if (extras.ordinal)
+ [options setObject:@(extras.ordinal) forKey:VunglePlayAdOptionKeyOrdinal];
if (extras.flexViewAutoDismissSeconds)
- [options setObject:@(extras.flexViewAutoDismissSeconds)
- forKey:VunglePlayAdOptionKeyFlexViewAutoDismissSeconds];
+ [options setObject:@(extras.flexViewAutoDismissSeconds) forKey:VunglePlayAdOptionKeyFlexViewAutoDismissSeconds];
if (![[VungleSDK sharedSDK] playAd:viewController
options:options
placementID:delegate.desiredPlacement
@@ -162,8 +155,7 @@ static NSString *const kPlacementID = @"placementID";
startPlaying = false;
}
if (error) {
- NSLog(@"Adapter failed to present reward based video ad, error %@",
- [error localizedDescription]);
+ NSLog(@"Adapter failed to present reward based video ad, error %@", [error localizedDescription]);
startPlaying = false;
};
if (startPlaying) {
@@ -189,16 +181,18 @@ static NSString *const kPlacementID = @"placementID";
}
}
-- (void)vungleWillCloseAdWithViewInfo:(nonnull VungleViewInfo *)info
- placementID:(nonnull NSString *)placementID {
+- (void)vungleWillCloseAdWithViewInfo:(nonnull VungleViewInfo *)info placementID:(nonnull NSString *)placementID {
if (_playingDelegate) {
[_playingDelegate willCloseAd:[info.completedView boolValue]];
}
}
-- (void)vungleAdPlayabilityUpdate:(BOOL)isAdPlayable placementID:(nullable NSString *)placementID {
+- (void)vungleAdPlayabilityUpdate:(BOOL)isAdPlayable placementID:(NSString *)placementID error:(NSError *)error {
if (isAdPlayable) {
[self notifyAdIsReady:placementID];
+ } else if (error) {
+ // do we want to do anything with the error here?
+ NSLog(@"Vungle Ad Playability returned an error: %@", error.localizedDescription);
}
}

original_message: Compatible to iOS SDK 5.4.0


message: Compatible with iOS SDK 6.2.0

diff:
#import <Foundation/Foundation.h>
-@import GoogleMobileAds;
+#import <GoogleMobileAds/GADAdNetworkExtras.h>
+
+typedef NS_ENUM(NSInteger, VungleExtrasConsentStatus) {
+ VungleExtrasConsentAccepted = 1,
+ VungleExtrasConsentDenied
+};
@interface VungleAdNetworkExtras : NSObject<GADAdNetworkExtras>
*/
@property(nonatomic, assign) BOOL muted;
-@property(nonatomic, copy) NSArray<NSString *> *_Nonnull allPlacements;
-
-@property(nonatomic, copy) NSString *_Nonnull playingPlacement;
-
@property(nonatomic, assign) NSUInteger ordinal;
@property(nonatomic, assign) NSTimeInterval flexViewAutoDismissSeconds;
+@property(nonatomic, copy) NSArray<NSString *> *_Nullable allPlacements;
+
+@property(nonatomic, copy) NSString *_Nullable playingPlacement;
+
+@property(nonatomic, assign) VungleExtrasConsentStatus consentStatus;
+
@end

diff:
#import <Foundation/Foundation.h>
-@import GoogleMobileAds;
+#import <GoogleMobileAds/Mediation/GADMAdNetworkAdapterProtocol.h>
@interface GADMAdapterVungleInterstitial : NSObject<GADMAdNetworkAdapter>
@end

diff:
}
- (void)getBannerWithSize:(GADAdSize)adSize {
- NSError *error =
- [NSError errorWithDomain:@"google"
+ NSError *error = [NSError
+ errorWithDomain:@"google"
code:0
- userInfo:@{
- NSLocalizedDescriptionKey : @"Vungle doesn't support banner ads."
- }];
+ userInfo:@{NSLocalizedDescriptionKey : @"Vungle doesn't support banner ads."}];
[_connector adapter:self didFailAd:error];
}
[vungleHelper
parseServerParameters:[_connector credentials]
networkExtras:[_connector networkExtras]
- result:^void(NSDictionary *error, NSString *appId, NSArray *placements) {
+ result:^void(NSDictionary *error, NSString *appId) {
if (error) {
[_connector
adapter:self
desiredPlacement = [vungleHelper findPlacement:[_connector credentials]
networkExtras:[_connector networkExtras]];
if (!desiredPlacement) {
- desiredPlacement = [placements firstObject];
- NSLog(@"'placementID' not specified. Used first from 'allPlacements': %@",
- desiredPlacement);
+ [_connector
+ adapter:self
+ didFailAd:[NSError errorWithDomain:@"GADMAdapterVungleInterstitial"
+ code:0
+ userInfo:@{
+ NSLocalizedDescriptionKey :
+ @"'placementID' not specified"
+ }]];
+ return;
}
+ [vungleHelper updateConsentStatus:[_connector networkExtras]];
waitingInit = YES;
- [[vungleHelper sharedInstance] initWithAppId:appId placements:placements];
+ [[vungleHelper sharedInstance] initWithAppId:appId];
}];
}
[_connector adapterWillPresentInterstitial:self];
}
-- (void)willLeaveApplication {
- [_connector adapterWillLeaveApplication:self];
-}
-
-- (void)willCloseAd:(BOOL)completedView didClickDownload:(BOOL)didClickDownload {
- if (didClickDownload) {
- // Only the donload button is clickable for Vungle ads, so the didClickDownload flag can be used
- // to track clicks.
+- (void)willCloseAd:(BOOL)completedView didDownload:(BOOL)didDownload {
+ if (didDownload) {
[_connector adapterDidGetAdClick:self];
+ [_connector adapterWillLeaveApplication:self];
}
[_connector adapterWillDismissInterstitial:self];
+}
+
+- (void)didCloseAd:(BOOL)completedView didDownload:(BOOL)didDownload {
[_connector adapterDidDismissInterstitial:self];
desiredPlacement = nil;
}

diff:
#import <Foundation/Foundation.h>
-@import GoogleMobileAds;
+#import <GoogleMobileAds/Mediation/GADMRewardBasedVideoAdNetworkAdapterProtocol.h>
-@interface GADMAdapterVungleRewardBasedVideoAd
- : NSObject<GADMRewardBasedVideoAdNetworkAdapter>
+@interface GADMAdapterVungleRewardBasedVideoAd : NSObject<GADMRewardBasedVideoAdNetworkAdapter>
@end

diff:
[vungleHelper
parseServerParameters:[_connector credentials]
networkExtras:[_connector networkExtras]
- result:^void(NSDictionary* error, NSString* appId, NSArray* placements) {
+ result:^void(NSDictionary *error, NSString *appId) {
if (error) {
[_connector adapter:self
didFailToSetUpRewardBasedVideoAdWithError:
userInfo:error]];
return;
}
+ [vungleHelper updateConsentStatus:[_connector networkExtras]];
waitingInit = YES;
- [[vungleHelper sharedInstance] initWithAppId:appId placements:placements];
+ [[vungleHelper sharedInstance] initWithAppId:appId];
}];
}
desiredPlacement = [vungleHelper findPlacement:[_connector credentials]
networkExtras:[_connector networkExtras]];
if (!desiredPlacement) {
- desiredPlacement = [[vungleHelper sharedInstance].allPlacements firstObject];
- NSLog(@"'placementID' not specified. Used first one from 'allPlacements': %@",
- desiredPlacement);
+ [_connector adapter:self
+ didFailToLoadRewardBasedVideoAdwithError:
+ [NSError
+ errorWithDomain:@"GADMAdapterVungleRewardBasedVideoAd"
+ code:0
+ userInfo:@{NSLocalizedDescriptionKey : @"'placementID' not specified"}]];
+ return;
}
[[vungleHelper sharedInstance] loadAd:desiredPlacement];
}
[_connector adapterDidStartPlayingRewardBasedVideoAd:self];
}
-- (void)willLeaveApplication {
- [_connector adapterWillLeaveApplication:self];
+- (void)willCloseAd:(BOOL)completedView didDownload:(BOOL)didDownload {
+ // not used
}
-- (void)willCloseAd:(BOOL)completedView didClickDownload:(BOOL)didClickDownload {
- if (didClickDownload) {
- // Only the download button is clickable for Vungle ads, so the didClickDownload flag can be used
- // to track clicks.
- [_connector adapterDidGetAdClick:self];
- }
+- (void)didCloseAd:(BOOL)completedView didDownload:(BOOL)didDownload {
if (completedView) {
GADAdReward *reward =
[[GADAdReward alloc] initWithRewardType:@"vungle"
rewardAmount:[NSDecimalNumber decimalNumberWithString:@"1"]];
[_connector adapter:self didRewardUserWithReward:reward];
}
+ if (didDownload) {
+ [_connector adapterDidGetAdClick:self];
+ [_connector adapterWillLeaveApplication:self];
+ }
[_connector adapterDidCloseRewardBasedVideoAd:self];
desiredPlacement = nil;
}

diff:
- (void)initialized:(BOOL)isSuccess error:(NSError *)error;
- (void)adAvailable;
- (void)willShowAd;
-- (void)willLeaveApplication;
-- (void)willCloseAd:(BOOL)completedView didClickDownload:(BOOL)didClickDownload;
+- (void)willCloseAd:(BOOL)completedView didDownload:(BOOL)didDownload;
+- (void)didCloseAd:(BOOL)completedView didDownload:(BOOL)didDownload;
@property(readonly, strong) NSString *desiredPlacement;
@property(readonly, assign) BOOL waitingInit;
@end
@interface vungleHelper : NSObject<VungleSDKDelegate>
@property(readonly) BOOL isInitialising;
-@property(readonly, strong) NSArray *allPlacements;
-typedef void (^ParameterCB)(NSDictionary *, NSString *, NSArray<NSString *> *);
+typedef void (^ParameterCB)(NSDictionary *error, NSString *appId);
+ (NSString *)adapterVersion;
@@ -27,7 +26,8 @@ typedef void (^ParameterCB)(NSDictionary *, NSString *, NSArray<NSString *> *);
result:(ParameterCB)result;
+ (NSString *)findPlacement:(NSDictionary *)serverParameters
networkExtras:(VungleAdNetworkExtras *)networkExtras;
-- (void)initWithAppId:(NSString *)appId placements:(NSArray<NSString *> *)placements;
++ (void)updateConsentStatus:(VungleAdNetworkExtras *)networkExtras;
+- (void)initWithAppId:(NSString *)appId;
- (BOOL)playAd:(UIViewController *)viewController
delegate:(id<VungleDelegate>)delegate
extras:(VungleAdNetworkExtras *)extras;

diff:
@@ -34,7 +34,7 @@ static NSString *const kPlacementID = @"placementID";
return self;
}
-- (void)initWithAppId:(NSString *)appId placements:(NSArray<NSString *> *)placements {
+- (void)initWithAppId:(NSString *)appId {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
NSString *version =
@@ -58,7 +58,6 @@ static NSString *const kPlacementID = @"placementID";
_isInitialising = true;
NSError *err = nil;
- _allPlacements = placements;
[sdk startWithAppId:appId error:&err];
if (err) {
[self initialized:false error:err];
@@ -68,29 +67,22 @@ static NSString *const kPlacementID = @"placementID";
+ (void)parseServerParameters:(NSDictionary *)serverParameters
networkExtras:(VungleAdNetworkExtras *)networkExtras
result:(ParameterCB)result {
- NSMutableArray *allPlacements = [NSMutableArray array];
- if (networkExtras && networkExtras.allPlacements && [networkExtras.allPlacements count] > 0) {
- [allPlacements addObjectsFromArray:networkExtras.allPlacements];
- }
-
- if (!serverParameters || ![serverParameters objectForKey:kApplicationID]) {
- NSLog(@"Vungle app ID should be specified!");
- result(@{ NSLocalizedDescriptionKey : @"Vungle app ID should be specified!" }, nil, nil);
- return;
- }
- NSString *appId = [serverParameters objectForKey:kApplicationID];
-
- if (allPlacements.count == 0) {
- NSLog(@"At least one placement should be specified!");
- result(
- @{
- NSLocalizedDescriptionKey : @"At least one placement should be specified!"
- },
- nil, nil);
+ if ([networkExtras.allPlacements count] > 0) {
+ NSLog(
+ @"No need to pass placement IDs through `VungleAdNetworkExtras` with Vungle iOS SDK "
+ @"version %@ and plugin version %@",
+ VungleSDKVersion, vungleAdapterVersion);
+ }
+
+ NSString *appId = serverParameters[kApplicationID];
+ if (!appId) {
+ NSString *const message = @"Vungle app ID should be specified!";
+ NSLog(message);
+ result(@{NSLocalizedDescriptionKey : message}, nil);
return;
}
- result(nil, appId, allPlacements);
+ result(nil, appId);
}
+ (NSString *)findPlacement:(NSDictionary *)serverParameters
@@ -101,7 +93,8 @@ static NSString *const kPlacementID = @"placementID";
}
if (networkExtras && networkExtras.playingPlacement) {
if (ret) {
- NSLog(@"'placementID' had a value in both serverParameters and networkExtras. Used one from "
+ NSLog(
+ @"'placementID' had a value in both serverParameters and networkExtras. Used one from "
@"serverParameters");
} else {
ret = networkExtras.playingPlacement;
@@ -111,6 +104,13 @@ static NSString *const kPlacementID = @"placementID";
return ret;
}
++ (void)updateConsentStatus:(VungleAdNetworkExtras *)networkExtras {
+ if (networkExtras.consentStatus == VungleExtrasConsentAccepted)
+ [[VungleSDK sharedSDK] updateConsentStatus:VungleConsentAccepted];
+ else if (networkExtras.consentStatus == VungleExtrasConsentDenied)
+ [[VungleSDK sharedSDK] updateConsentStatus:VungleConsentDenied];
+}
+
- (void)addDelegate:(id<VungleDelegate>)delegate {
if (delegate && ![_delegates containsObject:delegate]) {
[_delegates addObject:delegate];
@@ -196,13 +196,25 @@ static NSString *const kPlacementID = @"placementID";
placementID:(nonnull NSString *)placementID {
if (_playingDelegate) {
[_playingDelegate willCloseAd:[info.completedView boolValue]
- didClickDownload:[info.didDownload boolValue]];
+ didDownload:[info.didDownload boolValue]];
+ }
+}
+
+- (void)vungleDidCloseAdWithViewInfo:(VungleViewInfo *)info placementID:(NSString *)placementID {
+ if (_playingDelegate) {
+ [_playingDelegate didCloseAd:[info.completedView boolValue]
+ didDownload:[info.didDownload boolValue]];
}
}
-- (void)vungleAdPlayabilityUpdate:(BOOL)isAdPlayable placementID:(nullable NSString *)placementID {
+- (void)vungleAdPlayabilityUpdate:(BOOL)isAdPlayable
+ placementID:(NSString *)placementID
+ error:(NSError *)error {
if (isAdPlayable) {
[self notifyAdIsReady:placementID];
+ } else if (error) {
+ // do we want to do anything with the error here?
+ NSLog(@"Vungle Ad Playability returned an error: %@", error.localizedDescription);
}
}

original_message: Compatible with iOS SDK 6.2.0


message: Removed GDPR implementation

diff:
#import <GoogleMobileAds/GADAdNetworkExtras.h>
-typedef NS_ENUM(NSInteger, VungleExtrasConsentStatus) {
- VungleExtrasConsentAccepted = 1,
- VungleExtrasConsentDenied
-};
-
@interface VungleAdNetworkExtras : NSObject<GADAdNetworkExtras>
/*!
@@ -34,6 +29,4 @@ typedef NS_ENUM(NSInteger, VungleExtrasConsentStatus) {
@property(nonatomic, copy) NSString *_Nullable playingPlacement;
-@property(nonatomic, assign) VungleExtrasConsentStatus consentStatus;
-
@end

diff:
}]];
return;
}
- [vungleHelper updateConsentStatus:[_connector networkExtras]];
waitingInit = YES;
[[vungleHelper sharedInstance] initWithAppId:appId];
}];

diff:
userInfo:error]];
return;
}
- [vungleHelper updateConsentStatus:[_connector networkExtras]];
waitingInit = YES;
[[vungleHelper sharedInstance] initWithAppId:appId];
}];

diff:
@@ -26,7 +26,6 @@ typedef void (^ParameterCB)(NSDictionary *error, NSString *appId);
result:(ParameterCB)result;
+ (NSString *)findPlacement:(NSDictionary *)serverParameters
networkExtras:(VungleAdNetworkExtras *)networkExtras;
-+ (void)updateConsentStatus:(VungleAdNetworkExtras *)networkExtras;
- (void)initWithAppId:(NSString *)appId;
- (BOOL)playAd:(UIViewController *)viewController
delegate:(id<VungleDelegate>)delegate

diff:
@@ -104,13 +104,6 @@ static NSString *const kPlacementID = @"placementID";
return ret;
}
-+ (void)updateConsentStatus:(VungleAdNetworkExtras *)networkExtras {
- if (networkExtras.consentStatus == VungleExtrasConsentAccepted)
- [[VungleSDK sharedSDK] updateConsentStatus:VungleConsentAccepted];
- else if (networkExtras.consentStatus == VungleExtrasConsentDenied)
- [[VungleSDK sharedSDK] updateConsentStatus:VungleConsentDenied];
-}
-
- (void)addDelegate:(id<VungleDelegate>)delegate {
if (delegate && ![_delegates containsObject:delegate]) {
[_delegates addObject:delegate];

original_message: Removed GDPR implementation


message: Update Facebook adapters for 5.5.1

diff:
## Facebook iOS Mediation Adapter Changelog
+#### Version 5.5.1.0
+- Verified compatibility with FAN SDK 5.5.1.
+
#### Version 5.5.0.0
- Verified compatibility with FAN SDK 5.5.0.
- Now requires Google Mobile Ads SDK version 7.46.0 or higher.

diff:
// limitations under the License.
/// Facebook mediation network adapter version.
-static NSString *const kGADMAdapterFacebookVersion = @"5.5.0.0";
+static NSString *const kGADMAdapterFacebookVersion = @"5.5.1.0";
static NSString *const kGADMAdapterFacebookOpenBiddingPubID = @"placement_id";

original_message: Update Facebook adapters for 5.5.1


message: Adapters for 5.6 FAN

diff:
## Facebook iOS Mediation Adapter Changelog
+#### Version 5.6.0.0
+- Verified compatibility with FAN SDK 5.6.0.
+
#### Version 5.5.1.1
- Adapter now returns a non-zero `mediaContent` aspect ratio once the media view is rendered in a view.
- Added additional logging for open bidding.

diff:
// limitations under the License.
/// Facebook mediation network adapter version.
-static NSString *const kGADMAdapterFacebookVersion = @"5.5.1.1";
+static NSString *const kGADMAdapterFacebookVersion = @"5.6.0.0";
static NSString *const kGADMAdapterFacebookOpenBiddingPubID = @"placement_id";

original_message: Adapters for 5.6 FAN


message:
Address Comments
Address Comments

diff:
@@ -58,30 +58,21 @@ NSString* _placementID;
return;
}
- NSError *error = nil;
- if (error) {
- [strongConnector adapter:strongAdapter didFailAd:error];
- return;
- }
-
- _placementID = [[[strongConnector credentials] objectForKey:kGADMAdapterUnityPlacementID] copy];
+ _placementID = [strongConnector.credentials[kGADMAdapterUnityPlacementID] copy];
if (!_placementID){
NSString *description = [NSString
- stringWithFormat:@"Tried to initialize %@ with nil placement.", NSStringFromClass([UADSBannerView class])];
+ stringWithFormat:@"Tried to initialize %@ with nil placement.", @"Unity banner"];
NSError *error = GADUnityErrorWithDescription(description);
[strongConnector adapter:strongAdapter didFailAd:error];
return;
}
- adSize.size.width = adSize.size.width < 320 ? 320 : adSize.size.width;
- adSize.size.height = adSize.size.height < 50 ? 50 : adSize.size.height;
-
_bannerAd = [[UADSBannerView alloc] initWithPlacementId:_placementID size:adSize.size];
if (!_bannerAd) {
NSString *description = [NSString
- stringWithFormat:@"%@ failed to initialize.", NSStringFromClass([UADSBannerView class])];
+ stringWithFormat:@"%@ failed to initialize.", @"Unity banner"];
NSError *error = GADUnityErrorWithDescription(description);
[strongConnector adapter:strongAdapter didFailAd:error];
return;
@@ -111,7 +102,7 @@ NSString* _placementID;
id<GADMAdNetworkConnector> strongConnector = _connector;
id<GADMAdNetworkAdapter> strongAdapter = _adapter;
if (strongAdapter && strongConnector) {
- [strongConnector adapterDidDismissFullScreenModal:strongAdapter];
+ [strongConnector adapterDidGetAdClick:strongAdapter];
}
}
@@ -129,11 +120,11 @@ NSString* _placementID;
id<GADMAdNetworkConnector> strongConnector = _connector;
id<GADMAdNetworkAdapter> strongAdapter = _adapter;
if (strongConnector && strongAdapter) {
+ NSString *errorMsg = @"Unity Ads banner failed to load - Error.";
if ( error.code == UADSBannerErrorCodeNoFillError) {
- [strongConnector adapter:strongAdapter didFailAd:GADUnityErrorWithDescription(@"Unity Ads banner failed to load - No Fill.")];
- } else {
- [strongConnector adapter:strongAdapter didFailAd:GADUnityErrorWithDescription(@"Unity Ads banner failed to load - Error.")];
+ errorMsg = @"Unity Ads banner failed to load - No Fill.";
}
+ [strongConnector adapter:strongAdapter didFailAd:GADUnityErrorWithDescription(errorMsg)];
}
}

original_message:
Address Comments

Address Comments


message:
remove string format
remove string format

diff:
@@ -61,8 +61,7 @@ NSString* _placementID;
_placementID = [strongConnector.credentials[kGADMAdapterUnityPlacementID] copy];
if (!_placementID){
- NSString *description = [NSString
- stringWithFormat:@"Tried to initialize %@ with nil placement.", @"Unity banner"];
+ NSString *description = @"Tried to initialize Unity banner with nil placement.";
NSError *error = GADUnityErrorWithDescription(description);
[strongConnector adapter:strongAdapter didFailAd:error];
return;
@@ -71,8 +70,7 @@ NSString* _placementID;
_bannerAd = [[UADSBannerView alloc] initWithPlacementId:_placementID size:adSize.size];
if (!_bannerAd) {
- NSString *description = [NSString
- stringWithFormat:@"%@ failed to initialize.", @"Unity banner"];
+ NSString *description = @"Unity banne failed to initialize.";
NSError *error = GADUnityErrorWithDescription(description);
[strongConnector adapter:strongAdapter didFailAd:error];
return;


message: Updated for 5.6.1

diff:
## Facebook iOS Mediation Adapter Changelog
+#### Version 5.6.1.0
+- Verified compatibility with FAN SDK 5.6.1.
+
#### Version 5.6.0.0
- Verified compatibility with FAN SDK 5.6.0.

diff:
// limitations under the License.
/// Facebook mediation network adapter version.
-static NSString *const kGADMAdapterFacebookVersion = @"5.6.0.0";
+static NSString *const kGADMAdapterFacebookVersion = @"5.6.1.0";
static NSString *const kGADMAdapterFacebookOpenBiddingPubID = @"placement_id";

original_message: Updated for 5.6.1