com.taptap.sdk.relationlite 4.8.1-beta.1 → 4.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,58 @@
1
+ using UnityEngine;
2
+ using UnityEditor;
3
+ using UnityEditor.Callbacks;
4
+ # if UNITY_IOS
5
+ using UnityEditor.iOS.Xcode;
6
+ #endif
7
+ using System.IO;
8
+ using System.Collections.Generic;
9
+ using System.Linq;
10
+ using TapSDK.Core.Editor;
11
+
12
+ #if UNITY_IOS
13
+ public class BuildPostProcessor
14
+ {
15
+ [PostProcessBuild(999)]
16
+ public static void OnPostProcessBuild(BuildTarget buildTarget, string path)
17
+ {
18
+ if (buildTarget == BuildTarget.iOS)
19
+ {
20
+ var projPath = TapSDKCoreCompile.GetProjPath(path);
21
+ var proj = TapSDKCoreCompile.ParseProjPath(projPath);
22
+ var target = TapSDKCoreCompile.GetUnityTarget(proj);
23
+
24
+ if (TapSDKCoreCompile.CheckTarget(target))
25
+ {
26
+ Debug.LogError("Unity-iPhone is NUll");
27
+ return;
28
+ }
29
+ if (TapSDKCoreCompile.HandlerIOSSetting(path,
30
+ Application.dataPath,
31
+ "TapTapRelationLiteResource",
32
+ "com.taptap.sdk.relationlite",
33
+ "RelationLite",
34
+ new[] {"TapTapRelationLiteResource.bundle"},
35
+ target, projPath, proj,
36
+ "TapTapRelationLiteSDK"))
37
+ {
38
+ Debug.Log("TapRelationLite add Bundle Success!");
39
+ }
40
+ if (TapSDKCoreCompile.HandlerIOSSetting(path,
41
+ Application.dataPath,
42
+ "TapTapProfileResource",
43
+ "com.taptap.sdk.profile",
44
+ "Profile",
45
+ new[] {"TapTapProfileResource.bundle"},
46
+ target, projPath, proj,
47
+ "TapTapProfileSDK"))
48
+ {
49
+ Debug.Log("TapProfile add Bundle Success!");
50
+ TapSDKCoreCompile.ExecutePodCommand("pod deintegrate && pod install", path);
51
+ return;
52
+ }
53
+
54
+ Debug.LogWarning("TapRelationLite add Bundle Failed!");
55
+ }
56
+ }
57
+ }
58
+ #endif
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 7f64b2045541a4d5ca3a507e88d35c81
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,9 +1,15 @@
1
- <?xml version="1.0" ?>
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
2
  <dependencies>
3
3
  <androidPackages>
4
4
  <repositories>
5
5
  <repository>https://repo.maven.apache.org/maven2</repository>
6
6
  </repositories>
7
- <androidPackage spec="com.taptap.sdk:tap-relation-lite-unity:4.8.1-beta.1"/>
7
+ <androidPackage spec="com.taptap.sdk:tap-relation-lite-unity:4.8.2"/>
8
8
  </androidPackages>
9
+ <iosPods>
10
+ <sources>
11
+ <source>https://github.com/CocoaPods/Specs.git</source>
12
+ </sources>
13
+ <iosPod addToAllTargets="false" bitcodeEnabled="false" name="TapTapRelationLiteSDK" version="4.8.2"/>
14
+ </iosPods>
9
15
  </dependencies>
@@ -7,7 +7,8 @@
7
7
  "GUID:6f33d8db82c9445088544f91d41e65a2"
8
8
  ],
9
9
  "includePlatforms": [
10
- "Android"
10
+ "Android",
11
+ "iOS"
11
12
  ],
12
13
  "excludePlatforms": [],
13
14
  "allowUnsafeCode": false,
@@ -7,6 +7,7 @@ using TapSDK.Core.Internal;
7
7
  using TapSDK.Core.Internal.Utils;
8
8
  using Newtonsoft.Json;
9
9
  using System.Runtime.InteropServices;
10
+ using System.Threading.Tasks;
10
11
  using TapSDK.Core.Internal.Log;
11
12
  #if UNITY_IOS
