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 <FBSDKCoreKit/FBSDKCopying.h> |
13e53a
|
22 |
#import <FBSDKShareKit/FBSDKSharingValidation.h> |
bad748
|
23 |
|
e81c27
|
24 |
NS_ASSUME_NONNULL_BEGIN |
H |
25 |
|
9febd9
|
26 |
/** |
W |
27 |
NS_ENUM(NSUInteger, FBSDKGameRequestActionType) |
|
28 |
Additional context about the nature of the request. |
bad748
|
29 |
*/ |
W |
30 |
typedef NS_ENUM(NSUInteger, FBSDKGameRequestActionType) |
|
31 |
{ |
9febd9
|
32 |
/** No action type */ |
bad748
|
33 |
FBSDKGameRequestActionTypeNone = 0, |
9febd9
|
34 |
/** Send action type: The user is sending an object to the friends. */ |
bad748
|
35 |
FBSDKGameRequestActionTypeSend, |
9febd9
|
36 |
/** Ask For action type: The user is asking for an object from friends. */ |
bad748
|
37 |
FBSDKGameRequestActionTypeAskFor, |
9febd9
|
38 |
/** Turn action type: It is the turn of the friends to play against the user in a match. (no object) */ |
bad748
|
39 |
FBSDKGameRequestActionTypeTurn, |
e81c27
|
40 |
} NS_SWIFT_NAME(GameRequestActionType); |
bad748
|
41 |
|
9febd9
|
42 |
/** |
W |
43 |
NS_ENUM(NSUInteger, FBSDKGameRequestFilters) |
|
44 |
Filter for who can be displayed in the multi-friend selector. |
bad748
|
45 |
*/ |
W |
46 |
typedef NS_ENUM(NSUInteger, FBSDKGameRequestFilter) |
|
47 |
{ |
9febd9
|
48 |
/** No filter, all friends can be displayed. */ |
bad748
|
49 |
FBSDKGameRequestFilterNone = 0, |
9febd9
|
50 |
/** Friends using the app can be displayed. */ |
bad748
|
51 |
FBSDKGameRequestFilterAppUsers, |
9febd9
|
52 |
/** Friends not using the app can be displayed. */ |
bad748
|
53 |
FBSDKGameRequestFilterAppNonUsers, |
e81c27
|
54 |
} NS_SWIFT_NAME(GameRequestFilter); |
bad748
|
55 |
|
9febd9
|
56 |
/** |
W |
57 |
A model for a game request. |
bad748
|
58 |
*/ |
e81c27
|
59 |
NS_SWIFT_NAME(GameRequestContent) |
13e53a
|
60 |
@interface FBSDKGameRequestContent : NSObject <FBSDKCopying, FBSDKSharingValidation, NSSecureCoding> |
bad748
|
61 |
|
9febd9
|
62 |
/** |
W |
63 |
Used when defining additional context about the nature of the request. |
|
64 |
|
|
65 |
The parameter 'objectID' is required if the action type is either |
bad748
|
66 |
'FBSDKGameRequestSendActionType' or 'FBSDKGameRequestAskForActionType'. |
9febd9
|
67 |
|
W |
68 |
- SeeAlso:objectID |
bad748
|
69 |
*/ |
W |
70 |
@property (nonatomic, assign) FBSDKGameRequestActionType actionType; |
|
71 |
|
9febd9
|
72 |
/** |
W |
73 |
Compares the receiver to another game request content. |
13e53a
|
74 |
@param content The other content |
H |
75 |
@return YES if the receiver's values are equal to the other content's values; otherwise NO |
bad748
|
76 |
*/ |
W |
77 |
- (BOOL)isEqualToGameRequestContent:(FBSDKGameRequestContent *)content; |
|
78 |
|
9febd9
|
79 |
/** |
W |
80 |
Additional freeform data you may pass for tracking. This will be stored as part of |
bad748
|
81 |
the request objects created. The maximum length is 255 characters. |
W |
82 |
*/ |
e81c27
|
83 |
@property (nonatomic, copy, nullable) NSString *data; |
bad748
|
84 |
|
9febd9
|
85 |
/** |
W |
86 |
This controls the set of friends someone sees if a multi-friend selector is shown. |
bad748
|
87 |
It is FBSDKGameRequestNoFilter by default, meaning that all friends can be shown. |
W |
88 |
If specify as FBSDKGameRequestAppUsersFilter, only friends who use the app will be shown. |
|
89 |
On the other hands, use FBSDKGameRequestAppNonUsersFilter to filter only friends who do not use the app. |
9febd9
|
90 |
|
W |
91 |
The parameter name is preserved to be consistent with the counter part on desktop. |
bad748
|
92 |
*/ |
W |
93 |
@property (nonatomic, assign) FBSDKGameRequestFilter filters; |
|
94 |
|
9febd9
|
95 |
/** |
W |
96 |
A plain-text message to be sent as part of the request. This text will surface in the App Center view |
bad748
|
97 |
of the request, but not on the notification jewel. Required parameter. |
W |
98 |
*/ |
|
99 |
@property (nonatomic, copy) NSString *message; |
|
100 |
|
9febd9
|
101 |
/** |
W |
102 |
The Open Graph object ID of the object being sent. |
|
103 |
|
|
104 |
- SeeAlso:actionType |
bad748
|
105 |
*/ |
W |
106 |
@property (nonatomic, copy) NSString *objectID; |
|
107 |
|
9febd9
|
108 |
/** |
W |
109 |
An array of user IDs, usernames or invite tokens (NSString) of people to send request. |
|
110 |
|
|
111 |
These may or may not be a friend of the sender. If this is specified by the app, |
bad748
|
112 |
the sender will not have a choice of recipients. If not, the sender will see a multi-friend selector |
W |
113 |
|
|
114 |
This is equivalent to the "to" parameter when using the web game request dialog. |
|
115 |
*/ |
e81c27
|
116 |
@property (nonatomic, copy) NSArray<NSString *> *recipients; |
bad748
|
117 |
|
9febd9
|
118 |
/** |
W |
119 |
An array of user IDs that will be included in the dialog as the first suggested friends. |
bad748
|
120 |
Cannot be used together with filters. |
9febd9
|
121 |
|
W |
122 |
This is equivalent to the "suggestions" parameter when using the web game request dialog. |
bad748
|
123 |
*/ |
e81c27
|
124 |
@property (nonatomic, copy) NSArray<NSString *> *recipientSuggestions; |
bad748
|
125 |
|
9febd9
|
126 |
/** |
W |
127 |
The title for the dialog. |
bad748
|
128 |
*/ |
W |
129 |
@property (nonatomic, copy) NSString *title; |
|
130 |
|
|
131 |
@end |
e81c27
|
132 |
|
H |
133 |
NS_ASSUME_NONNULL_END |