Address the comments about property
Address the comments about property
MODIFY
adapters/Unity/UnityAdapter/GADMAdapterUnity.m
adapters/Unity/UnityAdapter/GADMAdapterUnity.m
/// Unity Ads Banner wrapper
GADMAdapterUnityBannerAd *_bannerAd;
+
+ NSString *_uuid;
+
+ UADSMetaData *_metaData;
}
@end
self = [super init];
if (self) {
_networkConnector = connector;
+ _uuid = [[NSUUID UUID] UUIDString];
+
+ _metaData = [[UADSMetaData alloc] init];
+
+ [_metaData setCategory:@"mediation_adapter"];
+ [_metaData setValue:@"create-adapter" forKey:_uuid];
+ [_metaData commit];
}
return self;
}
[[GADMAdapterUnitySingleton sharedInstance] initializeWithGameID:_gameID
completeBlock:completeBlock];
+
+ [_metaData setCategory:@"mediation_adapter"];
+ [_metaData setValue:@"load-interstitial" forKey:_uuid];
+ [_metaData setValue:_placementID forKey:_uuid];
+ [_metaData commit];
}
- (void)presentInterstitialFromRootViewController:(UIViewController *)rootViewController {
[UnityAds show:rootViewController placementId:_placementID];
+
+ [_metaData setCategory:@"mediation_adapter"];
+ [_metaData setValue:@"show-interstitial" forKey:_uuid];
+ [_metaData setValue:_placementID forKey:_uuid];
+ [_metaData commit];
}
#pragma mark Banner Methods

MODIFY
adapters/Unity/UnityAdapter/GADMAdapterUnityRewardedAd.m
adapters/Unity/UnityAdapter/GADMAdapterUnityRewardedAd.m
#import "GADUnityError.h"
@interface GADMAdapterUnityRewardedAd () <GADMAdapterUnityDataProvider, UnityAdsExtendedDelegate> {
+ // The completion handler to call when the ad loading succeeds or fails.
+ GADMediationRewardedLoadCompletionHandler _adLoadCompletionHandler;
// Ad configuration for the ad to be rendered.
GADMediationAdConfiguration *_adConfiguration;
/// YES if the adapter is loading.
BOOL _isLoading;
+
+ NSString *_uuid;
+
+ UADSMetaData *_metaData;
}
-// The completion handler to call when the ad loading succeeds or fails.
-@property (nonatomic, copy)GADMediationRewardedLoadCompletionHandler adLoadCompletionHandler;
+
@end
@implementation GADMAdapterUnityRewardedAd
if (self) {
_adLoadCompletionHandler = completionHandler;
_adConfiguration = adConfiguration;
+
+ _uuid = [[NSUUID UUID] UUIDString];
+
+ _metaData = [[UADSMetaData alloc] init];
+
+ [_metaData setCategory:@"mediation_adapter"];
+ [_metaData setValue:@"create-adapter" forKey:_uuid];
+ [_metaData commit];
}
return self;
}
return;
}
GADMAdapterUnityRewardedAd *__weak weakSelf = self;
-
UnitySingletonCompletion completeBlock = ^(UnityAdsError *error, NSString *message) {
+ GADMAdapterUnityRewardedAd *strongSelf = weakSelf;
+ if (!strongSelf) {
+ return;
+ }
+
if (error) {
NSError *errorWithDescription = GADUnityErrorWithDescription(message);
- if(weakSelf) {
- weakSelf.adLoadCompletionHandler(nil, errorWithDescription);
- }
+ strongSelf->_adLoadCompletionHandler(nil, errorWithDescription);
return;
}
- [UnityAds addDelegate:self];
- [UnityAds load:[self getPlacementID]];
+ [UnityAds addDelegate:strongSelf];
+ [UnityAds load:[strongSelf getPlacementID]];
};
[[GADMAdapterUnitySingleton sharedInstance] initializeWithGameID:_gameID
completeBlock:completeBlock];
+ [_metaData setCategory:@"mediation_adapter"];
+ [_metaData setValue:@"load-rewarded" forKey:_uuid];
+ [_metaData setValue:_placementID forKey:_uuid];
+ [_metaData commit];
}
- (void)presentFromViewController:(nonnull UIViewController *)viewController {
[UnityAds show:viewController placementId:_placementID];
+
+ [_metaData setCategory:@"mediation_adapter"];
+ [_metaData setValue:@"show-rewarded" forKey:_uuid];
+ [_metaData setValue:_placementID forKey:_uuid];
+ [_metaData commit];
}
#pragma mark GADMAdapterUnityDataProvider Methods

Address the comments about property

Address the comments about property