12
13
  using UnityEngine.iOS;
@@ -36,24 +37,13 @@ namespace TapSDK.RelationLite
36
37
  TapLog.Log($"TapTapRelationLite Init with clientId: {clientId}, regionType: {regionType}");
37
38
  }
38
39
 
39
- public void SetOrientation(int orientation)
40
- {
41
- EngineBridge.GetInstance().CallHandler(new Command.Builder()
42
- .Service(SERVICE_NAME)
43
- .Method("setOrientation")
44
- .Args("orientation", orientation)
45
- .Callback(false)
46
- .OnceTime(true)
47
- .CommandBuilder());
48
- }
49
-
50
40
  public void InviteGame()
51
41
  {
52
42
  TapLog.Log("TapTapRelationLite InviteGame");
53
43
 
54
44
  EngineBridge.GetInstance().CallHandler(new Command.Builder()
55
45
  .Service(SERVICE_NAME)
56
- .Method("inviteGame")
46
+ .Method("inviteGameByRelationLite")
57
47
  .Callback(false)
58
48
  .OnceTime(true)
59
49
  .CommandBuilder());
@@ -66,31 +56,30 @@ namespace TapSDK.RelationLite
66
56
  EngineBridge.GetInstance().CallHandler(new Command.Builder()
67
57
  .Service(SERVICE_NAME)
68
58
  .Method("inviteTeam")
69
- .Args("teamId", teamId)
59
+ .Args("relationLiteTeamId", teamId)
70
60
  .Callback(false)
71
61
  .OnceTime(true)
72
62
  .CommandBuilder());
73
63
  }
74
64
 
75
- public void GetFriendsList(string nextPageToken, ITapTapRelationLiteRequestCallback callback)
65
+ public Task<RelationLiteUserResult> GetFriendsList(string nextPageToken)
76
66
  {
67
+ var taskSource = new TaskCompletionSource<RelationLiteUserResult>();
77
68
  TapLog.Log($"TapTapRelationLite GetFriendsList with nextPageToken: {nextPageToken}");
78
69
 
79
70
  EngineBridge.GetInstance().CallHandler(new Command.Builder()
80
71
  .Service(SERVICE_NAME)
81
72
  .Method("getFriendsList")
82
- .Args("nextPageToken", nextPageToken)
73
+ .Args("friendListNextPageToken", nextPageToken)
83
74
  .Callback(true)
84
75
  .OnceTime(true)
85
76
  .CommandBuilder(), (result) =>
86
77
  {
87
- if (callback == null) return;
88
-
89
78
  try
90
79
  {
91
80
  if (result.code != Result.RESULT_SUCCESS || string.IsNullOrEmpty(result.content))
92
81
  {
93
- callback.OnFriendsListResult("", new List<RelationLiteUserItem>());
82
+ taskSource.TrySetException(new TapException(-1, "Failed to get friends list with error code: " + result.code + " and content: " + result.content));
94
83
  return;
95
84
  }
96
85
 
@@ -100,41 +89,41 @@ namespace TapSDK.RelationLite
100
89
  string nextPage = SafeDictionary.GetValue<string>(dic, "next_page_token");
101
90
  string jsonStr = SafeDictionary.GetValue<string>(dic, "friends_list");
102
91
  List<RelationLiteUserItem> friendsList = JsonConvert.DeserializeObject<List<RelationLiteUserItem>>(jsonStr);
103
- callback.OnFriendsListResult(nextPage, friendsList);
92
+ taskSource.TrySetResult(new RelationLiteUserResult(friendsList, nextPage));
104
93
  }
105
94
  else
106
95
  {
107
- callback.OnFriendsListResult("", new List<RelationLiteUserItem>());
96
+ string errorMessage = SafeDictionary.GetValue<string>(dic, "error_message", "unknown error");
97
+ taskSource.TrySetException(new TapException(-1, errorMessage));
108
98
  }
109
99
  }
110
100
  catch (Exception e)
111
101
  {
112
- callback.OnFriendsListResult("", new List<RelationLiteUserItem>());
102
+ taskSource.TrySetException(new TapException(-1, e.Message));
113
103
  TapLog.Error($"GetFriendsList parse result error: {e.Message}");
114
104
  }
115
105
  });
