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 <Foundation/Foundation.h> |
|
20 |
|
|
21 |
#import <FBSDKShareKit/FBSDKShareOpenGraphObject.h> |
|
22 |
#import <FBSDKShareKit/FBSDKSharing.h> |
|
23 |
|
|
24 |
/*! |
|
25 |
@abstract A utility class for sharing through the graph API. Using this class requires an access token in |
|
26 |
[FBSDKAccessToken currentAccessToken] that has been granted the "publish_actions" permission. |
|
27 |
@discussion FBSDKShareAPI network requests are scheduled on the current run loop in the default run loop mode |
|
28 |
(like NSURLConnection). If you want to use FBSDKShareAPI in a background thread, you must manage the run loop |
|
29 |
yourself. |
|
30 |
*/ |
|
31 |
@interface FBSDKShareAPI : NSObject <FBSDKSharing> |
|
32 |
|
|
33 |
/*! |
|
34 |
@abstract Convenience method to build up a share API with content and a delegate. |
|
35 |
@param content The content to be shared. |
|
36 |
@param delegate The receiver's delegate. |
|
37 |
*/ |
|
38 |
+ (instancetype)shareWithContent:(id<FBSDKSharingContent>)content delegate:(id<FBSDKSharingDelegate>)delegate; |
|
39 |
|
|
40 |
/*! |
|
41 |
@abstract The message the person has provided through the custom dialog that will accompany the share content. |
|
42 |
*/ |
|
43 |
@property (nonatomic, copy) NSString *message; |
|
44 |
|
|
45 |
/*! |
|
46 |
@abstract The graph node to which content should be shared. |
|
47 |
*/ |
|
48 |
@property (nonatomic, copy) NSString *graphNode; |
|
49 |
|
|
50 |
/*! |
|
51 |
@abstract A Boolean value that indicates whether the receiver can send the share. |
|
52 |
@discussion May return NO if the appropriate Facebook app is not installed and is required or an access token is |
|
53 |
required but not available. This method does not validate the content on the receiver, so this can be checked before |
|
54 |
building up the content. |
|
55 |
@see [FBSDKSharing validateWithError:] |
|
56 |
@result YES if the receiver can send, otherwise NO. |
|
57 |
*/ |
|
58 |
- (BOOL)canShare; |
|
59 |
|
|
60 |
/*! |
|
61 |
@abstract Creates an User Owned Open Graph object without an action. |
|
62 |
@param openGraphObject The open graph object to create. |
|
63 |
@discussion Use this method to create an object alone, when an action is not going to be posted with the object. If |
|
64 |
the object will be used within an action, just put the object in the action and share that as the shareContent and the |
|
65 |
object will be created in the process. The delegate will be messaged with the results. |
|
66 |
|
|
67 |
Also see https://developers.facebook.com/docs/sharing/opengraph/object-api#objectapi-creatinguser |
|
68 |
|
|
69 |
@result YES if the receiver was able to send the request to create the object, otherwise NO. |
|
70 |
*/ |
|
71 |
- (BOOL)createOpenGraphObject:(FBSDKShareOpenGraphObject *)openGraphObject; |
|
72 |
|
|
73 |
/*! |
|
74 |
@abstract Begins the send from the receiver. |
|
75 |
@result YES if the receiver was able to send the share, otherwise NO. |
|
76 |
*/ |
|
77 |
- (BOOL)share; |
|
78 |
|
|
79 |
@end |