commit | author | age
|
2e29a3
|
1 |
/* |
L |
2 |
* Copyright (c) Meta Platforms, Inc. and affiliates. |
|
3 |
* All rights reserved. |
|
4 |
* |
|
5 |
* This source code is licensed under the license found in the |
|
6 |
* LICENSE file in the root directory of this source tree. |
|
7 |
*/ |
|
8 |
|
|
9 |
#if !TARGET_OS_TV |
|
10 |
|
|
11 |
#import <Foundation/Foundation.h> |
|
12 |
|
|
13 |
#import <FBSDKShareKit/FBSDKGameRequestContent.h> |
|
14 |
|
|
15 |
NS_ASSUME_NONNULL_BEGIN |
|
16 |
|
|
17 |
@protocol FBSDKGameRequestDialogDelegate; |
|
18 |
|
|
19 |
/** |
|
20 |
A dialog for sending game requests. |
|
21 |
*/ |
|
22 |
NS_SWIFT_NAME(GameRequestDialog) |
|
23 |
@interface FBSDKGameRequestDialog : NSObject |
|
24 |
|
|
25 |
- (instancetype)init NS_DESIGNATED_INITIALIZER |
|
26 |
NS_SWIFT_UNAVAILABLE("Use init(content:delegate:) instead"); |
|
27 |
+ (instancetype)new NS_UNAVAILABLE; |
|
28 |
|
|
29 |
/** |
|
30 |
Convenience method to build up a game request with content and a delegate. |
|
31 |
@param content The content for the game request. |
|
32 |
@param delegate The receiver's delegate. |
|
33 |
*/ |
|
34 |
|
|
35 |
// UNCRUSTIFY_FORMAT_OFF |
|
36 |
+ (instancetype)dialogWithContent:(FBSDKGameRequestContent *)content |
|
37 |
delegate:(nullable id<FBSDKGameRequestDialogDelegate>)delegate |
|
38 |
NS_SWIFT_NAME(init(content:delegate:)); |
|
39 |
// UNCRUSTIFY_FORMAT_ON |
|
40 |
|
|
41 |
/** |
|
42 |
Convenience method to build up and show a game request with content and a delegate. |
|
43 |
@param content The content for the game request. |
|
44 |
@param delegate The receiver's delegate. |
|
45 |
*/ |
|
46 |
+ (instancetype)showWithContent:(FBSDKGameRequestContent *)content |
|
47 |
delegate:(nullable id<FBSDKGameRequestDialogDelegate>)delegate |
|
48 |
NS_SWIFT_UNAVAILABLE("Use init(content:delegate:).show() instead"); |
|
49 |
|
|
50 |
/** |
|
51 |
The receiver's delegate or nil if it doesn't have a delegate. |
|
52 |
*/ |
|
53 |
@property (nullable, nonatomic, weak) id<FBSDKGameRequestDialogDelegate> delegate; |
|
54 |
|
|
55 |
/** |
|
56 |
The content for game request. |
|
57 |
*/ |
|
58 |
@property (nonatomic, copy) FBSDKGameRequestContent *content; |
|
59 |
|
|
60 |
/** |
|
61 |
Specifies whether frictionless requests are enabled. |
|
62 |
*/ |
|
63 |
@property (nonatomic, getter = isFrictionlessRequestsEnabled, assign) BOOL frictionlessRequestsEnabled; |
|
64 |
|
|
65 |
/** |
|
66 |
A Boolean value that indicates whether the receiver can initiate a game request. |
|
67 |
|
|
68 |
May return NO if the appropriate Facebook app is not installed and is required or an access token is |
|
69 |
required but not available. This method does not validate the content on the receiver, so this can be checked before |
|
70 |
building up the content. |
|
71 |
|
|
72 |
@see validateWithError: |
|
73 |
@return YES if the receiver can share, otherwise NO. |
|
74 |
*/ |
|
75 |
@property (nonatomic, readonly) BOOL canShow; |
|
76 |
|
|
77 |
/** |
|
78 |
Begins the game request from the receiver. |
|
79 |
@return YES if the receiver was able to show the dialog, otherwise NO. |
|
80 |
*/ |
|
81 |
- (BOOL)show; |
|
82 |
|
|
83 |
/** |
|
84 |
Validates the content on the receiver. |
|
85 |
@param errorRef If an error occurs, upon return contains an NSError object that describes the problem. |
|
86 |
@return YES if the content is valid, otherwise NO. |
|
87 |
*/ |
|
88 |
- (BOOL)validateWithError:(NSError *__autoreleasing *)errorRef; |
|
89 |
|
|
90 |
@end |
|
91 |
|
|
92 |
NS_ASSUME_NONNULL_END |
|
93 |
|
|
94 |
#endif |