| 1 | // |
| 2 | // TWTRCardConfiguration.h |
| 3 | // TwitterKit |
| 4 | // |
| 5 | // Copyright © 2015 Twitter. All rights reserved. |
| 6 | // |
| 7 | |
| 8 | #import <UIKit/UIKit.h> |
| 9 | |
| 10 | NS_ASSUME_NONNULL_BEGIN |
| 11 | |
| 12 | /** |
| 13 | * Enum of the possible Twitter Card types. |
| 14 | */ |
| 15 | typedef NS_ENUM(NSUInteger, TWTRCardType){ |
| 16 | /** |
| 17 | * A Twitter App Card that includes a promotional image. |
| 18 | */ |
| 19 | TWTRCardTypePromoImageApp, |
| 20 | |
| 21 | /** |
| 22 | * An unknown or unsupported Twitter Card type. |
| 23 | */ |
| 24 | TWTRCardTypeUnknown |
| 25 | }; |
| 26 | |
| 27 | /** |
| 28 | * `TWTRCardConfiguration` is the representation of configurations for constructing a Twitter Card. |
| 29 | * |
| 30 | * @see https://dev.twitter.com/cards/overview |
| 31 | */ |
| 32 | @interface TWTRCardConfiguration : NSObject |
| 33 | |
| 34 | /** |
| 35 | * Type of Twitter Card configuration. |
| 36 | */ |
| 37 | @property (nonatomic, readonly) TWTRCardType cardType; |
| 38 | |
| 39 | /** |
| 40 | * Title of the Card. |
| 41 | */ |
| 42 | @property (nonatomic, readonly, copy, nullable) NSString *cardTitle; |
| 43 | |
| 44 | /** |
| 45 | * Description of the Card. |
| 46 | */ |
| 47 | @property (nonatomic, readonly, copy, nullable) NSString *cardDescription; |
| 48 | |
| 49 | /** |
| 50 | * Unique image representing the content. Image dimensions must |
| 51 | * be at least 800px by 320px and the image size cannot exceed 1MB. |
| 52 | * |
| 53 | * Note: For more card information see https://dev.twitter.com/cards/types |
| 54 | */ |
| 55 | @property (nonatomic, readonly, nullable) UIImage *image; |
| 56 | |
| 57 | - (instancetype)init NS_UNAVAILABLE; |
| 58 | |
| 59 | /** |
| 60 | * Creates a new instance of configuration for a Twitter App Promo Card. |
| 61 | * |
| 62 | * @param promoImage (Required) Unique image of the user generated content to be promoted. Must be at least 800 by 320 pixels. |
| 63 | * @param iPhoneAppID (Optional) String representation of your app ID in the App Store (.i.e. "307234931"). Either the `iPhoneAppID` or `iPadAppID` has to be provided. |
| 64 | * @param iPadAppID (Optional) String representation of your app ID in the App Store (.i.e. "307234931"). Either the `iPhoneAppID` or `iPadAppID` has to be provided. |
| 65 | * @param googlePlayAppID (Optional) String representation of your app ID in Google Play (.i.e. "com.android.app") |
| 66 | * |
| 67 | * @return A new instance of `TWTRCardConfiguration` for a Twitter App Card. |
| 68 | */ |
| 69 | + (TWTRCardConfiguration *)appCardConfigurationWithPromoImage:(UIImage *)promoImage iPhoneAppID:(nullable NSString *)iPhoneAppID iPadAppID:(nullable NSString *)iPadAppID googlePlayAppID:(nullable NSString *)googlePlayAppID; |
| 70 | |
| 71 | @end |
| 72 | |
| 73 | NS_ASSUME_NONNULL_END |