commit | author | age
|
dcdc07
|
1 |
// |
W |
2 |
// WASocialProxy.h |
|
3 |
// WASdkIntfUI |
|
4 |
// |
|
5 |
// Created by GHW-T-01 on 16/3/1. |
|
6 |
// Copyright © 2016年 GHW-T-01. All rights reserved. |
|
7 |
// |
|
8 |
|
|
9 |
#import <Foundation/Foundation.h> |
|
10 |
|
|
11 |
@protocol WASharingDelegate,WASharingContent,WAAppInviteDialogDelegate,WAGameRequestDialogDelegate; |
|
12 |
@class WAAppInviteContent,WAGameRequestContent,WAAppUser,WAFBObject,WAFBAppRequest; |
|
13 |
/*! |
|
14 |
@discussion The common interface for components that initiate sharing. |
|
15 |
*/ |
|
16 |
@protocol WASharing <NSObject> |
|
17 |
|
|
18 |
/*! |
|
19 |
@abstract The receiver's delegate or nil if it doesn't have a delegate. |
|
20 |
*/ |
|
21 |
@property (nonatomic, weak) NSObject<WASharingDelegate>* delegate; |
|
22 |
|
|
23 |
/*! |
|
24 |
@abstract The content to be shared. |
|
25 |
*/ |
|
26 |
@property (nonatomic, strong) NSObject<WASharingContent>* shareContent; |
|
27 |
|
|
28 |
/*! |
|
29 |
@abstract A Boolean value that indicates whether the receiver should fail if it finds an error with the share content. |
|
30 |
@discussion If NO, the sharer will still be displayed without the data that was mis-configured. For example, an |
|
31 |
invalid placeID specified on the shareContent would produce a data error. |
|
32 |
*/ |
|
33 |
@property (nonatomic, assign) BOOL shouldFailOnDataError; |
|
34 |
|
|
35 |
|
|
36 |
@end |
|
37 |
|
|
38 |
/*! |
|
39 |
@discussion The common interface for dialogs that initiate sharing. |
|
40 |
- - - |
|
41 |
*/ |
|
42 |
@protocol WASharingDialog <WASharing> |
|
43 |
|
|
44 |
/*! |
|
45 |
@abstract A Boolean value that indicates whether the receiver can initiate a share. |
|
46 |
@discussion May return NO if the appropriate Facebook app is not installed and is required or an access token is |
|
47 |
required but not available. This method does not validate the content on the receiver, so this can be checked before |
|
48 |
building up the content. |
|
49 |
@see [WASharing validateWithError:] |
|
50 |
@result YES if the receiver can share, otherwise NO. |
|
51 |
*/ |
|
52 |
- (BOOL)canShow; |
|
53 |
|
|
54 |
/*! |
|
55 |
@abstract Shows the dialog. |
|
56 |
@result YES if the receiver was able to begin sharing, otherwise NO. |
|
57 |
*/ |
|
58 |
- (BOOL)show; |
|
59 |
|
|
60 |
@end |
|
61 |
|
|
62 |
/*! |
|
63 |
@abstract A delegate for WASharing. |
|
64 |
@discussion The delegate is notified with the results of the sharer as long as the application has permissions to |
|
65 |
receive the information. For example, if the person is not signed into the containing app, the sharer may not be able |
|
66 |
to distinguish between completion of a share and cancellation. |
|
67 |
*/ |
|
68 |
@protocol WASharingDelegate <NSObject> |
|
69 |
|
|
70 |
/*! |
|
71 |
@abstract Sent to the delegate when the share completes without error or cancellation. |
|
72 |
@param sharer The WASharing that completed. |
|
73 |
@param platform The platform that the sharing from |
|
74 |
@param results The results from the sharer. This may be nil or empty. |
|
75 |
*/ |
|
76 |
- (void)sharer:(NSObject<WASharing>*)sharer platform:(NSString *const)platform didCompleteWithResults:(NSDictionary *)results; |
|
77 |
|
|
78 |
/*! |
|
79 |
@abstract Sent to the delegate when the sharer encounters an error. |
|
80 |
@param sharer The WASharing that completed. |
|
81 |
@param platform The platform that the sharing from |
|
82 |
@param error The error. |
|
83 |
*/ |
|
84 |
- (void)sharer:(NSObject<WASharing>*)sharer platform:(NSString *const)platform didFailWithError:(NSError *)error; |
|
85 |
|
|
86 |
/*! |
|
87 |
@abstract Sent to the delegate when the sharer is cancelled. |
|
88 |
@param sharer The WASharing that completed. |
|
89 |
@param platform The platform that the sharing from |
|
90 |
*/ |
|
91 |
- (void)sharerDidCancel:(NSObject<WASharing>*)sharer platform:(NSString *const)platform; |
|
92 |
@end |
|
93 |
|
|
94 |
/*! |
|
95 |
@discussion WASocialProxy 该类用来做分享、游戏邀请、收发礼物等。 |
|
96 |
- - - |
|
97 |
*/ |
|
98 |
@interface WASocialProxy : NSObject |
|
99 |
/*! |
|
100 |
#分享调用方法 |
|
101 |
*/ |
|
102 |
/*! |
|
103 |
@abstract 分享调用方法 |
|
104 |
@param platform 平台 |
|
105 |
@param shareContent 分享内容 |
|
106 |
@param delegate 委托 |
|
107 |
*/ |
|
108 |
+(void)shareWithPlatform:(NSString *const)platform shareContent:(NSObject<WASharingContent>*)shareContent shareWithUI:(BOOL)shareWithUI delegate:(NSObject<WASharingDelegate>*)delegate; |
|
109 |
/*! |
|
110 |
@abstract 应用邀请调用方法 |
|
111 |
@param content 内容 |
|
112 |
@param delegate 委托 |
|
113 |
*/ |
|
114 |
+(void)appInviteWithPlatform:(NSString *const)platform Content:(WAAppInviteContent*)content delegate:(NSObject<WAAppInviteDialogDelegate>*)delegate; |
|
115 |
/*! |
|
116 |
@abstract Game Service - 获取可邀请好友列表 |
|
117 |
@param duration 邀请有效时段,既是邀请好友成功之后,该好友在有效时段之内,不会再出现在可邀请好友列表之中.单位为分钟,不设置默认为0. |
|
118 |
@param platform 平台 |
|
119 |
@param block 回调 |
|
120 |
*/ |
|
121 |
+(void)queryInvitableFriendsWithDuration:(float)duration platform:(NSString *const)platform completeBlock:(void(^)(NSArray* friends,NSError *error))block; |
|
122 |
/*! |
|
123 |
@abstract Game Service - 向好友发送邀请 |
|
124 |
@param content 内容 |
|
125 |
@param delegate 委托 |
|
126 |
*/ |
|
127 |
+(void)gameInviteWithPlatform:(NSString *const)platform Content:(WAGameRequestContent*)content delegate:(NSObject<WAGameRequestDialogDelegate>*)delegate; |
|
128 |
/*! |
|
129 |
@abstract Game Service - 查询赠送/索要礼物的好友列表 |
|
130 |
@param platform 平台 |
|
131 |
@param block 回调 |
|
132 |
*/ |
|
133 |
+(void)queryFriendsWithPlatform:(NSString *const)platform completeBlock:(void(^)(NSArray* friends,NSError *error))block ; |
|
134 |
/*! |
|
135 |
@abstract 获取当前App所属的group |
|
136 |
@param platform 平台 |
|
137 |
@param block 回调 |
|
138 |
*/ |
|
139 |
+(void)getCurrentAppLinkedGroupWithPlatfrom:(NSString *const)platform extInfo:(NSString*)extInfo completeBlock:(void(^)(NSArray* groups,NSError* error))block; |
|
140 |
/*! |
|
141 |
@abstract 获取当前user所属的group |
|
142 |
@param platform 平台 |
|
143 |
@param block 回调 |
|
144 |
*/ |
|
145 |
+(void)getCurrentUserGroupWithPlatfrom:(NSString *const)platform extInfo:(NSString*)extInfo completeBlock:(void(^)(NSArray* groups,NSError* error))block; |
|
146 |
|
|
147 |
/*! |
|
148 |
@abstract 根据groupId查询对应的group |
|
149 |
@param platform 平台 |
|
150 |
@param groupIds groupId数组 |
|
151 |
@param block 回调 |
|
152 |
*/ |
|
153 |
+(void)getGroupWithPlatform:(NSString *const)platform groupIds:(NSArray*)groupIds extInfo:(NSString*)extInfo completeBlock:(void(^)(NSArray* groups,NSError* error))block; |
|
154 |
|
|
155 |
/*! |
|
156 |
@abstract 返回当前应用推荐的所有group |
|
157 |
@param platform 平台 |
|
158 |
@param extInfo 扩展字段 |
|
159 |
@param block 回调 |
|
160 |
*/ |
|
161 |
+(void)getGroupsWithPlatform:(NSString *const)platform extInfo:(NSString*)extInfo completeBlock:(void(^)(NSArray* groups,NSError* error))block; |
|
162 |
|
|
163 |
/*! |
|
164 |
@abstract 加入group |
|
165 |
@param platform 平台 |
|
166 |
@param groupId group标识 |
|
167 |
@param extInfo 扩展信息 |
|
168 |
@param block 回调 |
|
169 |
*/ |
|
170 |
+(void)joinGroupWithPlatform:(NSString *const)platform groupId:(NSString*)groupId extInfo:(NSString *const)extInfo completeBlock:(void(^)(NSError* error))block; |
|
171 |
|
|
172 |
/*! |
|
173 |
@abstract 打开group |
|
174 |
@param platform 平台 |
962836
|
175 |
@param groupUri 组Uri |
dcdc07
|
176 |
@param extInfo 扩展信息 |
W |
177 |
*/ |
|
178 |
+(void)openGroupPageWithPlatform:(NSString *const)platform groupUri:(NSString *const)groupUri extInfo:(NSString*)extInfo; |
|
179 |
|
|
180 |
/*! |
|
181 |
@abstract Game Service - 查询礼物列表 |
|
182 |
@param objectType 内容 |
|
183 |
@param block 回调 |
|
184 |
*/ |
|
185 |
+(void)queryFBGraphObjectsWithObjectType:(NSString*)objectType completeBlock:(void(^)(NSArray<WAFBObject*>* objects,NSError *error))block; |
|
186 |
/*! |
|
187 |
@abstract Game Service - 赠送礼物 |
|
188 |
@param content 内容 |
|
189 |
@param delegate 委托 |
|
190 |
*/ |
|
191 |
+(void)fbSendGiftWithContent:(WAGameRequestContent*)content delegate:(NSObject<WAGameRequestDialogDelegate>*)delegate; |
|
192 |
|
|
193 |
/*! |
|
194 |
@abstract Game Service - 索要礼物 |
|
195 |
@param content 内容 |
|
196 |
@param delegate 委托 |
|
197 |
*/ |
|
198 |
+(void)fbAskForGiftWithContent:(WAGameRequestContent*)content delegate:(NSObject<WAGameRequestDialogDelegate>*)delegate; |
|
199 |
/*! |
|
200 |
@abstract Game Service - 查看收到的礼物 |
|
201 |
@param block 回调 |
|
202 |
*/ |
|
203 |
+(void)fbQueryReceivedGiftsWithCompleteBlock:(void(^)(NSArray<WAFBAppRequest *>* gifts,NSError *error))block; |
|
204 |
/*! |
|
205 |
@abstract Game Service - 查看好友向自己索要礼物请求 |
|
206 |
@param block 回调 |
|
207 |
*/ |
|
208 |
+(void)fbQueryAskForGiftRequestsWithCompleteBlock:(void(^)(NSArray<WAFBAppRequest *>* requests,NSError *error))block; |
|
209 |
/*! |
|
210 |
@abstract Game Service - 删除请求 |
|
211 |
@param block 回调 |
|
212 |
*/ |
|
213 |
+(void)fbDeleteRequestWithRequestId:(NSString*)requestId completeBlock:(void(^)(id result,NSError *error))block; |
|
214 |
|
|
215 |
|
|
216 |
/*! |
|
217 |
@abstract 此方法用来取代gameInviteWithPlatform,fbSendGiftWithContent,fbAskForGiftWithContent |
|
218 |
@param platform 平台 |
|
219 |
@param requestType 请求类型 |
|
220 |
@param title 标题 |
|
221 |
@param message 信息 |
962836
|
222 |
@param objectId 对象id |
dcdc07
|
223 |
@param receiptIds 接受者id |
W |
224 |
@param delegate 委托 |
|
225 |
*/ |
|
226 |
+(void)sendRequestWithPlatform:(NSString *const)platform requestType:(NSString *const)requestType title:(NSString*)title message:(NSString*)message objectId:(NSString*)objectId receiptIds:(NSArray*)receiptIds delegate:(NSObject<WAGameRequestDialogDelegate>*)delegate; |
|
227 |
|
|
228 |
/*! |
|
229 |
@abstract 下面的三个方法是关于奖励机制的,邀请奖励,自定义奖励事件 |
|
230 |
@discussion 此方法用来提交Facebook邀请信息 |
|
231 |
@param platform 平台 |
962836
|
232 |
@param results 这是发完邀请请求成功在WAGameRequestDialogDelegate的方法:[- (void)gameRequestDialog:(WAGameRequestDialog *)gameRequestDialog platform:(NSString *const)platform didCompleteWithResults:(NSDictionary *)results]的results |
dcdc07
|
233 |
@param handler 回调block 当code为200时成功 |
W |
234 |
*/ |
|
235 |
+(void)createInviteInfoWithPlatform:(NSString *const)platform results:(NSDictionary*)results handler:(void (^)(NSUInteger code,NSString* msg, NSError* error)) handler; |
|
236 |
/*! |
|
237 |
@discussion 触发Facebook被邀请人安装应用事件接口。在玩家登录facebook或者用facebook账号绑定的时候可以触发安装事件 |
|
238 |
@param platform 平台 |
|
239 |
@param tokenString facebook accesstoken |
|
240 |
@param handler 回调block 当code为200时成功 |
|
241 |
*/ |
|
242 |
+(void)inviteInstallRewardPlatform:(NSString *const)platform TokenString:(NSString*)tokenString handler:(void (^)(NSUInteger code,NSString* msg, NSError* error)) handler; |
|
243 |
/*! |
|
244 |
@discussion 发送Facebook邀请奖励事件统计接口 |
|
245 |
@param platform 平台 |
|
246 |
@param eventName 奖励事件名称 |
|
247 |
@param handler 回调block 当code为200时成功 |
|
248 |
*/ |
|
249 |
+(void)inviteEventRewardWithPlatform:(NSString *const)platform eventName:(NSString*)eventName handler:(void (^)(NSUInteger code,NSString* msg, NSError* error)) handler; |
|
250 |
@end |
|
251 |
|