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