Skip to content

Commit

Permalink
new sdk version 3.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
AGulev committed Apr 24, 2021
1 parent c2e4d9b commit 375faa7
Show file tree
Hide file tree
Showing 14 changed files with 412 additions and 183 deletions.
Binary file modified defunityads/lib/android/classes.jar
Binary file not shown.
13 changes: 13 additions & 0 deletions defunityads/lib/ios/UnityAds.framework/Headers/UADSBaseOptions.h
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 "UADSBaseOptions.h"

@interface UADSLoadOptions : UADSBaseOptions

@property (nonatomic, readwrite) NSString* adMarkup;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#import "UADSBaseOptions.h"

@interface UADSShowOptions : UADSBaseOptions

@end
58 changes: 53 additions & 5 deletions defunityads/lib/ios/UnityAds.framework/Headers/UnityAds.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
#import "UnityAdsInitializationError.h"
#import "UnityAdsInitializationDelegate.h"
#import "UnityAdsLoadDelegate.h"
#import "UnityAdsShowDelegate.h"
#import "UADSLoadOptions.h"
#import "UADSShowOptions.h"

NS_ASSUME_NONNULL_BEGIN

Expand Down Expand Up @@ -159,21 +162,60 @@ NS_ASSUME_NONNULL_BEGIN
* @param placementId The placement ID, as defined in Unity Ads admin tools.
* @param loadDelegate The load delegate.
*/
+ (void)load:(NSString *)placementId loadDelegate:(nullable id<UnityAdsLoadDelegate>)loadDelegate;
+ (void) load:(NSString *)placementId
loadDelegate:(nullable id<UnityAdsLoadDelegate>)loadDelegate;

/**
* Load a placement to make it available to show. Ads generally take a few seconds to finish loading before they can be shown.
* Note: The `load` API is in closed beta and available upon invite only. If you would like to be considered for the beta, please contact Unity Ads Support.
*
* @param placementId The placement ID, as defined in Unity Ads admin tools.
* @param options The load options.
* @param loadDelegate The load delegate.
*/
+ (void) load:(NSString *)placementId
options:(UADSLoadOptions *)options
loadDelegate:(nullable id<UnityAdsLoadDelegate>)loadDelegate;


/**
* Show an ad using the defaul placement.
*
* @param viewController The `UIViewController` that is to present the ad view controller.
*/
+ (void)show:(UIViewController *)viewController;
+ (void)show:(UIViewController *)viewController __attribute__((deprecated("Please migrate to using show call with placementId and showDelegate instead")));
/**
* Show an ad using the provided placement ID.
*
* @param viewController The `UIViewController` that is to present the ad view controller.
* @param placementId The placement ID, as defined in Unity Ads admin tools.
*/
+ (void)show:(UIViewController *)viewController placementId:(NSString *)placementId __attribute__((deprecated("Please migrate to using show call with showDelegate instead")));;
/**
* Show an ad using the provided placement ID.
*
* @param viewController The `UIViewController` that is to present the ad view controller.
* @param placementId The placement ID, as defined in Unity Ads admin tools.
* @param showDelegate The show delegate.
*/
+ (void)show:(UIViewController *)viewController placementId:(NSString *)placementId showDelegate:(nullable id<UnityAdsShowDelegate>)showDelegate;
/**
* Show an ad using the provided placement ID.
*
* @param viewController The `UIViewController` that is to present the ad view controller.
* @param placementId The placement ID, as defined in Unity Ads admin tools.
* @param options Additional options
*/
+ (void)show:(UIViewController *)viewController placementId:(NSString *)placementId;
+ (void)show:(UIViewController *)viewController placementId:(NSString *)placementId options:(UADSShowOptions *)options __attribute__((deprecated("Please migrate to using show call with showDelegate instead")));;
/**
* Show an ad using the provided placement ID.
*
* @param viewController The `UIViewController` that is to present the ad view controller.
* @param placementId The placement ID, as defined in Unity Ads admin tools.
* @param options Additional options
* @param showDelegate The show delegate.
*/
+ (void)show:(UIViewController *)viewController placementId:(NSString *)placementId options:(UADSShowOptions *)options showDelegate:(nullable id<UnityAdsShowDelegate>)showDelegate;
/**
* Provides the currently assigned `UnityAdsDelegate`. Meant to support use of single delegate
*
Expand Down Expand Up @@ -228,15 +270,15 @@ NS_ASSUME_NONNULL_BEGIN
*
* @return If `YES`, the default placement is ready to show an ad.
*/
+ (BOOL)isReady;
+ (BOOL)isReady __attribute__((deprecated("Please migrate to using load call with UnityAdsLoadDelegate")));
/**
* Check if a particular placement is ready to show an ad.
*
* @param placementId The placement ID being checked.
*
* @return If `YES`, the placement is ready to show an ad.
*/
+ (BOOL)isReady:(NSString *)placementId;
+ (BOOL)isReady:(NSString *)placementId __attribute__((deprecated("Please migrate to using load call with UnityAdsLoadDelegate")));
/**
* Check the current state of the default placement.
*
Expand All @@ -263,6 +305,12 @@ NS_ASSUME_NONNULL_BEGIN
* @return If `YES`, Unity Ads has been successfully initialized.
*/
+ (BOOL)isInitialized;
/**
* Get request token.
*
* @return Active token or null if no active token is available.
*/
+ (NSString* __nullable)getToken;

@end

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#import "UnityAdsLoadError.h"
NS_ASSUME_NONNULL_BEGIN

