|
| 1 | +// |
| 2 | +// OMIDAdSessionConfiguration.h |
| 3 | +// AppVerificationLibrary |
| 4 | +// |
| 5 | +// Created by Saraev Vyacheslav on 15/09/2017. |
| 6 | +// |
| 7 | + |
| 8 | +#import <UIKit/UIKit.h> |
| 9 | + |
| 10 | +/** |
| 11 | + * Identifies which integration layer is responsible for sending certain events. |
| 12 | + */ |
| 13 | +typedef NS_ENUM(NSUInteger, OMIDOwner) { |
| 14 | + /** The integration will send the event from a JavaScript session script. */ |
| 15 | + OMIDJavaScriptOwner = 1, |
| 16 | + /** The integration will send the event from the native layer. */ |
| 17 | + OMIDNativeOwner = 2, |
| 18 | + /** The integration will not send the event. */ |
| 19 | + OMIDNoneOwner = 3 |
| 20 | +}; |
| 21 | + |
| 22 | + |
| 23 | +/** |
| 24 | + * List of supported creative types. |
| 25 | + */ |
| 26 | +typedef NS_ENUM(NSUInteger, OMIDCreativeType) { |
| 27 | + /** |
| 28 | + * Creative type will be set by JavaScript session script. |
| 29 | + * Integrations must also pass `OMIDJavaScriptOwner` for `impressionOwner`. |
| 30 | + */ |
| 31 | + OMIDCreativeTypeDefinedByJavaScript = 1, |
| 32 | + // Remaining values set creative type in native layer. |
| 33 | + /** |
| 34 | + * Rendered in webview, verification code can be inside creative or in metadata. |
| 35 | + */ |
| 36 | + OMIDCreativeTypeHtmlDisplay = 2, |
| 37 | + /** |
| 38 | + * Rendered by native, verification code provided in metadata only. |
| 39 | + */ |
| 40 | + OMIDCreativeTypeNativeDisplay = 3, |
| 41 | + /** |
| 42 | + * Rendered instream or as standalone video, verification code provided in metadata. |
| 43 | + */ |
| 44 | + OMIDCreativeTypeVideo = 4, |
| 45 | + /** |
| 46 | + * Similar to video but only contains audio media. |
| 47 | + */ |
| 48 | + OMIDCreativeTypeAudio = 5 |
| 49 | +}; |
| 50 | + |
| 51 | +/** |
| 52 | + * The criterion for an ad session's OMID impression event. |
| 53 | + * Declaring an impression type makes it easier to understand discrepancies between measurers |
| 54 | + * of the ad session, since many metrics depend on impressions. |
| 55 | + */ |
| 56 | +typedef NS_ENUM(NSUInteger, OMIDImpressionType) { |
| 57 | + /** |
| 58 | + * ImpressionType will be set by JavaScript session script. |
| 59 | + * Integrations must also pass `OMIDJavaScriptOwner` for `impressionOwner`. |
| 60 | + */ |
| 61 | + OMIDImpressionTypeDefinedByJavaScript = 1, |
| 62 | + // Remaining values set ImpressionType in native layer. |
| 63 | + /** |
| 64 | + * The integration is not declaring the criteria for the OMID impression. |
| 65 | + */ |
| 66 | + OMIDImpressionTypeUnspecified = 2, |
| 67 | + /** |
| 68 | + * The integration is using count-on-download criteria for the OMID impression. |
| 69 | + */ |
| 70 | + OMIDImpressionTypeLoaded = 3, |
| 71 | + /** |
| 72 | + * The integration is using begin-to-render criteria for the OMID impression. |
| 73 | + */ |
| 74 | + OMIDImpressionTypeBeginToRender = 4, |
| 75 | + /** |
| 76 | + * The integration is using one-pixel criteria (when the creative has at least 1 visible pixel on |
| 77 | + * screen) for the OMID impression. |
| 78 | + */ |
| 79 | + OMIDImpressionTypeOnePixel = 5, |
| 80 | + /** |
| 81 | + * The integration is using viewable criteria (1 second for display, 2 seconds while playing for |
| 82 | + * video, and at least 50% of the creative is visible) for the OMID impression. |
| 83 | + */ |
| 84 | + OMIDImpressionTypeViewable = 6, |
| 85 | + /** |
| 86 | + * The integration is using audible criteria (2 continuous second of media playback with non-zero |
| 87 | + * volume) for the OMID impression. |
| 88 | + */ |
| 89 | + OMIDImpressionTypeAudible = 7, |
| 90 | + /** |
| 91 | + * The integration's criteria uses none of the above criteria for the OMID impression. |
| 92 | + */ |
| 93 | + OMIDImpressionTypeOther = 8 |
| 94 | +}; |
| 95 | + |
| 96 | +/** |
| 97 | + * The ad session configuration supplies the owner for both the impression and video events. |
| 98 | + * The OM SDK JS service will use this information to help identify where the source of these |
| 99 | + * events is expected to be received. |
| 100 | + */ |
| 101 | +@interface OMIDSeedtagAdSessionConfiguration : NSObject |
| 102 | + |
| 103 | +@property OMIDCreativeType creativeType; |
| 104 | +@property OMIDImpressionType impressionType; |
| 105 | +@property OMIDOwner impressionOwner; |
| 106 | +@property OMIDOwner mediaEventsOwner; |
| 107 | +@property BOOL isolateVerificationScripts; |
| 108 | + |
| 109 | +/** |
| 110 | + * Create new ad session configuration supplying the owner for both the impression and media |
| 111 | + * events along with the type of creative being rendered/measured. |
| 112 | + * The OM SDK JS service will use this information to help identify where the source of these |
| 113 | + * events is expected to be received. |
| 114 | + * @param creativeType the type of creative to be rendered in this session. |
| 115 | + * @param impressionType the type of impression to be triggered in this session. |
| 116 | + * @param impressionOwner whether the native or JavaScript layer should be responsible for supplying |
| 117 | + * the impression event. |
| 118 | + * @param mediaEventsOwner whether the native or JavaScript layer should be responsible for |
| 119 | + * supplying media events. This needs to be set only for non-display ad sessions and can be set to |
| 120 | + * `OMIDNoneOwner` for display. When the creativeType is `OMIDCreativeTypeDefinedByJavaScript` then |
| 121 | + * this should be set to `OMIDJavaScriptOwner` |
| 122 | + * @param isolateVerificationScripts determines whether verification scripts will be placed in a |
| 123 | + * sandboxed environment. This will not have any effect for native sessions. |
| 124 | + * @return A new session configuration instance. Returns nil and sets error if OM SDK isn't active |
| 125 | + * or arguments are invalid. |
| 126 | + */ |
| 127 | +- (nullable instancetype)initWithCreativeType:(OMIDCreativeType)creativeType |
| 128 | + impressionType:(OMIDImpressionType)impressionType |
| 129 | + impressionOwner:(OMIDOwner)impressionOwner |
| 130 | + mediaEventsOwner:(OMIDOwner)mediaEventsOwner |
| 131 | + isolateVerificationScripts:(BOOL)isolateVerificationScripts |
| 132 | + error:(NSError *_Nullable *_Nullable)error; |
| 133 | + |
| 134 | +@end |
| 135 | + |
0 commit comments