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