/**
Expand All @@ -10,12 +11,16 @@ NS_ASSUME_NONNULL_BEGIN
* @param placementId The ID of the placement as defined in Unity Ads admin tools.
*/
- (void)unityAdsAdLoaded:(NSString *)placementId;

/**
* Callback triggered when load request has failed to load an ad for a requested placement.
*
* @param placementId The ID of the placement as defined in Unity Ads admin tools.
*/
- (void)unityAdsAdFailedToLoad:(NSString *)placementId;
* Called when load request has failed to load an ad for a requested placement.
* @param placementId The ID of the placement as defined in Unity Ads admin tools.
* @param error UnityAdsLoadError
* @param message A human readable error message
*/
- (void)unityAdsAdFailedToLoad:(NSString *)placementId
withError:(UnityAdsLoadError)error
withMessage:(NSString *)message;
@end

NS_ASSUME_NONNULL_END
30 changes: 30 additions & 0 deletions defunityads/lib/ios/UnityAds.framework/Headers/UnityAdsLoadError.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* An enumeration for the error category of load errors
*/
typedef NS_ENUM(NSInteger, UnityAdsLoadError) {
/**
* Error related to SDK not initialized
*/
kUnityAdsLoadErrorInitializeFailed,

/**
* Error related to environment or internal services
*/
kUnityAdsLoadErrorInternal,

/**
* Error related to invalid arguments
*/
kUnityAdsLoadErrorInvalidArgument,

/**
* Error related to there being no ads available
*/
kUnityAdsLoadErrorNoFill,

/**
* Error related to there being no ads available
*/
kUnityAdsLoadErrorTimeout,
};

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* An enumeration for the show completion state of an ad.
*/
typedef NS_ENUM(NSInteger, UnityAdsShowCompletionState) {
/**
* A state that indicates that the user skipped the ad.
*/
kUnityShowCompletionStateSkipped,
/**
* A state that indicates that the ad was played entirely.
*/
kUnityShowCompletionStateCompleted
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#import "UnityAdsShowError.h"
#import "UnityAdsShowCompletionState.h"

NS_ASSUME_NONNULL_BEGIN

/**
* The `UnityAdsShowDelegate` defines the methods which will notify UnityAds show call
* is either successfully completed with its completion state or failed with error category and error message
*/

@protocol UnityAdsShowDelegate <NSObject>
/**
* Called when UnityAds completes show operation successfully for a placement with completion state.
* @param placementId The ID of the placement as defined in Unity Ads admin tools.
* @param state An enum value indicating the finish state of the ad. Possible values are `Completed`, `Skipped`.
*/
- (void)unityAdsShowComplete:(NSString *)placementId withFinishState:(UnityAdsShowCompletionState)state;
/**
* Called when UnityAds has failed to show a specific placement with an error message and error category.
* @param placementId The ID of the placement as defined in Unity Ads admin tools.
* @param error
* if `kUnityShowErrorNotInitialized`, show failed due to SDK not initialized.
* if `kUnityShowErrorNotReady`, show failed due to placement not being ready.
* if `kUnityShowErrorVideoPlayerError`, show failed due to video player.
* if `kUnityShowErrorInvalidArgument`, show failed due to invalid arguments.
* if `kUnityShowErrorNoConnection`, show failed due to internet connection.
* if `kUnityShowErrorAlreadyShowing`, show failed due to ad is already being showen.
* if `kUnityShowErrorInternalError`, show failed due to environment or internal services.
* @param message A human readable error message
*/
- (void)unityAdsShowFailed:(NSString *)placementId withError:(UnityAdsShowError)error withMessage:(NSString *)message;
/**
* Called when UnityAds has started to show ad with a specific placement.
* @param placementId The ID of the placement as defined in Unity Ads admin tools.
*/
- (void)unityAdsShowStart:(NSString *)placementId;
/**
* Called when UnityAds has received a click while showing ad with a specific placement.
* @param placementId The ID of the placement as defined in Unity Ads admin tools.
*/
- (void)unityAdsShowClick:(NSString *)placementId;

@end

NS_ASSUME_NONNULL_END
42 changes: 42 additions & 0 deletions defunityads/lib/ios/UnityAds.framework/Headers/UnityAdsShowError.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/**
* An enumeration for the error category of show errors
*/
typedef NS_ENUM(NSInteger, UnityAdsShowError)
{
/**
* Error related to SDK not initialized
*/
kUnityShowErrorNotInitialized,

/**
* Error related to placement not being ready
*/
kUnityShowErrorNotReady,

/**
* Error related to video player
*/
kUnityShowErrorVideoPlayerError,

/**
* Error related to invalid arguments
*/
kUnityShowErrorInvalidArgument,

/**
* Error related to internet connection
*/
kUnityShowErrorNoConnection,

/**
* Error related to ad is already being shown
*/
kUnityShowErrorAlreadyShowing,

/**
* Error related to environment or internal services
*/
kUnityShowErrorInternalError

};

Binary file modified defunityads/lib/ios/UnityAds.framework/Info.plist
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ framework module UnityAds {
header "UnityAdsInitializationDelegate.h"
header "UnityAdsInitializationError.h"
header "UnityAdsLoadDelegate.h"
header "UnityAdsShowError.h"
header "UnityAdsShowCompletionState.h"
header "UnityAdsShowDelegate.h"
header "UADSBaseOptions.h"
header "UADSLoadOptions.h"
header "UADSShowOptions.h"

header "USRVUnityPurchasing.h"
header "USRVUnityPurchasingDelegate.h"
Expand Down
Binary file modified defunityads/lib/ios/UnityAds.framework/UnityAds
Binary file not shown.
Loading

0 comments on commit 375faa7

Please sign in to comment.