116
-
106
+ return taskSource.Task;
117
107
  }
118
108
 
119
- public void GetFollowingList(string nextPageToken, ITapTapRelationLiteRequestCallback callback)
109
+ public Task<RelationLiteUserResult> GetFollowingList(string nextPageToken)
120
110
  {
111
+ var taskSource = new TaskCompletionSource<RelationLiteUserResult>();
121
112
  TapLog.Log($"TapTapRelationLite GetFollowingList with nextPageToken: {nextPageToken}");
122
113
 
123
114
  EngineBridge.GetInstance().CallHandler(new Command.Builder()
124
115
  .Service(SERVICE_NAME)
125
116
  .Method("getFollowingList")
126
- .Args("nextPageToken", nextPageToken)
117
+ .Args("followingListNextPageToken", nextPageToken)
127
118
  .Callback(true)
128
119
  .OnceTime(true)
129
120
  .CommandBuilder(), (result) =>
130
121
  {
131
- if (callback == null) return;
132
-
133
122
  try
134
123
  {
135
124
  if (result.code != Result.RESULT_SUCCESS || string.IsNullOrEmpty(result.content))
136
125
  {
137
- callback.OnFollowingListResult("", new List<RelationLiteUserItem>());
126
+ taskSource.TrySetException(new TapException(-1, "Failed to get friends list with error code: " + result.code + " and content: " + result.content));
138
127
  return;
139
128
  }
140
129
 
@@ -144,41 +133,41 @@ namespace TapSDK.RelationLite
144
133
  string nextPage = SafeDictionary.GetValue<string>(dic, "next_page_token");
145
134
  string jsonStr = SafeDictionary.GetValue<string>(dic, "following_list");
146
135
  List<RelationLiteUserItem> followingList = JsonConvert.DeserializeObject<List<RelationLiteUserItem>>(jsonStr);
147
- callback.OnFollowingListResult(nextPage, followingList);
136
+ taskSource.TrySetResult(new RelationLiteUserResult(followingList, nextPage));
148
137
  }
149
138
  else
150
139
  {
151
- callback.OnFollowingListResult("", new List<RelationLiteUserItem>());
140
+ string errorMessage = SafeDictionary.GetValue<string>(dic, "error_message", "unknown error");
141
+ taskSource.TrySetException(new TapException(-1, errorMessage));
152
142
  }
153
143
  }
154
144
  catch (Exception e)
155
145
  {
156
- callback.OnFollowingListResult("", new List<RelationLiteUserItem>());
146
+ taskSource.TrySetException(new TapException(-1, e.Message));
157
147
  TapLog.Error($"GetFollowingList parse result error: {e.Message}");
158
148
  }
159
149
  });
160
-
150
+ return taskSource.Task;
161
151
  }
162
152
 
163
- public void GetFansList(string nextPageToken, ITapTapRelationLiteRequestCallback callback)
153
+ public Task<RelationLiteUserResult> GetFansList(string nextPageToken)
164
154
  {
155
+ var taskSource = new TaskCompletionSource<RelationLiteUserResult>();
165
156
  TapLog.Log($"TapTapRelationLite GetFansList with nextPageToken: {nextPageToken}");
166
157
 
167
158
  EngineBridge.GetInstance().CallHandler(new Command.Builder()
168
159
  .Service(SERVICE_NAME)
169
160
  .Method("getFansList")
170
- .Args("nextPageToken", nextPageToken)
161
+ .Args("fansListNextPageToken", nextPageToken)
171
162
  .Callback(true)
172
163
  .OnceTime(true)
173
164
  .CommandBuilder(), (result) =>
174
165
  {
175
- if (callback == null) return;
176
-
177
166
  try
178
167
  {
179
168
  if (result.code != Result.RESULT_SUCCESS || string.IsNullOrEmpty(result.content))
180
169
  {
181
- callback.OnFansListResult("", new List<RelationLiteUserItem>());
170
+ taskSource.TrySetException(new TapException(-1, "Failed to get fans list with error code: " + result.code + " and content: " + result.content));
182
171
  return;
183
172
  }
184
173
 
@@ -188,30 +177,32 @@ namespace TapSDK.RelationLite
188
177
  string nextPage = SafeDictionary.GetValue<string>(dic, "next_page_token");
189
178
  string jsonStr = SafeDictionary.GetValue<string>(dic, "fans_list");
190
179
  List<RelationLiteUserItem> fansList = JsonConvert.DeserializeObject<List<RelationLiteUserItem>>(jsonStr);
191
- callback.OnFansListResult(nextPage, fansList);
180
+ taskSource.TrySetResult(new RelationLiteUserResult(fansList, nextPage));
192
181
  }
193
182
  else
194
183
  {
195
- callback.OnFansListResult("", new List<RelationLiteUserItem>());
184
+ string errorMessage = SafeDictionary.GetValue<string>(dic, "error_message", "unknown error");
185
+ taskSource.TrySetException(new TapException(-1, errorMessage));
196
186
  }
197
187
  }
198
188
  catch (Exception e)
199
189
  {
200
- callback.OnFansListResult("", new List<RelationLiteUserItem>());
190
+ taskSource.TrySetException(new TapException(-1, e.Message));
201
191
  TapLog.Error($"GetFansList parse result error: {e.Message}");
202
192
  }
203
193
  });
