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 |
#import <UIKit/UIKit.h> |
|
21 |
|
|
22 |
#import <FBSDKShareKit/FBSDKAppInviteContent.h> |
|
23 |
|
|
24 |
@protocol FBSDKAppInviteDialogDelegate; |
|
25 |
|
9febd9
|
26 |
/** |
27832c
|
27 |
A dialog for sending App Invites. |
bad748
|
28 |
*/ |
W |
29 |
@interface FBSDKAppInviteDialog : NSObject |
|
30 |
|
9febd9
|
31 |
/** |
27832c
|
32 |
Convenience method to show a FBSDKAppInviteDialog |
13e53a
|
33 |
@param viewController A UIViewController to present the dialog from. |
H |
34 |
@param content The content for the app invite. |
|
35 |
@param delegate The receiver's delegate. |
|
36 |
@warning This method is deprecated. |
27832c
|
37 |
*/ |
bad748
|
38 |
+ (instancetype)showFromViewController:(UIViewController *)viewController |
W |
39 |
withContent:(FBSDKAppInviteContent *)content |
27832c
|
40 |
delegate:(id<FBSDKAppInviteDialogDelegate>)delegate |
13e53a
|
41 |
DEPRECATED_MSG_ATTRIBUTE("App Invites no longer supported"); |
bad748
|
42 |
|
W |
43 |
|
9febd9
|
44 |
/** |
W |
45 |
|
13e53a
|
46 |
@warning use showFromViewController:withContent:delegate: instead |
bad748
|
47 |
*/ |
W |
48 |
+ (instancetype)showWithContent:(FBSDKAppInviteContent *)content delegate:(id<FBSDKAppInviteDialogDelegate>)delegate |
13e53a
|
49 |
DEPRECATED_MSG_ATTRIBUTE("use showFromViewController:withContent:delegate: instead"); |
bad748
|
50 |
|
9febd9
|
51 |
/** |
27832c
|
52 |
A UIViewController to present the dialog from. |
9febd9
|
53 |
|
W |
54 |
If not specified, the top most view controller will be automatically determined as best as possible. |
bad748
|
55 |
*/ |
W |
56 |
@property (nonatomic, weak) UIViewController *fromViewController; |
|
57 |
|
9febd9
|
58 |
/** |
27832c
|
59 |
The receiver's delegate or nil if it doesn't have a delegate. |
bad748
|
60 |
*/ |
W |
61 |
@property (nonatomic, weak) id<FBSDKAppInviteDialogDelegate> delegate; |
|
62 |
|
9febd9
|
63 |
/** |
27832c
|
64 |
The content for app invite. |
bad748
|
65 |
*/ |
W |
66 |
@property (nonatomic, copy) FBSDKAppInviteContent *content; |
|
67 |
|
9febd9
|
68 |
/** |
27832c
|
69 |
A Boolean value that indicates whether the receiver can initiate an app invite. |
9febd9
|
70 |
|
W |
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 validateWithError: |
H |
76 |
@return YES if the receiver can show the dialog, otherwise NO. |
bad748
|
77 |
*/ |
13e53a
|
78 |
@property (nonatomic, readonly) BOOL canShow; |
bad748
|
79 |
|
9febd9
|
80 |
/** |
27832c
|
81 |
Begins the app invite from the receiver. |
13e53a
|
82 |
@return YES if the receiver was able to show the dialog, otherwise NO. |
bad748
|
83 |
*/ |
W |
84 |
- (BOOL)show; |
|
85 |
|
9febd9
|
86 |
/** |
27832c
|
87 |
Validates the content on the receiver. |
13e53a
|
88 |
@param errorRef If an error occurs, upon return contains an NSError object that describes the problem. |
H |
89 |
@return YES if the content is valid, otherwise NO. |
bad748
|
90 |
*/ |
W |
91 |
- (BOOL)validateWithError:(NSError *__autoreleasing *)errorRef; |
|
92 |
|
|
93 |
@end |
|
94 |
|
9febd9
|
95 |
/** |
27832c
|
96 |
A delegate for FBSDKAppInviteDialog. |
9febd9
|
97 |
|
W |
98 |
The delegate is notified with the results of the app invite as long as the application has permissions to |
bad748
|
99 |
receive the information. For example, if the person is not signed into the containing app, the shower may not be able |
W |
100 |
to distinguish between completion of an app invite and cancellation. |
|
101 |
*/ |
|
102 |
@protocol FBSDKAppInviteDialogDelegate <NSObject> |
|
103 |
|
9febd9
|
104 |
/** |
27832c
|
105 |
Sent to the delegate when the app invite completes without error. |
13e53a
|
106 |
@param appInviteDialog The FBSDKAppInviteDialog that completed. |
H |
107 |
@param results The results from the dialog. This may be nil or empty. |
bad748
|
108 |
*/ |
W |
109 |
- (void)appInviteDialog:(FBSDKAppInviteDialog *)appInviteDialog didCompleteWithResults:(NSDictionary *)results; |
|
110 |
|
9febd9
|
111 |
/** |
27832c
|
112 |
Sent to the delegate when the app invite encounters an error. |
13e53a
|
113 |
@param appInviteDialog The FBSDKAppInviteDialog that completed. |
H |
114 |
@param error The error. |
bad748
|
115 |
*/ |
W |
116 |
- (void)appInviteDialog:(FBSDKAppInviteDialog *)appInviteDialog didFailWithError:(NSError *)error; |
|
117 |
|
|
118 |
@end |