Skip to content

Commit

Permalink
Facebook/6.12.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins committed Feb 19, 2023
1 parent d213817 commit d2ff889
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 16 deletions.
5 changes: 3 additions & 2 deletions Facebook/AppLovinMediationFacebookAdapter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Pod::Spec.new do |s|

s.authors = 'AppLovin Corporation'
s.name = 'AppLovinMediationFacebookAdapter'
s.version = '6.12.0.1'
s.version = '6.12.0.2'
s.platform = :ios, '10.0'
s.summary = 'Facebook adapter used for mediation with the AppLovin MAX SDK'
s.homepage = "https://github.com/CocoaPods/Specs/search?o=desc&q=#{s.name}&s=indexed"
Expand Down Expand Up @@ -34,7 +34,8 @@ s.pod_target_xcconfig =
{
'VALID_ARCHS' => 'arm64 arm64e armv7 armv7s x86_64',
'VALID_ARCHS[sdk=iphoneos*]' => 'arm64 arm64e armv7 armv7s',
'VALID_ARCHS[sdk=iphonesimulator*]' => 'arm64 arm64e x86_64'
'VALID_ARCHS[sdk=iphonesimulator*]' => 'arm64 arm64e x86_64',
'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386'
}

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

## 6.12.0.2
* Add support for passing in a presenting view controller.

