Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
scottrules44 committed Feb 12, 2022
1 parent fcaf228 commit df5a230
Show file tree
Hide file tree
Showing 66 changed files with 1,759 additions and 0 deletions.
7 changes: 7 additions & 0 deletions plugins/2018.3326/android/corona.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
repositories {
jcenter()
mavenCentral()
}
dependencies {
implementation 'com.applovin.mediation:unityads-adapter:4.0.0.2'
}
14 changes: 14 additions & 0 deletions plugins/2018.3326/android/metadata.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
local metadata =
{
plugin =
{
format = "jar",
},
coronaManifest = {
-- dependencies = {
-- ["shared.google.play.services.ads"] = "com.coronalabs",
-- }
}
}

return metadata
Binary file not shown.
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,13 @@

@protocol UADSDictionaryConvertible <NSObject>
- (NSDictionary *)dictionary;
@end

@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,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,15 @@
@interface USRVJsonStorage : NSObject

@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
31 changes: 31 additions & 0 deletions plugins/2018.3326/iphone-sim/UnityAds.framework/Headers/UnityAds.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#import <Foundation/Foundation.h>
/**
* This is an umbrella header, pls modify it with caution ;)
*/
#ifndef UnityAds_h
#define UnityAds_h

FOUNDATION_EXPORT double UnityAdsModuleVersionNumber;
FOUNDATION_EXPORT const unsigned char UnityAdsModuleVersionString[];

#import <UnityAds/UnityAdsInitializationDelegate.h>
#import <UnityAds/UnityServices.h>
#import <UnityAds/UnityAdvertisement.h>
#import <UnityAds/UADSBannerView.h>
#import <UnityAds/UADSBannerViewDelegate.h>
#import <UnityAds/UADSBannerError.h>
#import <UnityAds/UADSPlayerMetaData.h>
#import <UnityAds/UADSMediationMetaData.h>
#import <UnityAds/UnityAdsInitializationError.h>
#import <UnityAds/UnityAdsInitializationDelegate.h>
#import <UnityAds/UnityAdsLoadDelegate.h>
#import <UnityAds/UnityAdsShowDelegate.h>
#import <UnityAds/UADSLoadOptions.h>
#import <UnityAds/UADSShowOptions.h>
#import <UnityAds/UADSBannerAdRefreshViewDelegate.h>

#import <UnityAds/UnityAnalytics.h>
#import <UnityAds/UnityAnalyticsAcquisitionType.h>
#import <UnityAds/UANAApiAnalytics.h>
#import <UnityAds/UADSBanner.h>
#endif /* UnityAds_h */
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#import <UIKit/UIKit.h>

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

/**
* Called when the banner is loaded and ready to be placed in the view hierarchy.
*
* @param placementId The ID of the placement of the banner that is loaded.
* @param view View that is to be placed in the view hierarchy.
*/
- (void)unityAdsBannerDidLoad: (NSString *)placementId view: (UIView *)view;

/**
* Called when the banner is unloaded and references to it should be discarded.
* The view provided in unityAdsBannerDidLoad will be removed from the view hierarchy before
* this method is called.
*/
- (void)unityAdsBannerDidUnload: (NSString *)placementId;

/**
* Called when the banner is shown.
*
* @param placementId The ID of the placement that has shown.
*/
- (void)unityAdsBannerDidShow: (NSString *)placementId;

/**
* Called when the banner is hidden.
*
* @param placementId the ID of the that has hidden.
*/
- (void)unityAdsBannerDidHide: (NSString *)placementId;

/**
* Called when the user clicks the banner.
*
* @param placementId the ID of the placement that has been clicked.
*/
- (void)unityAdsBannerDidClick: (NSString *)placementId;

/**
* 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 message A human readable string indicating the type of error encountered.
*/
- (void)unityAdsBannerDidError: (NSString *)message;

@end
Loading

0 comments on commit df5a230

Please sign in to comment.