commit | author | age
|
bad748
|
1 |
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
W |
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 <UIKit/UIKit.h> |
|
20 |
|
|
21 |
#import <FBSDKCoreKit/FBSDKCopying.h> |
e81c27
|
22 |
#import <FBSDKShareKit/FBSDKShareMediaContent.h> |
13e53a
|
23 |
#import <FBSDKShareKit/FBSDKSharingValidation.h> |
e81c27
|
24 |
|
H |
25 |
NS_ASSUME_NONNULL_BEGIN |
13e53a
|
26 |
|
H |
27 |
@class PHAsset; |
bad748
|
28 |
|
9febd9
|
29 |
/** |
W |
30 |
A photo for sharing. |
bad748
|
31 |
*/ |
e81c27
|
32 |
NS_SWIFT_NAME(SharePhoto) |
H |
33 |
@interface FBSDKSharePhoto : NSObject <NSSecureCoding, FBSDKCopying, FBSDKShareMedia, FBSDKSharingValidation> |
bad748
|
34 |
|
9febd9
|
35 |
/** |
W |
36 |
Convenience method to build a new photo object with an image. |
13e53a
|
37 |
@param image If the photo is resident in memory, this method supplies the data |
H |
38 |
@param userGenerated Specifies whether the photo represented by the receiver was generated by the user or by the |
bad748
|
39 |
application |
W |
40 |
*/ |
|
41 |
+ (instancetype)photoWithImage:(UIImage *)image userGenerated:(BOOL)userGenerated; |
|
42 |
|
9febd9
|
43 |
/** |
W |
44 |
Convenience method to build a new photo object with an imageURL. |
13e53a
|
45 |
@param imageURL The URL to the photo |
H |
46 |
@param userGenerated Specifies whether the photo represented by the receiver was generated by the user or by the |
bad748
|
47 |
application |
9febd9
|
48 |
|
W |
49 |
This method should only be used when adding photo content to open graph stories. |
bad748
|
50 |
For example, if you're trying to share a photo from the web by itself, download the image and use |
W |
51 |
`photoWithImage:userGenerated:` instead. |
|
52 |
*/ |
|
53 |
+ (instancetype)photoWithImageURL:(NSURL *)imageURL userGenerated:(BOOL)userGenerated; |
|
54 |
|
9febd9
|
55 |
/** |
13e53a
|
56 |
Convenience method to build a new photo object with a PHAsset. |
H |
57 |
- Parameter photoAsset: The PHAsset that represents the photo in the Photos library. |
|
58 |
- Parameter userGenerated: Specifies whether the photo represented by the receiver was generated by the user or by the |
|
59 |
application |
|
60 |
*/ |
|
61 |
+ (instancetype)photoWithPhotoAsset:(PHAsset *)photoAsset userGenerated:(BOOL)userGenerated; |
|
62 |
|
|
63 |
/** |
9febd9
|
64 |
If the photo is resident in memory, this method supplies the data. |
13e53a
|
65 |
@return UIImage representation of the photo |
bad748
|
66 |
*/ |
e81c27
|
67 |
@property (nonatomic, strong, nullable) UIImage *image; |
bad748
|
68 |
|
9febd9
|
69 |
/** |
W |
70 |
The URL to the photo. |
13e53a
|
71 |
@return URL that points to a network location or the location of the photo on disk |
bad748
|
72 |
*/ |
e81c27
|
73 |
@property (nonatomic, copy, nullable) NSURL *imageURL; |
bad748
|
74 |
|
9febd9
|
75 |
/** |
13e53a
|
76 |
The representation of the photo in the Photos library. |
H |
77 |
- Returns: PHAsset that represents the photo in the Photos library. |
|
78 |
*/ |
e81c27
|
79 |
@property (nonatomic, copy, nullable) PHAsset *photoAsset; |
13e53a
|
80 |
|
H |
81 |
/** |
9febd9
|
82 |
Specifies whether the photo represented by the receiver was generated by the user or by the application. |
13e53a
|
83 |
@return YES if the photo is user-generated, otherwise NO |
bad748
|
84 |
*/ |
W |
85 |
@property (nonatomic, assign, getter=isUserGenerated) BOOL userGenerated; |
|
86 |
|
9febd9
|
87 |
/** |
e81c27
|
88 |
The user generated caption for the photo. Note that the 'caption' must come from |
H |
89 |
* the user, as pre-filled content is forbidden by the Platform Policies (2.3). |
|
90 |
@return the Photo's caption if exists else returns null. |
|
91 |
*/ |
|
92 |
@property (nonatomic, copy, nullable) NSString *caption; |
|
93 |
|
|
94 |
/** |
9febd9
|
95 |
Compares the receiver to another photo. |
13e53a
|
96 |
@param photo The other photo |
H |
97 |
@return YES if the receiver's values are equal to the other photo's values; otherwise NO |
bad748
|
98 |
*/ |
W |
99 |
- (BOOL)isEqualToSharePhoto:(FBSDKSharePhoto *)photo; |
|
100 |
|
|
101 |
|
|
102 |
@end |
e81c27
|
103 |
|
H |
104 |
NS_ASSUME_NONNULL_END |