204
-
194
+ return taskSource.Task;
205
195
  }
206
196
 
207
- public void SyncRelationshipWithOpenId(int action, string nickname, string friendNickname, string friendOpenId, ITapTapRelationLiteRequestCallback callback)
197
+ public Task SyncRelationshipWithOpenId(int action, string nickname, string friendNickname, string friendOpenId)
208
198
  {
199
+ var taskSource = new TaskCompletionSource<bool>();
209
200
  TapLog.Log($"TapTapRelationLite SyncRelationshipWithOpenId with action: {action}, nickname: {nickname}, friendNickname: {friendNickname}, friendOpenId: {friendOpenId}");
210
201
 
211
202
  EngineBridge.GetInstance().CallHandler(new Command.Builder()
212
203
  .Service(SERVICE_NAME)
213
204
  .Method("syncRelationshipWithOpenId")
214
- .Args("action", action)
205
+ .Args("syncRelationAction", action)
215
206
  .Args("nickname", nickname)
216
207
  .Args("friendNickname", friendNickname)
217
208
  .Args("friendOpenId", friendOpenId)
@@ -219,53 +210,53 @@ namespace TapSDK.RelationLite
219
210
  .OnceTime(true)
220
211
  .CommandBuilder(), (result) =>
221
212
  {
222
- if (callback == null) return;
223
213
 
224
214
  try
225
215
  {
226
216
  if (result.code != Result.RESULT_SUCCESS || string.IsNullOrEmpty(result.content))
227
217
  {
228
- callback.OnSyncRelationshipFail("", "", "");
218
+ taskSource.TrySetException(new TapException(-1, "Failed to sync relationship with open id with error code: " + result.code + " and content: " + result.content));
229
219
  return;
230
220
  }
231
221
 
232
222
  var dic = Json.Deserialize(result.content) as Dictionary<string, object>;
233
- if (dic != null && dic.ContainsKey("success") && dic.ContainsKey("open_id"))
223
+ if (dic != null && dic.ContainsKey("success"))
234
224
  {
235
- string openId = SafeDictionary.GetValue<string>(dic, "open_id");
236
- bool success = SafeDictionary.GetValue<bool>(dic, "success");
237
- if (success)
225
+ int success = SafeDictionary.GetValue<int>(dic, "success", -1);
226
+ if (success == 0)
238
227
  {
239
- callback.OnSyncRelationshipSuccess(openId, "");
228
+ taskSource.TrySetResult(true);
240
229
  }
241
230
  else
242
231
  {
243
- string errorMessage = SafeDictionary.GetValue<string>(dic, "error_message");
244
- callback.OnSyncRelationshipFail(errorMessage, openId, "");
232
+ string errorMessage = SafeDictionary.GetValue<string>(dic, "error_message", "unknown error");
233
+ taskSource.TrySetException(new TapException(-1, errorMessage));
245
234
  }
246
235
  }
247
236
  else
248
237
  {
249
- callback.OnSyncRelationshipFail("", "", "");
238
+ taskSource.TrySetException(new TapException(-1, "Failed to sync relationship with open id with error code: " + result.code + " and content: " + result.content));
239
+
250
240
  }
251
241
  }
252
242
  catch (Exception e)
253
243
  {
254
- callback.OnSyncRelationshipFail(e.Message, "", "");
244
+ taskSource.TrySetException(new TapException(-1, e.Message));
255
245
  TapLog.Error($"SyncRelationshipWithOpenId parse result error: {e.Message}");
256
246
  }
257
247
  });
258
-
248
+ return taskSource.Task;
259
249
  }
