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 fb26717 commit 2eb3d0e
Show file tree
Hide file tree
Showing 97 changed files with 5,264 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#include <UIKit/UIKit.h>
#include <UnityAds/UnityAdsBannerDelegate.h>

NS_ASSUME_NONNULL_BEGIN

/**
* An enumeration for the various ways to position the Unity Ads banner placement.
*/
typedef NS_ENUM (NSInteger, UnityAdsBannerPosition) {
kUnityAdsBannerPositionTopLeft,
kUnityAdsBannerPositionTopCenter,
kUnityAdsBannerPositionTopRight,
kUnityAdsBannerPositionBottomLeft,
kUnityAdsBannerPositionBottomCenter,
kUnityAdsBannerPositionBottomRight,
kUnityAdsBannerPositionCenter,
kUnityAdsBannerPositionNone
};

/**
* UnityAdsBanner is a static class for handling showing and hiding the Unity Ads banner.
*/

@interface UnityAdsBanner : NSObject
/*
* Loads the banner with the given placement.
* @param placementId The placement ID, as defined in the Unity Ads admin tools.
*/
+ (void)loadBanner: (nonnull NSString *)placementId __attribute__((deprecated));

/**
* Destroys the current banner placement.
*/
+ (void) destroy __attribute__((deprecated));

+ (void)setBannerPosition: (UnityAdsBannerPosition)bannerPosition __attribute__((deprecated));

/**
* Provides the currently assigned `UnityAdsBannerDelegate`.
*
* @return The current `UnityAdsBannerDelegate`.
*/
+ (nullable id <UnityAdsBannerDelegate>)getDelegate __attribute__((deprecated));

/**
* Asigns the banner delegate.
*
* @param delegate The new `UnityAdsBannerDelegate' for UnityAds to send banner callbacks to.
*/
+ (void)setDelegate: (id <UnityAdsBannerDelegate>)delegate __attribute__((deprecated));

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#import <Foundation/Foundation.h>

@class UADSBannerAdRefreshView;

/**
* UADSBannerAdRefreshViewDelegate is a delegate class for callbacks from Unity Ads Refresh Banner operations.
*/
@protocol UADSBannerAdRefreshViewDelegate <NSObject>

@optional
/**
* Called when the banner is loaded and ready to be placed in the view hierarchy.
*
* @param bannerAdRefreshView UADSBannerAdRefreshView that is to be placed in the view hierarchy.
*/
- (void)unityAdsRefreshBannerDidLoad: (UADSBannerAdRefreshView *)bannerAdRefreshView;

/**
* Called when the banner fails to fill.
*
* @param bannerAdRefreshView UADSBannerAdRefreshView that load was called on and failed to fill.
*/
- (void)unityAdsRefreshBannerDidNoFill: (UADSBannerAdRefreshView *)bannerAdRefreshView;

/**
* Called when the banner is shown.
*
* @param bannerAdRefreshView UADSBannerAdRefreshView that was shown.
*/
- (void)unityAdsRefreshBannerDidShow: (UADSBannerAdRefreshView *)bannerAdRefreshView;

/**
* Called when the banner is hidden.
*
* @param bannerAdRefreshView UADSBannerAdRefreshView that was hidden
*/
- (void)unityAdsRefreshBannerDidHide: (UADSBannerAdRefreshView *)bannerAdRefreshView;

/**
* Called when the user clicks the banner.
*
* @param bannerAdRefreshView UADSBannerAdRefreshView that the click occurred on.
*/
- (void)unityAdsRefreshBannerDidClick: (UADSBannerAdRefreshView *)bannerAdRefreshView;

/**
* Called when `UnityAdsBanner` encounters an error. All errors will be logged but this method can be used as an additional debugging aid. This callback can also be used for collecting statistics from different error scenarios.
*
* @param bannerAdRefreshView UADSBannerAdRefreshView that encountered an error.
* @param message A human readable string indicating the type of error encountered.
*/
- (void)unityAdsRefreshBannerDidError: (UADSBannerAdRefreshView *)bannerAdRefreshView message: (NSString *)message;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM (NSInteger, UADSBannerErrorCode) {
UADSBannerErrorCodeUnknown = 0,
UADSBannerErrorCodeNativeError = 1,
UADSBannerErrorCodeWebViewError = 2,
UADSBannerErrorCodeNoFillError = 3
};

@interface UADSBannerError : NSError

- (instancetype)initWithCode: (UADSBannerErrorCode)code userInfo: (nullable NSDictionary<NSErrorUserInfoKey, id> *)dict;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <UnityAds/UADSBannerViewDelegate.h>

NS_ASSUME_NONNULL_BEGIN

@interface UADSBannerView : UIView

@property (nonatomic, readonly) CGSize size;
@property (nonatomic, readwrite, nullable, weak) NSObject <UADSBannerViewDelegate> *delegate;
@property (nonatomic, readonly) NSString *placementId;

- (instancetype)initWithPlacementId: (NSString *)placementId size: (CGSize)size;

- (void) load;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#import <Foundation/Foundation.h>
#import <UnityAds/UADSBannerError.h>

@class UADSBannerView;

/**
* UnityAdsBannerDelegate is a delegate class for callbacks from Unity Ads Banner operations.
*/
@protocol UADSBannerViewDelegate <NSObject>