## 6.12.0.1
* Support for native ads in external plugins (e.g. React Native).
* Disable bitcode, as Apple deprecated it in Xcode 14 (https://developer.apple.com/documentation/xcode-release-notes/xcode-14-release-notes).
Expand Down
2 changes: 1 addition & 1 deletion Facebook/FacebookAdapter/ALFacebookMediationAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

#import <AppLovinSDK/AppLovinSDK.h>

@interface ALFacebookMediationAdapter : ALMediationAdapter<MAInterstitialAdapter, MARewardedAdapter, MARewardedInterstitialAdapter, MAAdViewAdapter, MANativeAdAdapter, MASignalProvider>
@interface ALFacebookMediationAdapter : ALMediationAdapter <MAInterstitialAdapter, MARewardedAdapter, MARewardedInterstitialAdapter, MAAdViewAdapter, MANativeAdAdapter, MASignalProvider>

@end
36 changes: 23 additions & 13 deletions Facebook/FacebookAdapter/ALFacebookMediationAdapter.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,29 @@
#import "ALFacebookMediationAdapter.h"
#import <FBAudienceNetwork/FBAudienceNetwork.h>

#define ADAPTER_VERSION @"6.12.0.1"
#define ADAPTER_VERSION @"6.12.0.2"
#define MEDIATION_IDENTIFIER [NSString stringWithFormat: @"APPLOVIN_%@:%@", [ALSdk version], self.adapterVersion]

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

@interface ALFacebookMediationAdapterRewardedVideoAdDelegate : NSObject<FBRewardedVideoAdDelegate>
@interface ALFacebookMediationAdapterRewardedVideoAdDelegate : NSObject <FBRewardedVideoAdDelegate>
@property (nonatomic, weak) ALFacebookMediationAdapter *parentAdapter;
@property (nonatomic, strong) id<MARewardedAdapterDelegate> delegate;
@property (nonatomic, assign, getter=hasGrantedReward) BOOL grantedReward;
- (instancetype)initWithParentAdapter:(ALFacebookMediationAdapter *)parentAdapter andNotify:(id<MARewardedAdapterDelegate>)delegate;
@end
@interface ALFacebookMediationAdapterRewardedInterAdDelegate : NSObject<FBRewardedVideoAdDelegate>
@interface ALFacebookMediationAdapterRewardedInterAdDelegate : NSObject <FBRewardedVideoAdDelegate>
@property (nonatomic, weak) ALFacebookMediationAdapter *parentAdapter;
@property (nonatomic, strong) id<MARewardedInterstitialAdapterDelegate> delegate;
@property (nonatomic, assign, getter=hasGrantedReward) BOOL grantedReward;
- (instancetype)initWithParentAdapter:(ALFacebookMediationAdapter *)parentAdapter andNotify:(id<MARewardedInterstitialAdapterDelegate>)delegate;
@end

@interface ALFacebookMediationAdapterAdViewDelegate : NSObject<FBAdViewDelegate>
@interface ALFacebookMediationAdapterAdViewDelegate : NSObject <FBAdViewDelegate>
@property (nonatomic, weak) MAAdFormat *format;
@property (nonatomic, weak) ALFacebookMediationAdapter *parentAdapter;
@property (nonatomic, strong) id<MAAdViewAdapterDelegate> delegate;
Expand All @@ -40,7 +40,7 @@ - (instancetype)initWithParentAdapter:(ALFacebookMediationAdapter *)parentAdapte
andNotify:(id<MAAdViewAdapterDelegate>)delegate;
@end

@interface ALFacebookMediationAdapterNativeAdViewAdDelegate : NSObject<FBNativeAdDelegate>
@interface ALFacebookMediationAdapterNativeAdViewAdDelegate : NSObject <FBNativeAdDelegate>
@property (nonatomic, weak) MAAdFormat *format;
@property (nonatomic, weak) ALFacebookMediationAdapter *parentAdapter;
@property (nonatomic, strong) id<MAAdViewAdapterDelegate> delegate;
Expand All @@ -51,7 +51,7 @@ - (instancetype)initWithParentAdapter:(ALFacebookMediationAdapter *)parentAdapte
andNotify:(id<MAAdViewAdapterDelegate>)delegate;
@end

@interface ALFacebookMediationAdapterNativeAdDelegate : NSObject<FBNativeAdDelegate>
@interface ALFacebookMediationAdapterNativeAdDelegate : NSObject <FBNativeAdDelegate>
@property (nonatomic, weak) ALFacebookMediationAdapter *parentAdapter;
@property (nonatomic, strong) id<MANativeAdAdapterDelegate> delegate;
@property (nonatomic, strong) NSDictionary<NSString *, id> *serverParameters;
Expand All @@ -60,7 +60,7 @@ - (instancetype)initWithParentAdapter:(ALFacebookMediationAdapter *)parentAdapte
andNotify:(id<MANativeAdAdapterDelegate>)delegate;
@end

@interface ALFacebookMediationAdapterNativeBannerAdDelegate : NSObject<FBNativeBannerAdDelegate>
@interface ALFacebookMediationAdapterNativeBannerAdDelegate : NSObject <FBNativeBannerAdDelegate>
@property (nonatomic, weak) ALFacebookMediationAdapter *parentAdapter;
@property (nonatomic, strong) id<MANativeAdAdapterDelegate> delegate;
@property (nonatomic, strong) NSDictionary<NSString *, id> *serverParameters;
Expand All @@ -75,7 +75,7 @@ - (instancetype)initWithParentAdapter:(ALFacebookMediationAdapter *)parentAdapte
- (instancetype)initWithFormat:(MAAdFormat *)format builderBlock:(NS_NOESCAPE MANativeAdBuilderBlock)builderBlock NS_UNAVAILABLE;
@end

@interface ALFacebookMediationAdapter()
@interface ALFacebookMediationAdapter ()

@property (nonatomic, strong) FBInterstitialAd *interstitialAd;
@property (nonatomic, strong) FBRewardedVideoAd *rewardedVideoAd;
Expand Down Expand Up @@ -112,7 +112,7 @@ + (void)initialize

#pragma mark - MAAdapter Methods

- (void)initializeWithParameters:(id<MAAdapterInitializationParameters>)parameters completionHandler:(void (^)(MAAdapterInitializationStatus, NSString * _Nullable))completionHandler
- (void)initializeWithParameters:(id<MAAdapterInitializationParameters>)parameters completionHandler:(void (^)(MAAdapterInitializationStatus, NSString *_Nullable))completionHandler
{
[self updateAdSettingsWithParameters: parameters];

Expand Down Expand Up @@ -337,7 +337,17 @@ - (void)showRewardedAdForParameters:(id<MAAdapterResponseParameters>)parameters
// Configure reward from server.
[self configureRewardForParameters: parameters];

[self.rewardedVideoAd showAdFromRootViewController: [ALUtils topViewControllerFromKeyWindow]];
UIViewController *presentingViewController;
if ( ALSdk.versionCode >= 11020199 )
{
presentingViewController = parameters.presentingViewController ?: [ALUtils topViewControllerFromKeyWindow];
}
else
{
presentingViewController = [ALUtils topViewControllerFromKeyWindow];
}

[self.rewardedVideoAd showAdFromRootViewController: presentingViewController];
}
else
{
Expand Down Expand Up @@ -860,7 +870,7 @@ - (UIViewController *)viewControllerForPresentingModalView
@implementation ALFacebookMediationAdapterNativeAdViewAdDelegate

- (instancetype)initWithParentAdapter:(ALFacebookMediationAdapter *)parentAdapter
serverParameters:(NSDictionary<NSString *,id> *)serverParameters
serverParameters:(NSDictionary<NSString *, id> *)serverParameters
format:(MAAdFormat *)format
andNotify:(id<MAAdViewAdapterDelegate>)delegate
{
Expand Down Expand Up @@ -1111,7 +1121,7 @@ - (void)nativeAdDidFinishHandlingClick:(FBNativeAd *)nativeAd
@implementation ALFacebookMediationAdapterNativeBannerAdDelegate

- (instancetype)initWithParentAdapter:(ALFacebookMediationAdapter *)parentAdapter
serverParameters:(NSDictionary<NSString *,id> *)serverParameters
serverParameters:(NSDictionary<NSString *, id> *)serverParameters
andNotify:(id<MANativeAdAdapterDelegate>)delegate
{
self = [super init];
Expand Down

0 comments on commit d2ff889

Please sign in to comment.