260
250
 
261
- public void SyncRelationshipWithUnionId(int action, string nickname, string friendNickname, string friendUnionId, ITapTapRelationLiteRequestCallback callback)
251
+ public Task SyncRelationshipWithUnionId(int action, string nickname, string friendNickname, string friendUnionId)
262
252
  {
253
+ var taskSource = new TaskCompletionSource<bool>();
263
254
  TapLog.Log($"TapTapRelationLite SyncRelationshipWithUnionId with action: {action}, nickname: {nickname}, friendNickname: {friendNickname}, friendUnionId: {friendUnionId}");
264
255
 
265
256
  EngineBridge.GetInstance().CallHandler(new Command.Builder()
266
257
  .Service(SERVICE_NAME)
267
258
  .Method("syncRelationshipWithUnionId")
268
- .Args("action", action)
259
+ .Args("syncRelationAction", action)
269
260
  .Args("nickname", nickname)
270
261
  .Args("friendNickname", friendNickname)
271
262
  .Args("friendUnionId", friendUnionId)
@@ -273,43 +264,41 @@ namespace TapSDK.RelationLite
273
264
  .OnceTime(true)
274
265
  .CommandBuilder(), (result) =>
275
266
  {
276
- if (callback == null) return;
277
-
278
267
  try
279
268
  {
280
269
  if (result.code != Result.RESULT_SUCCESS || string.IsNullOrEmpty(result.content))
281
270
  {
282
- callback.OnSyncRelationshipFail("request error", "", "");
271
+ taskSource.TrySetException(new TapException(-1, "Failed to sync relationship with union id with error code: " + result.code + " and content: " + result.content));
283
272
  return;
284
273
  }
285
274
 
286
275
  var dic = Json.Deserialize(result.content) as Dictionary<string, object>;
287
- if (dic != null && dic.ContainsKey("success") && dic.ContainsKey("union_id"))
276
+ if (dic != null && dic.ContainsKey("success"))
288
277
  {
289
- string unionId = SafeDictionary.GetValue<string>(dic, "union_id");
290
- bool success = SafeDictionary.GetValue<bool>(dic, "success");
291
- if (success)
278
+ int success = SafeDictionary.GetValue<int>(dic, "success", -1);
279
+ if (success == 0)
292
280
  {
293
- callback.OnSyncRelationshipSuccess("", unionId);
281
+ taskSource.TrySetResult(true);
294
282
  }
295
283
  else
296
284
  {
297
- string errorMessage = SafeDictionary.GetValue<string>(dic, "error_message");
298
- callback.OnSyncRelationshipFail(errorMessage, "", unionId);
285
+ string errorMessage = SafeDictionary.GetValue<string>(dic, "error_message", "unknown error");
286
+ int errorCode = SafeDictionary.GetValue<int>(dic, "error_code", -1);
287
+ taskSource.TrySetException(new TapException(errorCode, errorMessage));
299
288
  }
300
289
  }
301
290
  else
302
291
  {
303
- callback.OnSyncRelationshipFail("json format error", "", "");
292
+ taskSource.TrySetException(new TapException(-1, "Failed to sync relationship with union id with error code: " + result.code + " and content: " + result.content));
304
293
  }
305
294
  }
306
295
  catch (Exception e)
307
296
  {
308
- callback.OnSyncRelationshipFail(e.Message, "", "");
297
+ taskSource.TrySetException(new TapException(-1, e.Message));
309
298
  TapLog.Error($"SyncRelationshipWithOpenId parse result error: {e.Message}");
310
299
  }
311
300
  });
312
-
301
+ return taskSource.Task;
313
302
  }
