@@ -183,9 +183,24 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
183183# pragma pop_macro("any")
184184#endif
185185
186+ typedef SWIFT_ENUM (NSInteger , AdErrorCode) {
187+ AdErrorCodeErrorNoSlot = 1 ,
188+ AdErrorCodeErrorNetwork = 2 ,
189+ AdErrorCodeErrorNotFilled = 3 ,
190+ AdErrorCodeErrorBadResponse = 4 ,
191+ AdErrorCodeErrorVastError = 5 ,
192+ AdErrorCodeErrorUserIdMissing = 6 ,
193+ AdErrorCodeErrorInternal = 7 ,
194+ };
195+
186196
187197SWIFT_CLASS (" _TtC8TeadsSDK12AdFailReason" )
188198@interface AdFailReason : NSObject
199+ // / Error code
200+ @property (nonatomic) enum AdErrorCode errorCode;
201+ // / String that describes the error reason
202+ @property (nonatomic, copy) NSString * _Nonnull errorMessage;
203+ - (nonnull instancetype )initWithErrorCode:(enum AdErrorCode)errorCode errorMessage:(NSString * _Nonnull)errorMessage OBJC_DESIGNATED_INITIALIZER;
189204- (nonnull instancetype )init SWIFT_UNAVAILABLE;
190205+ (nonnull instancetype )new SWIFT_DEPRECATED_MSG(" -init is unavailable" );
191206@end
@@ -208,7 +223,7 @@ SWIFT_PROTOCOL("_TtP8TeadsSDK13TFAAdDelegate_")
208223// / Called when you did not get and ad
209224// / \param ad The teadsAd object
210225// /
211- // / \param adFailReason adFailReason object that contains an error code and an error message
226+ // / \param adFailReason AdFailReason object that contains an error code and an error message
212227// /
213228- (void )didFailToReceiveAd:(TFACustomAdView * _Nonnull)ad adFailReason:(AdFailReason * _Nonnull)adFailReason;
214229// / Called when the ad should be closed
@@ -247,6 +262,8 @@ SWIFT_PROTOCOL("_TtP8TeadsSDK13TFAAdDelegate_")
247262// / Called when ad changes volume state
248263// / \param ad The teadsAd object
249264// /
265+ // / \param muted true if the sound is off false otherwise
266+ // /
250267- (void )adDidChangeVolume:(TFACustomAdView * _Nonnull)ad muted:(BOOL )muted;
251268@end
252269
@@ -263,7 +280,13 @@ SWIFT_CLASS("_TtC8TeadsSDK15TFACustomAdView")
263280@property (nonatomic, readonly) BOOL isPlaying;
264281// / Ad sound enabled state
265282@property (nonatomic, readonly) BOOL isSoundActive;
283+ @property (nonatomic, weak) id <TFAAdDelegate> _Nullable delegate;
266284@property (nonatomic, copy) NSString * _Nullable pid;
285+ @property (nonatomic) CGRect bounds;
286+ @property (nonatomic) CGRect frame;
287+ - (void )awakeFromNib;
288+ - (void )willMoveToSuperview:(UIView * _Nullable)newSuperview;
289+ - (void )didMoveToSuperview;
267290- (nonnull instancetype )initWithFrame:(CGRect)frame OBJC_DESIGNATED_INITIALIZER;
268291// / Init TFACustomAdView by prodiving the pId and optional parameters
269292// / \param pid The Placement ID
@@ -275,11 +298,6 @@ SWIFT_CLASS("_TtC8TeadsSDK15TFACustomAdView")
275298// / The TeadsAd instance
276299- (nonnull instancetype )initWithPid:(NSString * _Nonnull)pid delegate:(id <TFAAdDelegate> _Nullable)delegate OBJC_DESIGNATED_INITIALIZER;
277300- (nullable instancetype )initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;
278- @property (nonatomic) CGRect bounds;
279- @property (nonatomic) CGRect frame;
280- - (void )awakeFromNib;
281- - (void )willMoveToSuperview:(UIView * _Nullable)newSuperview;
282- - (void )didMoveToSuperview;
283301// / Request an ad from Teads ad server
284302// / \param teadsAdSettings Optionnal <code>TeadsAdSettings</code> to define custom settings
285303// /
@@ -305,13 +323,20 @@ typedef SWIFT_ENUM(NSInteger, TeadsAdPlaybackState) {
305323 TeadsAdPlaybackStatePlaybackStatePaused = 2 ,
306324};
307325
326+ @protocol TFAInterstitialAdDelegate;
308327
309328SWIFT_CLASS (" _TtC8TeadsSDK17TFAInterstitialAd" )
310329@interface TFAInterstitialAd : NSObject <TFAAdDelegate>
330+ @property (nonatomic, weak) id <TFAInterstitialAdDelegate> _Nullable delegate;
331+ @property (nonatomic) BOOL isShown;
332+ - (nonnull instancetype )initWithPid:(NSString * _Nonnull)pid delegate:(id <TFAInterstitialAdDelegate> _Nullable)delegate OBJC_DESIGNATED_INITIALIZER;
333+ - (void )loadWithSettings:(TeadsAdSettings * _Nullable)settings;
334+ - (void )show;
311335- (void )didReceiveAd:(TFACustomAdView * _Nonnull)ad adRatio:(CGFloat)adRatio;
312336- (void )didFailToReceiveAd:(TFACustomAdView * _Nonnull)ad adFailReason:(AdFailReason * _Nonnull)adFailReason;
313337- (void )adClose:(TFACustomAdView * _Nonnull)ad userAction:(BOOL )userAction;
314338- (void )adError:(TFACustomAdView * _Nonnull)ad errorMessage:(NSString * _Nonnull)errorMessage;
339+ - (void )adBrowserDidOpen:(TFACustomAdView * _Nonnull)ad;
315340- (nonnull instancetype )init SWIFT_UNAVAILABLE;
316341+ (nonnull instancetype )new SWIFT_DEPRECATED_MSG(" -init is unavailable" );
317342@end
@@ -321,43 +346,56 @@ SWIFT_PROTOCOL("_TtP8TeadsSDK25TFAInterstitialAdDelegate_")
321346@protocol TFAInterstitialAdDelegate
322347- (void )interstitialDidReceiveAd:(TFAInterstitialAd * _Nonnull)ad;
323348- (void )interstitial:(TFAInterstitialAd * _Nonnull)ad didFailToReceiveAdWithError:(NSString * _Nonnull)error;
349+ @optional
350+ - (void )interstitialWillOpen:(TFAInterstitialAd * _Nonnull)ad;
351+ - (void )interstitialWillClose:(TFAInterstitialAd * _Nonnull)ad;
324352- (void )interstitialDidOpen:(TFAInterstitialAd * _Nonnull)ad;
325353- (void )interstitialDidClose:(TFAInterstitialAd * _Nonnull)ad;
326354- (void )interstitialWillLeaveApplication:(TFAInterstitialAd * _Nonnull)ad;
355+ - (void )interstitialDidClickthrough:(TFAInterstitialAd * _Nonnull)ad;
327356@end
328357
329358
359+ SWIFT_CLASS (" _TtC8TeadsSDK9TFAReward" )
360+ @interface TFAReward : NSObject
361+ @property (nonatomic, copy) NSString * _Nullable type;
362+ @property (nonatomic) double amount;
363+ - (nonnull instancetype )init SWIFT_UNAVAILABLE;
364+ + (nonnull instancetype )new SWIFT_DEPRECATED_MSG(" -init is unavailable" );
365+ @end
366+
367+ @protocol TFARewardedAdDelegate;
368+
330369SWIFT_CLASS (" _TtC8TeadsSDK13TFARewardedAd" )
331370@interface TFARewardedAd : NSObject <TFAAdDelegate>
371+ @property (nonatomic, weak) id <TFARewardedAdDelegate> _Nullable delegate;
372+ @property (nonatomic) BOOL isShown;
373+ - (nonnull instancetype )initWithPid:(NSString * _Nonnull)pid delegate:(id <TFARewardedAdDelegate> _Nullable)delegate OBJC_DESIGNATED_INITIALIZER;
374+ - (void )loadWithSettings:(TeadsAdSettings * _Nullable)settings;
375+ - (void )show;
332376- (void )didReceiveAd:(TFACustomAdView * _Nonnull)ad adRatio:(CGFloat)adRatio;
333377- (void )didFailToReceiveAd:(TFACustomAdView * _Nonnull)ad adFailReason:(AdFailReason * _Nonnull)adFailReason;
334378- (void )adClose:(TFACustomAdView * _Nonnull)ad userAction:(BOOL )userAction;
335379- (void )adError:(TFACustomAdView * _Nonnull)ad errorMessage:(NSString * _Nonnull)errorMessage;
336380- (void )adPlaybackChange:(TFACustomAdView * _Nonnull)ad state:(enum TeadsAdPlaybackState)state;
381+ - (void )adBrowserDidOpen:(TFACustomAdView * _Nonnull)ad;
337382- (nonnull instancetype )init SWIFT_UNAVAILABLE;
338383+ (nonnull instancetype )new SWIFT_DEPRECATED_MSG(" -init is unavailable" );
339384@end
340385
341386
342387SWIFT_PROTOCOL (" _TtP8TeadsSDK21TFARewardedAdDelegate_" )
343388@protocol TFARewardedAdDelegate
344- @optional
345- - (void )rewarded:(TFARewardedAd * _Nonnull)rewardedAd didRewardUserWith:(CGFloat)reward;
389+ - (void )rewarded:(TFARewardedAd * _Nonnull)rewardedAd didRewardUserWith:(TFAReward * _Nullable)reward;
346390- (void )rewarded:(TFARewardedAd * _Nonnull)rewardedAd didFailToReceiveAdWithError:(NSString * _Nonnull)didFailToReceiveAdWithError;
347391- (void )rewardedAdDidReceive:(TFARewardedAd * _Nonnull)rewardedAd;
392+ @optional
348393- (void )rewardedAdDidOpen:(TFARewardedAd * _Nonnull)rewardedAd;
349394- (void )rewardedAdDidStartPlaying:(TFARewardedAd * _Nonnull)rewardedAd;
350395- (void )rewardedAdDidCompletePlaying:(TFARewardedAd * _Nonnull)rewardedAd;
351396- (void )rewardedAdDidClose:(TFARewardedAd * _Nonnull)rewardedAd;
352397- (void )rewardedAdWillLeaveApplication:(TFARewardedAd * _Nonnull)rewardedAd;
353- @end
354-
355-
356- // / Class that contains teads ad response from the server
357- SWIFT_CLASS (" _TtC8TeadsSDK15TeadsAdResponse" )
358- @interface TeadsAdResponse : NSObject
359- - (nonnull instancetype )init SWIFT_UNAVAILABLE;
360- + (nonnull instancetype )new SWIFT_DEPRECATED_MSG(" -init is unavailable" );
398+ - (void )rewardedAdDidClickthrough:(TFARewardedAd * _Nonnull)rewardedAd;
361399@end
362400
363401
@@ -368,6 +406,7 @@ SWIFT_CLASS("_TtC8TeadsSDK15TeadsAdSettings")
368406- (void )enableLigtEndScreen;
369407- (void )disableMediaPreload;
370408- (void )pageUrl:(NSString * _Nonnull)urlString;
409+ - (nonnull instancetype )initWithBuild:(SWIFT_NOESCAPE void (^ _Nonnull)(TeadsAdSettings * _Nonnull))build OBJC_DESIGNATED_INITIALIZER;
371410- (nonnull instancetype )init SWIFT_UNAVAILABLE;
372411+ (nonnull instancetype )new SWIFT_DEPRECATED_MSG(" -init is unavailable" );
373412@end
0 commit comments