commit | author | age
|
27832c
|
1 |
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
H |
2 |
// |
|
3 |
// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
|
4 |
// copy, modify, and distribute this software in source code or binary form for use |
|
5 |
// in connection with the web services and APIs provided by Facebook. |
|
6 |
// |
|
7 |
// As with any software that integrates with the Facebook platform, your use of |
|
8 |
// this software is subject to the Facebook Developer Principles and Policies |
|
9 |
// [http://developers.facebook.com/policy/]. This copyright notice shall be |
|
10 |
// included in all copies or substantial portions of the software. |
|
11 |
// |
|
12 |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
13 |
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
|
14 |
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
|
15 |
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
|
16 |
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
|
17 |
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|
18 |
|
|
19 |
#import <Foundation/Foundation.h> |
|
20 |
|
|
21 |
#import <FBSDKShareKit/FBSDKShareMessengerActionButton.h> |
|
22 |
#import <FBSDKShareKit/FBSDKSharingContent.h> |
|
23 |
|
e81c27
|
24 |
NS_ASSUME_NONNULL_BEGIN |
H |
25 |
|
27832c
|
26 |
typedef NS_ENUM(NSUInteger, FBSDKShareMessengerMediaTemplateMediaType) { |
H |
27 |
FBSDKShareMessengerMediaTemplateMediaTypeImage = 0, |
|
28 |
FBSDKShareMessengerMediaTemplateMediaTypeVideo |
e81c27
|
29 |
} NS_SWIFT_NAME(ShareMessengerMediaTemplateMediaType); |
27832c
|
30 |
|
H |
31 |
/** |
|
32 |
A model for sharing media template content. See |
|
33 |
https://developers.facebook.com/docs/messenger-platform/send-messages/template/media for details. |
|
34 |
*/ |
e81c27
|
35 |
NS_SWIFT_NAME(ShareMessengerMediaTemplateContent) |
27832c
|
36 |
@interface FBSDKShareMessengerMediaTemplateContent : NSObject <FBSDKSharingContent> |
e81c27
|
37 |
|
H |
38 |
- (instancetype)init NS_UNAVAILABLE; |
|
39 |
+ (instancetype)new NS_UNAVAILABLE; |
27832c
|
40 |
|
H |
41 |
/** |
|
42 |
The media type (image or video) for this content. This must match the media type specified in the |
|
43 |
attachmentID/mediaURL to avoid an error when sharing. Defaults to image. |
|
44 |
*/ |
|
45 |
@property (nonatomic, assign) FBSDKShareMessengerMediaTemplateMediaType mediaType; |
|
46 |
|
|
47 |
/** |
|
48 |
The attachmentID of the item to share. Optional, but either attachmentID or mediaURL must be specified. |
|
49 |
*/ |
e81c27
|
50 |
@property (nonatomic, copy, readonly, nullable) NSString *attachmentID; |
27832c
|
51 |
|
H |
52 |
/** |
|
53 |
The Facebook url for this piece of media. External urls will not work; this must be a Facebook url. |
|
54 |
See https://developers.facebook.com/docs/messenger-platform/send-messages/template/media for details. |
|
55 |
Optional, but either attachmentID or mediaURL must be specified. |
|
56 |
*/ |
e81c27
|
57 |
@property (nonatomic, copy, readonly, nullable) NSURL *mediaURL; |
27832c
|
58 |
|
H |
59 |
/** |
|
60 |
This specifies what action button to show below the media. Optional. |
|
61 |
*/ |
e81c27
|
62 |
@property (nonatomic, copy, nullable) id<FBSDKShareMessengerActionButton> button; |
27832c
|
63 |
|
H |
64 |
/** |
|
65 |
Custom initializer to create media template share with attachment id. |
|
66 |
*/ |
|
67 |
- (instancetype)initWithAttachmentID:(NSString *)attachmentID; |
|
68 |
|
|
69 |
/** |
|
70 |
Custom initializer to create media template share with media url. This must be a Facebook url |
|
71 |
and cannot be an external url. |
|
72 |
*/ |
|
73 |
- (instancetype)initWithMediaURL:(NSURL *)mediaURL; |
|
74 |
|
|
75 |
@end |
e81c27
|
76 |
|
H |
77 |
NS_ASSUME_NONNULL_END |