314
303
 
315
304
  public void ShowTapUserProfile(string openId, string unionId)
@@ -319,7 +308,7 @@ namespace TapSDK.RelationLite
319
308
  EngineBridge.GetInstance().CallHandler(new Command.Builder()
320
309
  .Service(SERVICE_NAME)
321
310
  .Method("showTapUserProfile")
322
- .Args("openId", openId)
311
+ .Args("relationLiteOpenId", openId)
323
312
  .Args("unionId", unionId)
324
313
  .Callback(false)
325
314
  .OnceTime(true)
@@ -342,26 +331,17 @@ namespace TapSDK.RelationLite
342
331
  if (callback != null)
343
332
  {
344
333
  callbacks.Remove(callback);
345
- var command = new Command.Builder();
346
- command.Service(SERVICE_NAME);
347
- command.Method("unregisterRelationLiteCallback")
348
- .Callback(true)
349
- .OnceTime(false);
350
- EngineBridge.GetInstance().CallHandler(command.CommandBuilder(), (result) =>
334
+ // 当引擎中清除所有回调时,移除原生 callback
335
+ if (callbacks.Count == 0)
351
336
  {
352
- if (result.code != Result.RESULT_SUCCESS)
353
- {
354
- return;
355
- }
356
-
357
- if (string.IsNullOrEmpty(result.content))
358
- {
359
- return;
360
- }
361
- TapLog.Log("TapSdk4UnityDemo -->> Bridge Callback == " + JsonConvert.SerializeObject(result));
362
-
363
- });
364
- TapLog.Log("TapTapRelationLite UnregisterRelationLiteCallback");
337
+ var command = new Command.Builder()
338
+ .Service(SERVICE_NAME)
339
+ .Method("unregisterRelationLiteCallback")
340
+ .Callback(false)
341
+ .OnceTime(false);
342
+ EngineBridge.GetInstance().CallHandler(command.CommandBuilder());
343
+ TapLog.Log("TapTapRelationLite UnregisterRelationLiteCallback");
344
+ }
365
345
  }
366
346
  }
367
347
 
@@ -1,5 +1,6 @@
1
1
  using System;
2
2
  using System.Collections.Generic;
3
+ using System.Threading.Tasks;
3
4
  using TapSDK.Core;
4
5
  using TapSDK.Core.Internal.Utils;
5
6
 
@@ -36,11 +37,6 @@ namespace TapSDK.RelationLite.Internal
36
37
  _impl?.Init(clientId, regionType);
37
38
  }
38
39
 
39
- public void SetOrientation(int orientation)
40
- {
41
- _impl?.SetOrientation(orientation);
42
- }
43
-
44
40
  public void InviteGame()
45
41
  {
46
42
  _impl?.InviteGame();
@@ -51,29 +47,29 @@ namespace TapSDK.RelationLite.Internal
51
47
  _impl?.InviteTeam(teamId);
52
48
  }
53
49
 
54
- public void GetFriendsList(string nextPageToken, ITapTapRelationLiteRequestCallback callback)
50
+ public Task<RelationLiteUserResult> GetFriendsList(string nextPageToken)
55
51
  {
56
- _impl?.GetFriendsList(nextPageToken, callback);
52
+ return _impl?.GetFriendsList(nextPageToken);
57
53
  }
58
54
 
59
- public void GetFollowingList(string nextPageToken, ITapTapRelationLiteRequestCallback callback)
55
+ public Task<RelationLiteUserResult> GetFollowingList(string nextPageToken)
60
56
  {
61
- _impl?.GetFollowingList(nextPageToken, callback);
57
+ return _impl?.GetFollowingList(nextPageToken);
62
58
  }
63
59
 
64
- public void GetFansList(string nextPageToken, ITapTapRelationLiteRequestCallback callback)
60
+ public Task<RelationLiteUserResult> GetFansList(string nextPageToken)
65
61
  {
66
- _impl?.GetFansList(nextPageToken, callback);
62
+ return _impl?.GetFansList(nextPageToken);
67
63
  }
68
64
 
