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> |
|
22 |
|
9febd9
|
23 |
/** |
W |
24 |
A photo for sharing. |
bad748
|
25 |
*/ |
W |
26 |
@interface FBSDKSharePhoto : NSObject <FBSDKCopying, NSSecureCoding> |
|
27 |
|
9febd9
|
28 |
/** |
W |
29 |
Convenience method to build a new photo object with an image. |
|
30 |
- Parameter image: If the photo is resident in memory, this method supplies the data |
|
31 |
- Parameter userGenerated: Specifies whether the photo represented by the receiver was generated by the user or by the |
bad748
|
32 |
application |
W |
33 |
*/ |
|
34 |
+ (instancetype)photoWithImage:(UIImage *)image userGenerated:(BOOL)userGenerated; |
|
35 |
|
9febd9
|
36 |
/** |
W |
37 |
Convenience method to build a new photo object with an imageURL. |
|
38 |
- Parameter imageURL: The URL to the photo |
|
39 |
- Parameter userGenerated: Specifies whether the photo represented by the receiver was generated by the user or by the |
bad748
|
40 |
application |
9febd9
|
41 |
|
W |
42 |
This method should only be used when adding photo content to open graph stories. |
bad748
|
43 |
For example, if you're trying to share a photo from the web by itself, download the image and use |
W |
44 |
`photoWithImage:userGenerated:` instead. |
|
45 |
*/ |
|
46 |
+ (instancetype)photoWithImageURL:(NSURL *)imageURL userGenerated:(BOOL)userGenerated; |
|
47 |
|
9febd9
|
48 |
/** |
W |
49 |
If the photo is resident in memory, this method supplies the data. |
|
50 |
- Returns: UIImage representation of the photo |
bad748
|
51 |
*/ |
W |
52 |
@property (nonatomic, strong) UIImage *image; |
|
53 |
|
9febd9
|
54 |
/** |
W |
55 |
The URL to the photo. |
|
56 |
- Returns: URL that points to a network location or the location of the photo on disk |
bad748
|
57 |
*/ |
W |
58 |
@property (nonatomic, copy) NSURL *imageURL; |
|
59 |
|
9febd9
|
60 |
/** |
W |
61 |
Specifies whether the photo represented by the receiver was generated by the user or by the application. |
|
62 |
- Returns: YES if the photo is user-generated, otherwise NO |
bad748
|
63 |
*/ |
W |
64 |
@property (nonatomic, assign, getter=isUserGenerated) BOOL userGenerated; |
|
65 |
|
9febd9
|
66 |
/** |
W |
67 |
Compares the receiver to another photo. |
|
68 |
- Parameter photo: The other photo |
|
69 |
- Returns: YES if the receiver's values are equal to the other photo's values; otherwise NO |
bad748
|
70 |
*/ |
W |
71 |
- (BOOL)isEqualToSharePhoto:(FBSDKSharePhoto *)photo; |
|
72 |
|
9febd9
|
73 |
/** |
W |
74 |
The user generated caption for the photo. Note that the 'caption' must come from |
bad748
|
75 |
* the user, as pre-filled content is forbidden by the Platform Policies (2.3). |
9febd9
|
76 |
- Returns: the Photo's caption if exists else returns null. |
bad748
|
77 |
*/ |
W |
78 |
@property (nonatomic, copy) NSString *caption; |
|
79 |
|
|
80 |
|
|
81 |
@end |