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