Skip to content

Commit

Permalink
Updating Appodeal Adapter iOS to 3.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
scottrules44 committed Mar 27, 2023
1 parent 625e499 commit cd92fee
Show file tree
Hide file tree
Showing 18 changed files with 446 additions and 166 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// VungleMediaView.h
// Vungle iOS SDK
//
// Copyright © 2021 Vungle Inc. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

/**
* The VungleMediaView loads media content from a given VNGNativeAd.
* This view takes the place of manually loading a cover image.
*/
@interface VungleMediaView : UIView

/**
* Method that load an image from a local path.
* @param path A local path of the image.
*/
- (BOOL)loadImageFromLocalPath:(NSString *)path;

/**
* Method that load an image from a remote URL.
* @param urlPath A remote path of the image.
*/
- (BOOL)loadImageFromRemoteURL:(NSString *)urlPath;

/**
* Method that cleans up the currently displayed image.
*/
- (void)cleanupImage;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
//
// VungleNativeAd.h
// Vungle iOS SDK
//
// Copyright (c) 2013-Present Vungle Inc. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@protocol VungleNativeAdDelegate;
@class VungleMediaView;

typedef NS_ENUM (NSInteger, NativeAdOptionsPosition) {
NativeAdOptionsPositionTopLeft = 1,
NativeAdOptionsPositionTopRight,
NativeAdOptionsPositionBottomLeft,
NativeAdOptionsPositionBottomRight,
};

@interface VungleNativeAd : NSObject

/**
* The delegate to receive Native Ad callbacks (VungleNativeAdDelegate).
*/
@property (nonatomic, weak, nullable) id<VungleNativeAdDelegate> delegate;

/**
* The application name that the ad advertises.
*/
@property (nonatomic, copy, readonly) NSString *title;

/**
* The description of the application that the ad advertises.
*/
@property (nonatomic, copy, readonly) NSString *bodyText;

/**
* The call to action phrase of the ad.
*/
@property (nonatomic, copy, readonly) NSString *callToAction;

/**
* The rating for the application that the ad advertises.
*/
@property (nonatomic, assign, readonly) double adStarRating;

/**
* The sponsored text, normally "sponsored by".
*/
@property (nonatomic, copy, readonly) NSString *sponsoredText;

/**
* The app icon image of the ad.
*/
@property (nonatomic, strong, readonly, nullable) UIImage *iconImage;

/**
* The position for the ad choices icon. Default is TOP_RIGHT.
*/
@property (nonatomic, assign) NativeAdOptionsPosition adOptionsPosition;

/**
* Initialize a VungleNativeAd with the specified placement id.
* @param placementID the ID of the placement used to present the native ad
*/
- (instancetype)initWithPlacementID:(nonnull NSString *)placementID;

/**
* Prepare a native ad for the specified placement.
*/
- (void)loadAd;

/**
* Prepare a native ad for the specified placement.
* @param adMarkup includes the adunit data of the placement
*/
- (void)loadAdWithAdMarkup:(nullable NSString *)adMarkup;

/**
* Pass UIViews and UIViewController to prepare and display a Native ad.
* @param view a container view in which a native ad will be displayed. This view will be clickable.
* @param mediaView a VungleMediaView to display the ad's image or video
* @param iconImageView a UIImageView to display the app icon
* @param viewController a UIViewController to present SKStoreProductViewController
*/
- (void)registerViewForInteraction:(nonnull UIView *)view
mediaView:(nonnull VungleMediaView *)mediaView
iconImageView:(nullable UIImageView *)iconImageView
viewController:(nullable UIViewController *)viewController;

/**
* Pass UIViews and UIViewController to prepare and display a Native ad.
* Also, specify clickable area.
* @param view a container view in which a native ad will be displayed
* @param mediaView a VungleMediaView to display the ad's image or video
* @param iconImageView a UIImageView to display the app icon
* @param viewController a UIViewController to present SKStoreProductViewController
* @param clickableViews an array of UIViews that you would like to set clickable.
* If nil or empty, the view will be clickable.
*/
- (void)registerViewForInteraction:(nonnull UIView *)view
mediaView:(nonnull VungleMediaView *)mediaView
iconImageView:(nullable UIImageView *)iconImageView
viewController:(nullable UIViewController *)viewController
clickableViews:(nullable NSArray<UIView *> *)clickableViews;

/**
* Dismiss the currently displaying Native ad.
*/
- (void)unregisterView;

@end

@protocol VungleNativeAdDelegate <NSObject>
@optional

/**
* If implemented, this method will be called when the SDK loads a native ad successfully.
* @param nativeAd The VungleNativeAd object sending the message.
*/
- (void)nativeAdDidLoad:(VungleNativeAd *)nativeAd;

