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