69
- public void SyncRelationshipWithOpenId(int action, string nickname, string friendNickname, string friendOpenId, ITapTapRelationLiteRequestCallback callback)
65
+ public Task SyncRelationshipWithOpenId(int action, string nickname, string friendNickname, string friendOpenId)
70
66
  {
71
- _impl?.SyncRelationshipWithOpenId(action, nickname, friendNickname, friendOpenId, callback);
67
+ return _impl?.SyncRelationshipWithOpenId(action, nickname, friendNickname, friendOpenId);
72
68
  }
73
69
 
74
- public void SyncRelationshipWithUnionId(int action, string nickname, string friendNickname, string friendUnionId, ITapTapRelationLiteRequestCallback callback)
70
+ public Task SyncRelationshipWithUnionId(int action, string nickname, string friendNickname, string friendUnionId)
75
71
  {
76
- _impl?.SyncRelationshipWithUnionId(action, nickname, friendNickname, friendUnionId, callback);
72
+ return _impl?.SyncRelationshipWithUnionId(action, nickname, friendNickname, friendUnionId);
77
73
  }
78
74
 
79
75
  public void ShowTapUserProfile(string openId, string unionId)
@@ -1,4 +1,5 @@
1
1
  using System;
2
+ using System.Threading.Tasks;
2
3
  using TapSDK.Core;
3
4
 
4
5
  namespace TapSDK.RelationLite