/**
* If implemented, this method will be called when the SDK fails to load a native ad.
* @param nativeAd The VungleNativeAd object sending the message.
* @param error An NSError object containing details of the error.
*/
- (void)nativeAd:(VungleNativeAd *)nativeAd didFailWithError:(NSError *)error;

/**
* If implemented, this method will be called when the SDK fails to present a native ad.
* @param nativeAd The VungleNativeAd object sending the message.
* @param error An NSError object containing details of the error.
*/
- (void)nativeAd:(VungleNativeAd *)nativeAd didFailToPlayWithError:(NSError *)error;

/**
* If implemented, this method will be called when a native ad is displayed successfully.
* @note Please use this callback to track an impression.
* @param nativeAd The VungleNativeAd object sending the message.
*/
- (void)nativeAdDidTrackImpression:(VungleNativeAd *)nativeAd;

/**
* If implemented, this method will be called when a user clicks the native ad.
* @param nativeAd The VungleNativeAd object sending the message.
*/
- (void)nativeAdDidClick:(VungleNativeAd *)nativeAd;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// VungleSDK.h
// Vungle iOS SDK
// SDK Version: 6.10.6
// SDK Version: 6.12.1
//
// Copyright (c) 2013-Present Vungle Inc. All rights reserved.
//
Expand Down Expand Up @@ -55,7 +55,6 @@ extern NSString *VunglePlayAdOptionKeyExtra6;
extern NSString *VunglePlayAdOptionKeyExtra7;
extern NSString *VunglePlayAdOptionKeyExtra8;
extern NSString *VunglePlayAdOptionKeyLargeButtons;
extern NSString *VunglePlayAdOptionKeyOrdinal;
extern NSString *VunglePlayAdOptionKeyFlexViewAutoDismissSeconds;

