diff --git a/Adapters/Vungle/CHANGELOG.md b/Adapters/Vungle/CHANGELOG.md index 11bbeae..859802a 100644 --- a/Adapters/Vungle/CHANGELOG.md +++ b/Adapters/Vungle/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## Version 5.11.0 +* Supporting Adapter Logging 2 + ## Version 5.10.0 * Supporting SDK version 7.7.4 diff --git a/Adapters/Vungle/ISVungleAdapter/ISVungleAdapter.m b/Adapters/Vungle/ISVungleAdapter/ISVungleAdapter.m index 5f17570..5766bdd 100644 --- a/Adapters/Vungle/ISVungleAdapter/ISVungleAdapter.m +++ b/Adapters/Vungle/ISVungleAdapter/ISVungleAdapter.m @@ -62,21 +62,21 @@ - (instancetype)initAdapter:(NSString *)name { } // Rewarded video - _rewardedVideoPlacementIdToSmashDelegate = [ISConcurrentMutableDictionary dictionary]; - _rewardedVideoPlacementIdToVungleAdDelegate = [ISConcurrentMutableDictionary dictionary]; - _rewardedVideoPlacementIdToAd = [ISConcurrentMutableDictionary dictionary]; + _rewardedVideoPlacementIdToSmashDelegate = [ISConcurrentMutableDictionary lpmDictionary]; + _rewardedVideoPlacementIdToVungleAdDelegate = [ISConcurrentMutableDictionary lpmDictionary]; + _rewardedVideoPlacementIdToAd = [ISConcurrentMutableDictionary lpmDictionary]; _rewardedVideoPlacementIdsForInitCallbacks = [ISConcurrentMutableSet set]; // Interstitial - _interstitialPlacementIdToSmashDelegate = [ISConcurrentMutableDictionary dictionary]; - _interstitialPlacementIdToVungleAdDelegate = [ISConcurrentMutableDictionary dictionary]; - _interstitialPlacementIdToAd = [ISConcurrentMutableDictionary dictionary]; + _interstitialPlacementIdToSmashDelegate = [ISConcurrentMutableDictionary lpmDictionary]; + _interstitialPlacementIdToVungleAdDelegate = [ISConcurrentMutableDictionary lpmDictionary]; + _interstitialPlacementIdToAd = [ISConcurrentMutableDictionary lpmDictionary]; // Banner - _bannerPlacementIdToSmashDelegate = [ISConcurrentMutableDictionary dictionary]; - _bannerPlacementIdToVungleAdDelegate = [ISConcurrentMutableDictionary dictionary]; - _bannerPlacementIdToAd = [ISConcurrentMutableDictionary dictionary]; - _bannerPlacementIdToAdSize = [ISConcurrentMutableDictionary dictionary]; + _bannerPlacementIdToSmashDelegate = [ISConcurrentMutableDictionary lpmDictionary]; + _bannerPlacementIdToVungleAdDelegate = [ISConcurrentMutableDictionary lpmDictionary]; + _bannerPlacementIdToAd = [ISConcurrentMutableDictionary lpmDictionary]; + _bannerPlacementIdToAdSize = [ISConcurrentMutableDictionary lpmDictionary]; // The network's capability to load a Rewarded Video ad while another Rewarded Video ad of that network is showing LWSState = LOAD_WHILE_SHOW_BY_INSTANCE; @@ -233,7 +233,7 @@ - (void)initRewardedVideoForCallbacksWithUserId:(NSString *)userId if (![self isConfigValueValid:appId]) { NSError *error = [self errorForMissingCredentialFieldWithName:kAppId]; LogAdapterApi_Internal(@"error = %@", error.description); - + [VungleMediationLogger logErrorForAd:nil message:@"NoAppId:RewardedWithInit"]; [delegate adapterRewardedVideoInitFailed:error]; return; } @@ -241,7 +241,7 @@ - (void)initRewardedVideoForCallbacksWithUserId:(NSString *)userId if (![self isConfigValueValid:placementId]) { NSError *error = [self errorForMissingCredentialFieldWithName:kPlacementId]; LogAdapterApi_Internal(@"error = %@", error.description); - + [VungleMediationLogger logErrorForAd:nil message:@"NoPlacementId:RewardedWithInit"]; [delegate adapterRewardedVideoInitFailed:error]; return; } @@ -284,6 +284,7 @@ - (void)initAndLoadRewardedVideoWithUserId:(NSString *)userId if (![self isConfigValueValid:appId]) { NSError *error = [self errorForMissingCredentialFieldWithName:kAppId]; LogAdapterApi_Internal(@"error = %@", error.description); + [VungleMediationLogger logErrorForAd:nil message:@"NoAppId:Rewarded"]; [delegate adapterRewardedVideoHasChangedAvailability:NO]; return; } @@ -291,6 +292,7 @@ - (void)initAndLoadRewardedVideoWithUserId:(NSString *)userId if (![self isConfigValueValid:placementId]) { NSError *error = [self errorForMissingCredentialFieldWithName:kPlacementId]; LogAdapterApi_Internal(@"error = %@", error.description); + [VungleMediationLogger logErrorForAd:nil message:@"NoPlacementId:Rewarded"]; [delegate adapterRewardedVideoHasChangedAvailability:NO]; return; } @@ -370,17 +372,18 @@ - (void)showRewardedVideoWithViewController:(UIViewController *)viewController NSString *placementId = adapterConfig.settings[kPlacementId]; LogAdapterApi_Internal(@"placementId = %@", placementId); - + + VungleRewarded *rewardedVideoAd = [self.rewardedVideoPlacementIdToAd objectForKey:placementId]; + if (![self hasRewardedVideoWithAdapterConfig:adapterConfig]) { NSError *error = [ISError createError:ERROR_CODE_NO_ADS_TO_SHOW withMessage:[NSString stringWithFormat: @"%@ show failed", kAdapterName]]; LogAdapterApi_Internal(@"error = %@", error); + [VungleMediationLogger logErrorForAd:rewardedVideoAd message:@"NoAdsToShow:Rewarded"]; [delegate adapterRewardedVideoDidFailToShowWithError:error]; return; } - - VungleRewarded *rewardedVideoAd = [self.rewardedVideoPlacementIdToAd objectForKey:placementId]; - + //set dynamic user Id if ([self dynamicUserId]) { LogAdapterApi_Internal(@"set userID to %@", [self dynamicUserId]); @@ -426,6 +429,7 @@ - (void)initInterstitialWithUserId:(NSString *)userId if (![self isConfigValueValid:appId]) { NSError *error = [self errorForMissingCredentialFieldWithName:kAppId]; LogAdapterApi_Internal(@"error = %@", error.description); + [VungleMediationLogger logErrorForAd:nil message:@"NoAppId:Interstitial"]; [delegate adapterInterstitialInitFailedWithError:error]; return; } @@ -433,7 +437,7 @@ - (void)initInterstitialWithUserId:(NSString *)userId if (![self isConfigValueValid:placementId]) { NSError *error = [self errorForMissingCredentialFieldWithName:kPlacementId]; LogAdapterApi_Internal(@"error = %@", error.description); - + [VungleMediationLogger logErrorForAd:nil message:@"NoPlacementId:Interstitial"]; [delegate adapterInterstitialInitFailedWithError:error]; return; } @@ -517,16 +521,18 @@ - (void)showInterstitialWithViewController:(UIViewController *)viewController NSString *placementId = adapterConfig.settings[kPlacementId]; LogAdapterApi_Internal(@"placementId = %@", placementId); - + + VungleInterstitial *interstitialAd = [self.interstitialPlacementIdToAd objectForKey:placementId]; + if (![self hasInterstitialWithAdapterConfig:adapterConfig]) { NSError *error = [ISError createError:ERROR_CODE_NO_ADS_TO_SHOW withMessage:[NSString stringWithFormat: @"%@ show failed", kAdapterName]]; LogAdapterApi_Internal(@"error = %@", error); + [VungleMediationLogger logErrorForAd:interstitialAd message:@"NoAdsToShow:Interstitial"]; [delegate adapterInterstitialDidFailToShowWithError:error]; return; } - - VungleInterstitial *interstitialAd = [self.interstitialPlacementIdToAd objectForKey:placementId]; + dispatch_async(dispatch_get_main_queue(), ^{ [interstitialAd presentWith:viewController]; }); @@ -566,6 +572,7 @@ - (void)initBannerWithUserId:(NSString *)userId if (![self isConfigValueValid:appId]) { NSError *error = [self errorForMissingCredentialFieldWithName:kAppId]; LogAdapterApi_Internal(@"error = %@", error.description); + [VungleMediationLogger logErrorForAd:nil message:@"NoAppId:Banner"]; [delegate adapterBannerInitFailedWithError:error]; return; } @@ -573,6 +580,7 @@ - (void)initBannerWithUserId:(NSString *)userId if (![self isConfigValueValid:placementId]) { NSError *error = [self errorForMissingCredentialFieldWithName:kPlacementId]; LogAdapterApi_Internal(@"error = %@", error.description); + [VungleMediationLogger logErrorForAd:nil message:@"NoPlacementId:Banner"]; [delegate adapterBannerInitFailedWithError:error]; return; }