@@ -7,21 +8,19 @@ namespace TapSDK.RelationLite
7
8
  {
8
9
  void Init(string clientId, TapTapRegionType regionType);
9
10
 
10
- void SetOrientation(int orientation);
11
-
12
11
  void InviteGame();
13
12
 
14
13
  void InviteTeam(string teamId);
15
14
 
16
- void GetFriendsList(string nextPageToken, ITapTapRelationLiteRequestCallback callback);
15
+ Task<RelationLiteUserResult> GetFriendsList(string nextPageToken);
17
16
 
18
- void GetFollowingList(string nextPageToken, ITapTapRelationLiteRequestCallback callback);
17
+ Task<RelationLiteUserResult> GetFollowingList(string nextPageToken);
19
18
 
20
- void GetFansList(string nextPageToken, ITapTapRelationLiteRequestCallback callback);
19
+ Task<RelationLiteUserResult> GetFansList(string nextPageToken);
21
20
 
22
- void SyncRelationshipWithOpenId(int action, string nickname,string friendNickname, string friendOpenId, ITapTapRelationLiteRequestCallback callback);
21
+ Task SyncRelationshipWithOpenId(int action, string nickname,string friendNickname, string friendOpenId);
23
22
 
24
- void SyncRelationshipWithUnionId(int action, string nickname,string friendNickname, string friendUnionId, ITapTapRelationLiteRequestCallback callback);
23
+ Task SyncRelationshipWithUnionId(int action, string nickname,string friendNickname, string friendUnionId);
25
24
 
26
25
  void ShowTapUserProfile(string openId, string unionId);
27
26
 
@@ -0,0 +1,18 @@
1
+ using System;
2
+ using System.Collections.Generic;
3
+
4
+ namespace TapSDK.RelationLite
5
+ {
6
+ public class RelationLiteUserResult
7
+ {
8
+ public List<RelationLiteUserItem> list;
9
+
10
+ public string nextPageToken;
11
+
12
+ public RelationLiteUserResult(List<RelationLiteUserItem> data, string token)
13
+ {
14
+ this.list = data;
15
+ this.nextPageToken = token;
16
+ }
17
+ }
18
+ }
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: f0bc0e8fb5db44ee6b3214bd6eeb4260
3
+ DefaultImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -3,6 +3,7 @@ using System.Collections.Generic;
3
3
  using TapSDK.RelationLite.Internal;
4
4
  using TapSDK.Core;
5
5
  using TapSDK.Core.Internal.Utils;
6
+ using System.Threading.Tasks;
6
7
 
7
8
  namespace TapSDK.RelationLite
8
9
  {
@@ -22,11 +23,6 @@ namespace TapSDK.RelationLite
22
23
  TapTapRelationLiteManager.Instance.Init(clientId, regionType);
23
24
  }
24
25
 
25
- public static void SetOrientation(int orientation)
26
- {
27
- TapTapRelationLiteManager.Instance.SetOrientation(orientation);
28
- }
29
-
30
26
  public static void InviteGame()
31
27
  {
32
28
  TapTapRelationLiteManager.Instance.InviteGame();
@@ -37,29 +33,29 @@ namespace TapSDK.RelationLite
37
33
  TapTapRelationLiteManager.Instance.InviteTeam(teamId);
38
34
  }
39
35
 
40
- public static void GetFriendsList(string nextPageToken, ITapTapRelationLiteRequestCallback callback)
36
+ public static Task<RelationLiteUserResult> GetFriendsList(string nextPageToken)
41
37
  {
42
- TapTapRelationLiteManager.Instance.GetFriendsList(nextPageToken, callback);
38
+ return TapTapRelationLiteManager.Instance.GetFriendsList(nextPageToken);
43
39
  }
44
40
 
45
- public static void GetFollowingList(string nextPageToken, ITapTapRelationLiteRequestCallback callback)
41
+ public static Task<RelationLiteUserResult> GetFollowingList(string nextPageToken)
46
42
  {
47
- TapTapRelationLiteManager.Instance.GetFollowingList(nextPageToken, callback);
43
+ return TapTapRelationLiteManager.Instance.GetFollowingList(nextPageToken);
48
44
  }
49
45
 
50
- public static void GetFansList(string nextPageToken, ITapTapRelationLiteRequestCallback callback)
46
+ public static Task<RelationLiteUserResult> GetFansList(string nextPageToken)
51
47
  {
52
- TapTapRelationLiteManager.Instance.GetFansList(nextPageToken, callback);
48
+ return TapTapRelationLiteManager.Instance.GetFansList(nextPageToken);
53
49
  }
54
50
 
55
- public static void SyncRelationshipWithOpenId(int action, string nickname, string friendNickname, string friendOpenId, ITapTapRelationLiteRequestCallback callback)
51
+ public static Task SyncRelationshipWithOpenId(int action, string nickname, string friendNickname, string friendOpenId)
56
52
  {
57
- TapTapRelationLiteManager.Instance.SyncRelationshipWithOpenId(action, nickname, friendNickname, friendOpenId, callback);
53
+ return TapTapRelationLiteManager.Instance.SyncRelationshipWithOpenId(action, nickname, friendNickname, friendOpenId);
58
54
  }
59
55
 
60
- public static void SyncRelationshipWithUnionId(int action, string nickname, string friendNickname, string friendUnionId, ITapTapRelationLiteRequestCallback callback)
56
+ public static Task SyncRelationshipWithUnionId(int action, string nickname, string friendNickname, string friendUnionId)
61
57
  {
62
- TapTapRelationLiteManager.Instance.SyncRelationshipWithUnionId(action, nickname, friendNickname, friendUnionId, callback);
58
+ return TapTapRelationLiteManager.Instance.SyncRelationshipWithUnionId(action, nickname, friendNickname, friendUnionId);
63
59
  }
64
60
 
65
61
  public static void ShowTapUserProfile(string openId, string unionId)
@@ -77,6 +73,6 @@ namespace TapSDK.RelationLite
77
73
  TapTapRelationLiteManager.Instance.UnregisterRelationLiteCallback(callback);
78
74
  }
79
75
 
80
- public static readonly string Version = "4.8.1-beta.1";
76
+ public static readonly string Version = "4.8.2";
81
77
  }
82
78
  }
package/package.json CHANGED
@@ -2,11 +2,11 @@
2
2
  "name": "com.taptap.sdk.relationlite",
3
3
  "displayName": "TapTapSDK RelationLite",
4
4
  "description": "TapTapSDK RelationLite",
5
- "version": "4.8.1-beta.1",
5
+ "version": "4.8.2",
6
6
  "unity": "2019.4",
7
7
  "license": "MIT",
8
8
  "dependencies": {
9
- "com.taptap.sdk.core": "4.8.1-beta.1",
10
- "com.taptap.sdk.login": "4.8.1-beta.1"
9
+ "com.taptap.sdk.core": "4.8.2",
10
+ "com.taptap.sdk.login": "4.8.2"
11
11
  }
12
12
  }