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