commit | author | age
|
96fe76
|
1 |
// |
L |
2 |
// GADMediatedUnifiedNativeAd.h |
|
3 |
// Google Mobile Ads SDK |
|
4 |
// |
|
5 |
// Copyright 2017 Google LLC. All rights reserved. |
|
6 |
// |
|
7 |
|
|
8 |
#import <Foundation/Foundation.h> |
|
9 |
#import <GoogleMobileAds/GADNativeAdAssetIdentifiers.h> |
|
10 |
#import <GoogleMobileAds/GADNativeAdImage.h> |
|
11 |
|
|
12 |
/// Provides methods used for constructing native ads. The adapter must return an object conforming |
|
13 |
/// to this protocol for native ad requests. |
|
14 |
@protocol GADMediatedUnifiedNativeAd <NSObject> |
|
15 |
|
|
16 |
/// Headline. |
|
17 |
@property(nonatomic, readonly, copy, nullable) NSString *headline; |
|
18 |
|
|
19 |
/// Array of GADNativeAdImage objects. |
|
20 |
@property(nonatomic, readonly, nullable) NSArray<GADNativeAdImage *> *images; |
|
21 |
|
|
22 |
/// Description. |
|
23 |
@property(nonatomic, readonly, copy, nullable) NSString *body; |
|
24 |
|
|
25 |
/// Icon image. |
|
26 |
@property(nonatomic, readonly, nullable) GADNativeAdImage *icon; |
|
27 |
|
|
28 |
/// Text that encourages user to take some action with the ad. For example "Install". |
|
29 |
@property(nonatomic, readonly, copy, nullable) NSString *callToAction; |
|
30 |
|
|
31 |
/// App store rating (0 to 5). |
|
32 |
@property(nonatomic, readonly, copy, nullable) NSDecimalNumber *starRating; |
|
33 |
|
|
34 |
/// The app store name. For example, "App Store". |
|
35 |
@property(nonatomic, readonly, copy, nullable) NSString *store; |
|
36 |
|
|
37 |
/// String representation of the app's price. |
|
38 |
@property(nonatomic, readonly, copy, nullable) NSString *price; |
|
39 |
|
|
40 |
/// Identifies the advertiser. For example, the advertiser’s name or visible URL. |
|
41 |
@property(nonatomic, readonly, copy, nullable) NSString *advertiser; |
|
42 |
|
|
43 |
/// Returns a dictionary of asset names and object pairs for assets that are not handled by |
|
44 |
/// properties of the GADMediatedUnifiedNativeAd. |
|
45 |
@property(nonatomic, readonly, copy, nullable) NSDictionary<NSString *, id> *extraAssets; |
|
46 |
|
|
47 |
@optional |
|
48 |
|
|
49 |
/// AdChoices view. |
|
50 |
@property(nonatomic, readonly, nullable) UIView *adChoicesView; |
|
51 |
|
|
52 |
/// Media view. |
|
53 |
@property(nonatomic, readonly, nullable) UIView *mediaView; |
|
54 |
|
|
55 |
/// Indicates whether the ad has video content. |
|
56 |
@property(nonatomic, readonly) BOOL hasVideoContent; |
|
57 |
|
|
58 |
/// Media content aspect ratio (width/height) or 0 if there's no media content. |
|
59 |
@property(nonatomic, readonly) CGFloat mediaContentAspectRatio; |
|
60 |
|
|
61 |
/// The video's duration in seconds or 0 if there's no video or the duration is unknown. |
|
62 |
@property(nonatomic, readonly) NSTimeInterval duration; |
|
63 |
|
|
64 |
/// The video's current playback time in seconds or 0 if there's no video or the current playback |
|
65 |
/// time is unknown. |
|
66 |
@property(nonatomic, readonly) NSTimeInterval currentTime; |
|
67 |
|
|
68 |
/// Tells the receiver that it has been rendered in |view| with clickable asset views and |
|
69 |
/// nonclickable asset views. viewController should be used to present modal views for the ad. |
|
70 |
- (void)didRenderInView:(nonnull UIView *)view |
|
71 |
clickableAssetViews: |
|
72 |
(nonnull NSDictionary<GADNativeAssetIdentifier, UIView *> *)clickableAssetViews |
|
73 |
nonclickableAssetViews: |
|
74 |
(nonnull NSDictionary<GADNativeAssetIdentifier, UIView *> *)nonclickableAssetViews |
|
75 |
viewController:(nonnull UIViewController *)viewController; |
|
76 |
|
|
77 |
/// Tells the receiver that an impression is recorded. This method is called only once per mediated |
|
78 |
/// native ad. |
|
79 |
- (void)didRecordImpression; |
|
80 |
|
|
81 |
/// Tells the receiver that a user click is recorded on the asset named |assetName|. Full screen |
|
82 |
/// actions should be presented from viewController. This method is called only if |
|
83 |
/// -[GADMAdNetworkAdapter handlesUserClicks] returns NO. |
|
84 |
- (void)didRecordClickOnAssetWithName:(nonnull GADNativeAssetIdentifier)assetName |
|
85 |
view:(nonnull UIView *)view |
|
86 |
viewController:(nonnull UIViewController *)viewController; |
|
87 |
|
|
88 |
/// Tells the receiver that it has untracked |view|. This method is called when the mediated native |
|
89 |
/// ad is no longer rendered in the provided view and the delegate should stop tracking the view's |
|
90 |
/// impressions and clicks. The method may also be called with a nil view when the view in which the |
|
91 |
/// mediated native ad has rendered is deallocated. |
|
92 |
- (void)didUntrackView:(nullable UIView *)view; |
|
93 |
|
|
94 |
@end |