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