typedef enum {
Expand All @@ -80,6 +79,12 @@ typedef enum {
VungleSDKErrorUnknownBannerSize,
VungleSDKResetPlacementForDifferentAdSize,
VungleSDKErrorSDKAlreadyInitializing,
VungleSDKErrorInvalidAdTypeForNativeAdExperience,
VungleSDKErrorMissingAdMarkupForPlacement,
VungleSDKErrorInvalidAdMarkupForPlacement,
VungleSDKErrorIllegalAdRequest,
VungleSDKErrorSetNativeAdLoadCompletionBlock,
VungleSDKErrorNativeAdLoad,
} VungleSDKErrorCode;

typedef NS_ENUM (NSInteger, VungleConsentStatus) {
Expand Down Expand Up @@ -112,15 +117,12 @@ typedef NS_ENUM (NSInteger, VungleAdSize) {
* If implemented, this will get called when the SDK has an ad ready to be displayed. Also it will
* get called with an argument `NO` for `isAdPlayable` when for some reason, there is
* no ad available, for instance there is a corrupt ad or the OS wiped the cache.
* Please note that receiving a `NO` here does not mean that you can't play an Ad: if you haven't
* opted-out of our Exchange, you might be able to get a streaming ad if you call `play`.
* @param isAdPlayable A boolean indicating if an ad is currently in a playable state
* @param placementID The ID of a placement which is ready to be played
* @param error The error that was encountered. This is only sent when the placementID is nil.
*/
- (void)vungleAdPlayabilityUpdate:(BOOL)isAdPlayable placementID:(nullable NSString *)placementID error:(nullable NSError *)error;

- (void)vungleAdPlayabilityUpdate:(BOOL)isAdPlayable placementID:(nullable NSString *)placementID __attribute__((deprecated("Use vungleAdPlayabilityUpdate:isAdPlayable:plaementID:error: instead.")));
/**
* If implemented, this will get called when the SDK is about to show an ad. This point
* might be a good time to pause your game, and turn off any sound you might be playing.
Expand Down Expand Up @@ -148,21 +150,12 @@ typedef NS_ENUM (NSInteger, VungleAdSize) {
*/
- (void)vungleWillCloseAdForPlacementID:(nonnull NSString *)placementID;

- (void)vungleWillCloseAdWithViewInfo:(nonnull VungleViewInfo *)info placementID:(nonnull NSString *)placementID __attribute__((deprecated("Use vungleWillCloseAdForPlacementID: instead.")));

- (void)vungleSDKwillCloseAdWithViewInfo:(NSDictionary *)viewInfo
willPresentProductSheet:(BOOL)willPresentProductSheet __attribute__((deprecated("Use vungleWillCloseAdForPlacementID: instead.")));

- (void)vungleSDKwillCloseProductSheet:(id)productSheet __attribute__((deprecated("Use vungleWillCloseAdForPlacementID: instead.")));

/**
* If implemented, this method gets called when a Vungle Ad Unit has been completely dismissed.
* At this point, you can load another ad for non-auto-cached placement if necessary.
*/
- (void)vungleDidCloseAdForPlacementID:(nonnull NSString *)placementID;

- (void)vungleDidCloseAdWithViewInfo:(nonnull VungleViewInfo *)info placementID:(nonnull NSString *)placementID __attribute__((deprecated("Use vungleDidCloseAdForPlacementID: instead.")));

/**
* If implemented, this method gets called when user clicks the Vungle Ad.
* At this point, it's recommended to track the click event.
Expand Down Expand Up @@ -245,15 +238,6 @@ typedef NS_ENUM (NSInteger, VungleAdSize) {
+ (BOOL)backgroundDownloadEnabled;

#pragma mark - Initialization
/**
* Initializes the SDK. You can get your app id on Vungle's dashboard: https://v.vungle.com
* @param appID the unique identifier for your app
* @param placements An array of strings representing placements defined in the dashboard.
* @param error An error object containing information about why initialization failed
* @return YES if the SDK has started, NO otherwise
*/
- (BOOL)startWithAppId:(nonnull NSString *)appID placements:(nullable NSArray <NSString *> *)placements error:(NSError **)error __attribute__((deprecated("Use startWithAppId:appID:error: instead.")));

/**
* Initializes the SDK. You can get your app id on Vungle's dashboard: https://v.vungle.com
* @param appID the unique identifier for your app
Expand Down Expand Up @@ -300,16 +284,6 @@ typedef NS_ENUM (NSInteger, VungleAdSize) {
*/
- (BOOL)addAdViewToView:(UIView *)publisherView withOptions:(nullable NSDictionary *)options placementID:(nullable NSString *)placementID error:(NSError *__autoreleasing _Nullable *_Nullable)error;

/**
* This method will dismiss the currently playing Flex View, Flex Feed, Banner or MREC advertisement. If you have added an
* advertisement with `addAdViewToView:` or you are playing a placement that has been configured as a Flex View, Flex Feed,
* Banner or MREC placement, then this method will remove the advertisement from the screen and perform any necessary clean up
* steps.
*
* This method will call the existing delegate callbacks as part of the lifecycle.
*/
- (void)finishedDisplayingAd __attribute((deprecated("Use finishDisplayingAd: with the placementID of the ad to finish.")));

/**
* This method will dismiss the currently playing Flex View, Flex Feed, Banner or MREC advertisement with the placementId specified.
* If you have added an advertisement with `addAdViewToView:` or you are playing a placement that has been configured as a
Expand Down Expand Up @@ -435,6 +409,15 @@ typedef NS_ENUM (NSInteger, VungleAdSize) {
*/
- (void)disableBannerRefresh;

/**
* This method can be used to provide a user's COPPA status to the Vungle SDK.
* This method should be called before initialization.
* @param status the bool flag to be set for the user's COPPA status.
* status: YES if the user should be treated as 'under 13' and under COPPA regulations.
* status: NO if the user is known to be over the age of 13 and does NOT fall under COPPA regulations.
*/
- (void)updateCOPPAStatus:(BOOL)status;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,22 @@ NS_ASSUME_NONNULL_BEGIN
* will return nil if it is unable to find an available token.
*
*/
- (NSString *)currentSuperToken;
- (NSString *)currentSuperToken __attribute__((deprecated("Use currentSuperTokenForPlacementID:placementID:size: instead.")));

/**
* This is a synchronous method to fetch super token. This method
* will return nil if it is unable to find an available token.
* @param size Size limit of the supertoken needs to be returned
*/
- (NSString *)currentSuperTokenForSize:(NSInteger)size;
- (NSString *)currentSuperTokenForSize:(NSInteger)size __attribute__((deprecated("Use currentSuperTokenForPlacementID:placementID:size: instead.")));

/**
* This is a synchronous method to request super token includes bidTokens
* for specified Placement with size limitation.
* @param placementID the specific ID of the placement. Setting `nil` includes all bidTokens for available Placements.
* @param size size limit applied for the supertoken returned. 0 or negative value sets no size limit.
*/
- (NSString *)currentSuperTokenForPlacementID:(nullable NSString *)placementID forSize:(NSInteger)size;

@end

Expand Down Expand Up @@ -159,8 +167,6 @@ NS_ASSUME_NONNULL_BEGIN
* If implemented, this will get called when the SDK has an ad ready to be displayed. Also it will
* get called with an argument `NO` for `isAdPlayable` when for some reason, there is
* no ad available, for instance there is a corrupt ad or the OS wiped the cache.
* Please note that receiving a `NO` here does not mean that you can't play an Ad: if you haven't
* opted-out of our Exchange, you might be able to get a streaming ad if you call `play`.
* @param isAdPlayable A boolean indicating if an ad is currently in a playable state
* @param placementID The ID of a placement which is ready to be played
* @param adMarkup The ad markup of an adUnit which is ready to be played.
Expand Down

This file was deleted.

Binary file modified plugins/2018.3326/iphone-sim/VungleSDK.framework/Info.plist
Binary file not shown.
Loading

0 comments on commit cd92fee

Please sign in to comment.