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/FBSDKGameRequestContent.h> |
|
22 |
|
|
23 |
@protocol FBSDKGameRequestDialogDelegate; |
|
24 |
|
9febd9
|
25 |
/** |
W |
26 |
A dialog for sending game requests. |
bad748
|
27 |
*/ |
W |
28 |
@interface FBSDKGameRequestDialog : NSObject |
|
29 |
|
9febd9
|
30 |
/** |
W |
31 |
Convenience method to build up a game request with content and a delegate. |
|
32 |
- Parameter content: The content for the game request. |
|
33 |
- Parameter delegate: The receiver's delegate. |
bad748
|
34 |
*/ |
W |
35 |
+ (instancetype)showWithContent:(FBSDKGameRequestContent *)content delegate:(id<FBSDKGameRequestDialogDelegate>)delegate; |
|
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<FBSDKGameRequestDialogDelegate> delegate; |
|
41 |
|
9febd9
|
42 |
/** |
W |
43 |
The content for game request. |
bad748
|
44 |
*/ |
W |
45 |
@property (nonatomic, copy) FBSDKGameRequestContent *content; |
|
46 |
|
9febd9
|
47 |
/** |
W |
48 |
Specifies whether frictionless requests are enabled. |
bad748
|
49 |
*/ |
W |
50 |
@property (nonatomic, assign) BOOL frictionlessRequestsEnabled; |
|
51 |
|
9febd9
|
52 |
/** |
W |
53 |
A Boolean value that indicates whether the receiver can initiate a game request. |
|
54 |
|
|
55 |
May return NO if the appropriate Facebook app is not installed and is required or an access token is |
bad748
|
56 |
required but not available. This method does not validate the content on the receiver, so this can be checked before |
W |
57 |
building up the content. |
9febd9
|
58 |
|
W |
59 |
- See:validateWithError: |
|
60 |
- Returns: YES if the receiver can share, otherwise NO. |
bad748
|
61 |
*/ |
W |
62 |
- (BOOL)canShow; |
|
63 |
|
9febd9
|
64 |
/** |
W |
65 |
Begins the game request from the receiver. |
|
66 |
- Returns: YES if the receiver was able to show the dialog, otherwise NO. |
bad748
|
67 |
*/ |
W |
68 |
- (BOOL)show; |
|
69 |
|
9febd9
|
70 |
/** |
W |
71 |
Validates the content on the receiver. |
|
72 |
- Parameter errorRef: If an error occurs, upon return contains an NSError object that describes the problem. |
|
73 |
- Returns: YES if the content is valid, otherwise NO. |
bad748
|
74 |
*/ |
W |
75 |
- (BOOL)validateWithError:(NSError *__autoreleasing *)errorRef; |
|
76 |
|
|
77 |
@end |
|
78 |
|
9febd9
|
79 |
/** |
W |
80 |
A delegate for FBSDKGameRequestDialog. |
|
81 |
|
|
82 |
The delegate is notified with the results of the game request as long as the application has permissions to |
bad748
|
83 |
receive the information. For example, if the person is not signed into the containing app, the shower may not be able |
W |
84 |
to distinguish between completion of a game request and cancellation. |
|
85 |
*/ |
|
86 |
@protocol FBSDKGameRequestDialogDelegate <NSObject> |
|
87 |
|
9febd9
|
88 |
/** |
W |
89 |
Sent to the delegate when the game request completes without error. |
|
90 |
- Parameter gameRequestDialog: The FBSDKGameRequestDialog that completed. |
|
91 |
- Parameter results: The results from the dialog. This may be nil or empty. |
bad748
|
92 |
*/ |
W |
93 |
- (void)gameRequestDialog:(FBSDKGameRequestDialog *)gameRequestDialog didCompleteWithResults:(NSDictionary *)results; |
|
94 |
|
9febd9
|
95 |
/** |
W |
96 |
Sent to the delegate when the game request encounters an error. |
|
97 |
- Parameter gameRequestDialog: The FBSDKGameRequestDialog that completed. |
|
98 |
- Parameter error: The error. |
bad748
|
99 |
*/ |
W |
100 |
- (void)gameRequestDialog:(FBSDKGameRequestDialog *)gameRequestDialog didFailWithError:(NSError *)error; |
|
101 |
|
9febd9
|
102 |
/** |
W |
103 |
Sent to the delegate when the game request dialog is cancelled. |
|
104 |
- Parameter gameRequestDialog: The FBSDKGameRequestDialog that completed. |
bad748
|
105 |
*/ |
W |
106 |
- (void)gameRequestDialogDidCancel:(FBSDKGameRequestDialog *)gameRequestDialog; |
|
107 |
|
|
108 |
@end |