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/FBSDKSharingContent.h> |
|
22 |
|
|
23 |
@protocol FBSDKSharingDelegate; |
|
24 |
|
9febd9
|
25 |
/** |
W |
26 |
The common interface for components that initiate sharing. |
|
27 |
|
13e53a
|
28 |
@see FBSDKShareDialog |
9febd9
|
29 |
|
13e53a
|
30 |
@see FBSDKMessageDialog |
9febd9
|
31 |
|
13e53a
|
32 |
@see FBSDKShareAPI |
bad748
|
33 |
*/ |
W |
34 |
@protocol FBSDKSharing <NSObject> |
|
35 |
|
9febd9
|
36 |
/** |
W |
37 |
The receiver's delegate or nil if it doesn't have a delegate. |
bad748
|
38 |
*/ |
W |
39 |
@property (nonatomic, weak) id<FBSDKSharingDelegate> delegate; |
|
40 |
|
9febd9
|
41 |
/** |
W |
42 |
The content to be shared. |
bad748
|
43 |
*/ |
W |
44 |
@property (nonatomic, copy) id<FBSDKSharingContent> shareContent; |
|
45 |
|
9febd9
|
46 |
/** |
W |
47 |
A Boolean value that indicates whether the receiver should fail if it finds an error with the share content. |
|
48 |
|
|
49 |
If NO, the sharer will still be displayed without the data that was mis-configured. For example, an |
bad748
|
50 |
invalid placeID specified on the shareContent would produce a data error. |
W |
51 |
*/ |
|
52 |
@property (nonatomic, assign) BOOL shouldFailOnDataError; |
|
53 |
|
9febd9
|
54 |
/** |
W |
55 |
Validates the content on the receiver. |
13e53a
|
56 |
@param errorRef If an error occurs, upon return contains an NSError object that describes the problem. |
H |
57 |
@return YES if the content is valid, otherwise NO. |
bad748
|
58 |
*/ |
W |
59 |
- (BOOL)validateWithError:(NSError **)errorRef; |
|
60 |
|
|
61 |
@end |
|
62 |
|
9febd9
|
63 |
/** |
W |
64 |
The common interface for dialogs that initiate sharing. |
bad748
|
65 |
*/ |
W |
66 |
@protocol FBSDKSharingDialog <FBSDKSharing> |
|
67 |
|
9febd9
|
68 |
/** |
W |
69 |
A Boolean value that indicates whether the receiver can initiate a share. |
|
70 |
|
|
71 |
May return NO if the appropriate Facebook app is not installed and is required or an access token is |
bad748
|
72 |
required but not available. This method does not validate the content on the receiver, so this can be checked before |
W |
73 |
building up the content. |
9febd9
|
74 |
|
13e53a
|
75 |
@see [FBSDKSharing validateWithError:] |
H |
76 |
@return YES if the receiver can share, otherwise NO. |
bad748
|
77 |
*/ |
13e53a
|
78 |
@property (nonatomic, readonly) BOOL canShow; |
bad748
|
79 |
|
9febd9
|
80 |
/** |
W |
81 |
Shows the dialog. |
13e53a
|
82 |
@return YES if the receiver was able to begin sharing, otherwise NO. |
bad748
|
83 |
*/ |
W |
84 |
- (BOOL)show; |
|
85 |
|
|
86 |
@end |
|
87 |
|
9febd9
|
88 |
/** |
W |
89 |
A delegate for FBSDKSharing. |
|
90 |
|
|
91 |
The delegate is notified with the results of the sharer as long as the application has permissions to |
bad748
|
92 |
receive the information. For example, if the person is not signed into the containing app, the sharer may not be able |
W |
93 |
to distinguish between completion of a share and cancellation. |
|
94 |
*/ |
|
95 |
@protocol FBSDKSharingDelegate <NSObject> |
|
96 |
|
9febd9
|
97 |
/** |
W |
98 |
Sent to the delegate when the share completes without error or cancellation. |
13e53a
|
99 |
@param sharer The FBSDKSharing that completed. |
H |
100 |
@param results The results from the sharer. This may be nil or empty. |
bad748
|
101 |
*/ |
W |
102 |
- (void)sharer:(id<FBSDKSharing>)sharer didCompleteWithResults:(NSDictionary *)results; |
|
103 |
|
9febd9
|
104 |
/** |
W |
105 |
Sent to the delegate when the sharer encounters an error. |
13e53a
|
106 |
@param sharer The FBSDKSharing that completed. |
H |
107 |
@param error The error. |
bad748
|
108 |
*/ |
W |
109 |
- (void)sharer:(id<FBSDKSharing>)sharer didFailWithError:(NSError *)error; |
|
110 |
|
9febd9
|
111 |
/** |
W |
112 |
Sent to the delegate when the sharer is cancelled. |
13e53a
|
113 |
@param sharer The FBSDKSharing that completed. |
bad748
|
114 |
*/ |
W |
115 |
- (void)sharerDidCancel:(id<FBSDKSharing>)sharer; |
|
116 |
|
|
117 |
@end |