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