@optional
/**
* Called when the banner is loaded and ready to be placed in the view hierarchy.
*
* @param bannerView View that was loaded
*/
- (void)bannerViewDidLoad: (UADSBannerView *)bannerView;

/**
* Called when the user clicks the banner.
*
* @param bannerView View that the click occurred on.
*/
- (void)bannerViewDidClick: (UADSBannerView *)bannerView;

/**
* Called when a banner causes
* @param bannerView View that triggered leaving application
*/
- (void)bannerViewDidLeaveApplication: (UADSBannerView *)bannerView;

/**
* Called when `UnityAdsBanner` encounters an error. All errors will be logged but this method can be used as an additional debugging aid. This callback can also be used for collecting statistics from different error scenarios.
*
* @param bannerView View that encountered an error.
* @param error UADSBannerError that occurred
*/
- (void)bannerViewDidError: (UADSBannerView *)bannerView error: (UADSBannerError *)error;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#import <UnityAds/UADSDictionaryConvertible.h>

@interface UADSBaseOptions : NSObject<UADSDictionaryConvertible>

@property (nonatomic, strong, readonly) NSDictionary *dictionary;
@property (nonatomic, readwrite) NSString *objectId;

- (instancetype)init;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#import <Foundation/Foundation.h>

@protocol UADSDeviceInfoProvider
- (NSDictionary*)getDeviceInfoWithExtended:(BOOL)extended;
@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@protocol UADSDictionaryConvertible <NSObject>
- (NSDictionary *)dictionary;
@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#import <UnityAds/UADSBaseOptions.h>

@interface UADSLoadOptions : UADSBaseOptions

@property (nonatomic, readwrite) NSString *adMarkup;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#import <UnityAds/UADSMetaData.h>

@interface UADSMediationMetaData : UADSMetaData

- (void)setName: (NSString *)mediationNetworkName;
- (void)setVersion: (NSString *)mediationSdkVersion;
- (void)setOrdinal: (int)mediationOrdinal;
- (void)setMissedImpressionOrdinal: (int)missedImpressionOrdinal;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#import <UnityAds/USRVJsonStorage.h>

@interface UADSMetaData : USRVJsonStorage

@property (nonatomic, strong) NSString *category;

- (instancetype)initWithCategory: (NSString *)category;
- (BOOL)setRaw: (NSString *)key value: (id)value;
- (void) commit;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#import <UnityAds/UADSMetaData.h>

@interface UADSPlayerMetaData : UADSMetaData

- (void)setServerId: (NSString *)serverId;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#import <UnityAds/UADSBaseOptions.h>

@interface UADSShowOptions : UADSBaseOptions

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

NS_ASSUME_NONNULL_BEGIN

// C#
@protocol UANAEngineDelegate <NSObject>
- (void)addExtras: (NSString *)extras;
@end

// Webview
@interface UANAApiAnalytics : NSObject
+ (void)setAnalyticsDelegate: (id <UANAEngineDelegate>)analyticsDelegate;
@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#import <Foundation/Foundation.h>
#import <UnityAds/USRVInitializeStateType.h>

NS_ASSUME_NONNULL_BEGIN


@interface USRVInitializeStateFactory : NSObject

+(instancetype)newWithBuilder: (id)configurationLoader
andConfigReader: (_Nullable id)configReader; // erasing type at this point to be able to connect with swift. Nullable config reader is done to ease integration tests for SDKinit on swift side
-(id<USRVInitializeTask>)stateFor: (USRVInitializeStateType)type;
@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

#ifndef USRVInitializeStateType_h
#define USRVInitializeStateType_h

NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM (NSInteger, USRVInitializeStateType) {
USRVInitializeStateTypeConfigLocal,
USRVInitializeStateTypeConfigFetch,
USRVInitializeStateTypeReset,
USRVInitializeStateTypeInitModules,
USRVInitializeStateTypeLoadWebView,
USRVInitializeStateTypeCreateWebView,
USRVInitializeStateTypeComplete
};

@protocol USRVInitializeTask <NSObject>
- (void)startWithCompletion:(void (^)(void))completion error:(void (^)(NSError *))error;
- (NSString *)systemName;
@end

NS_ASSUME_NONNULL_END
#endif /* USRVInitializeStateType_h */
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

@protocol UADSJsonStorageContentsReader <NSObject>
- (NSDictionary *)getContents;
@end

@protocol UADSJsonStorageReader <NSObject>
- (id) getValueForKey: (NSString *)key;
@end

@interface USRVJsonStorage : NSObject<UADSJsonStorageContentsReader, UADSJsonStorageReader>

@property (nonatomic, strong) NSMutableDictionary *storageContents;

- (BOOL)set: (NSString *)key value: (id)value;
- (id)getValueForKey: (NSString *)key;
- (BOOL)deleteKey: (NSString *)key;
- (NSArray *)getKeys: (NSString *)key recursive: (BOOL)recursive;
- (void) clearData;
- (BOOL) initData;
- (BOOL) hasData;
- (void)setContents: (NSDictionary *)contents;
- (NSDictionary *)getContents;

@end
Loading

0 comments on commit 2eb3d0e

Please sign in to comment.