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