com.taptap.sdk.relationlite 4.8.1 → 4.8.3

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:
@@ -4,6 +4,12 @@
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.7"/>
7
+ <androidPackage spec="com.taptap.sdk:tap-relation-lite-unity:4.8.3"/>
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.3"/>
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;
@@ -42,7 +43,7 @@ namespace TapSDK.RelationLite
42
43
 
43
44
  EngineBridge.GetInstance().CallHandler(new Command.Builder()
44
45
  .Service(SERVICE_NAME)
45
- .Method("inviteGame")
46
+ .Method("inviteGameByRelationLite")
46
47
  .Callback(false)
47
48
  .OnceTime(true)
48
49
  .CommandBuilder());
@@ -55,31 +56,30 @@ namespace TapSDK.RelationLite
55
56
  EngineBridge.GetInstance().CallHandler(new Command.Builder()
56
57
  .Service(SERVICE_NAME)
57
58
  .Method("inviteTeam")
58
- .Args("teamId", teamId)
59
+ .Args("relationLiteTeamId", teamId)
59
60
  .Callback(false)
60
61
  .OnceTime(true)
61
62
  .CommandBuilder());
62
63
  }
63
64
 
64
- public void GetFriendsList(string nextPageToken, ITapTapRelationLiteRequestCallback callback)
65
+ public Task<RelationLiteUserResult> GetFriendsList(string nextPageToken)
65
66
  {
67
+ var taskSource = new TaskCompletionSource<RelationLiteUserResult>();
66
68
  TapLog.Log($"TapTapRelationLite GetFriendsList with nextPageToken: {nextPageToken}");
67
69
 
68
70
  EngineBridge.GetInstance().CallHandler(new Command.Builder()
69
71
  .Service(SERVICE_NAME)
70
72
  .Method("getFriendsList")
71
- .Args("nextPageToken", nextPageToken)
73
+ .Args("friendListNextPageToken", nextPageToken)
72
74
  .Callback(true)
73
75
  .OnceTime(true)
74
76
  .CommandBuilder(), (result) =>
75
77
  {
76
- if (callback == null) return;
77
-
78
78
  try
79
79
  {
80
80
  if (result.code != Result.RESULT_SUCCESS || string.IsNullOrEmpty(result.content))
81
81
  {
82
- 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));
83
83
  return;
84
84
  }
85
85
 
@@ -89,41 +89,41 @@ namespace TapSDK.RelationLite
89
89
  string nextPage = SafeDictionary.GetValue<string>(dic, "next_page_token");
90
90
  string jsonStr = SafeDictionary.GetValue<string>(dic, "friends_list");
91
91
  List<RelationLiteUserItem> friendsList = JsonConvert.DeserializeObject<List<RelationLiteUserItem>>(jsonStr);
92
- callback.OnFriendsListResult(nextPage, friendsList);
92
+ taskSource.TrySetResult(new RelationLiteUserResult(friendsList, nextPage));
93
93
  }
94
94
  else
95
95
  {
96
- callback.OnFriendsListResult("", new List<RelationLiteUserItem>());
96
+ string errorMessage = SafeDictionary.GetValue<string>(dic, "error_message", "unknown error");
97
+ taskSource.TrySetException(new TapException(-1, errorMessage));
97
98
  }
98
99
  }
99
100
  catch (Exception e)
100
101
  {
101
- callback.OnFriendsListResult("", new List<RelationLiteUserItem>());
102
+ taskSource.TrySetException(new TapException(-1, e.Message));
102
103
  TapLog.Error($"GetFriendsList parse result error: {e.Message}");
103
104
  }
104
105
  });
105
-
106
+ return taskSource.Task;
106
107
  }
107
108
 
108
- public void GetFollowingList(string nextPageToken, ITapTapRelationLiteRequestCallback callback)
109
+ public Task<RelationLiteUserResult> GetFollowingList(string nextPageToken)
109
110
  {
111
+ var taskSource = new TaskCompletionSource<RelationLiteUserResult>();
110
112
  TapLog.Log($"TapTapRelationLite GetFollowingList with nextPageToken: {nextPageToken}");
111
113
 
112
114
  EngineBridge.GetInstance().CallHandler(new Command.Builder()
113
115
  .Service(SERVICE_NAME)
114
116
  .Method("getFollowingList")
115
- .Args("nextPageToken", nextPageToken)
117
+ .Args("followingListNextPageToken", nextPageToken)
116
118
  .Callback(true)
117
119
  .OnceTime(true)
118
120
  .CommandBuilder(), (result) =>
119
121
  {
120
- if (callback == null) return;
121
-
122
122
  try
123
123
  {
124
124
  if (result.code != Result.RESULT_SUCCESS || string.IsNullOrEmpty(result.content))
125
125
  {
126
- 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));
127
127
  return;
128
128
  }
129
129
 
@@ -133,41 +133,41 @@ namespace TapSDK.RelationLite
133
133
  string nextPage = SafeDictionary.GetValue<string>(dic, "next_page_token");
134
134
  string jsonStr = SafeDictionary.GetValue<string>(dic, "following_list");
135
135
  List<RelationLiteUserItem> followingList = JsonConvert.DeserializeObject<List<RelationLiteUserItem>>(jsonStr);
136
- callback.OnFollowingListResult(nextPage, followingList);
136
+ taskSource.TrySetResult(new RelationLiteUserResult(followingList, nextPage));
137
137
  }
138
138
  else
139
139
  {
140
- callback.OnFollowingListResult("", new List<RelationLiteUserItem>());
140
+ string errorMessage = SafeDictionary.GetValue<string>(dic, "error_message", "unknown error");
141
+ taskSource.TrySetException(new TapException(-1, errorMessage));
141
142
  }
142
143
  }
143
144
  catch (Exception e)
144
145
  {
145
- callback.OnFollowingListResult("", new List<RelationLiteUserItem>());
146
+ taskSource.TrySetException(new TapException(-1, e.Message));
146
147
  TapLog.Error($"GetFollowingList parse result error: {e.Message}");
147
148
  }
148
149
  });
149
-
150
+ return taskSource.Task;
150
151
  }
151
152
 
152
- public void GetFansList(string nextPageToken, ITapTapRelationLiteRequestCallback callback)
153
+ public Task<RelationLiteUserResult> GetFansList(string nextPageToken)
153
154
  {
155
+ var taskSource = new TaskCompletionSource<RelationLiteUserResult>();
154
156
  TapLog.Log($"TapTapRelationLite GetFansList with nextPageToken: {nextPageToken}");
155
157
 
156
158
  EngineBridge.GetInstance().CallHandler(new Command.Builder()
157
159
  .Service(SERVICE_NAME)
158
160
  .Method("getFansList")
159
- .Args("nextPageToken", nextPageToken)
161
+ .Args("fansListNextPageToken", nextPageToken)
160
162
  .Callback(true)
161
163
  .OnceTime(true)
162
164
  .CommandBuilder(), (result) =>
163
165
  {
164
- if (callback == null) return;
165
-
166
166
  try
167
167
  {
168
168
  if (result.code != Result.RESULT_SUCCESS || string.IsNullOrEmpty(result.content))
169
169
  {
170
- 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));
171
171
  return;
172
172
  }
173
173
 
@@ -177,30 +177,32 @@ namespace TapSDK.RelationLite
177
177
  string nextPage = SafeDictionary.GetValue<string>(dic, "next_page_token");
178
178
  string jsonStr = SafeDictionary.GetValue<string>(dic, "fans_list");
179
179
  List<RelationLiteUserItem> fansList = JsonConvert.DeserializeObject<List<RelationLiteUserItem>>(jsonStr);
180
- callback.OnFansListResult(nextPage, fansList);
180
+ taskSource.TrySetResult(new RelationLiteUserResult(fansList, nextPage));
181
181
  }
182
182
  else
183
183
  {
184
- callback.OnFansListResult("", new List<RelationLiteUserItem>());
184
+ string errorMessage = SafeDictionary.GetValue<string>(dic, "error_message", "unknown error");
185
+ taskSource.TrySetException(new TapException(-1, errorMessage));
185
186
  }
186
187
  }
187
188
  catch (Exception e)
188
189
  {
189
- callback.OnFansListResult("", new List<RelationLiteUserItem>());
190
+ taskSource.TrySetException(new TapException(-1, e.Message));
190
191
  TapLog.Error($"GetFansList parse result error: {e.Message}");
191
192
  }
192
193
  });
193
-
194
+ return taskSource.Task;
194
195
  }
195
196
 
196
- 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)
197
198
  {
199
+ var taskSource = new TaskCompletionSource<bool>();
198
200
  TapLog.Log($"TapTapRelationLite SyncRelationshipWithOpenId with action: {action}, nickname: {nickname}, friendNickname: {friendNickname}, friendOpenId: {friendOpenId}");
199
201
 
200
202
  EngineBridge.GetInstance().CallHandler(new Command.Builder()
201
203
  .Service(SERVICE_NAME)
202
204
  .Method("syncRelationshipWithOpenId")
203
- .Args("action", action)
205
+ .Args("syncRelationAction", action)
204
206
  .Args("nickname", nickname)
205
207
  .Args("friendNickname", friendNickname)
206
208
  .Args("friendOpenId", friendOpenId)
@@ -208,53 +210,53 @@ namespace TapSDK.RelationLite
208
210
  .OnceTime(true)
209
211
  .CommandBuilder(), (result) =>
210
212
  {
211
- if (callback == null) return;
212
213
 
213
214
  try
214
215
  {
215
216
  if (result.code != Result.RESULT_SUCCESS || string.IsNullOrEmpty(result.content))
216
217
  {
217
- callback.OnSyncRelationshipFail("", "", "");
218
+ taskSource.TrySetException(new TapException(-1, "Failed to sync relationship with open id with error code: " + result.code + " and content: " + result.content));
218
219
  return;
219
220
  }
220
221
 
221
222
  var dic = Json.Deserialize(result.content) as Dictionary<string, object>;
222
- if (dic != null && dic.ContainsKey("success") && dic.ContainsKey("open_id"))
223
+ if (dic != null && dic.ContainsKey("success"))
223
224
  {
224
- string openId = SafeDictionary.GetValue<string>(dic, "open_id");
225
- bool success = SafeDictionary.GetValue<bool>(dic, "success");
226
- if (success)
225
+ int success = SafeDictionary.GetValue<int>(dic, "success", -1);
226
+ if (success == 0)
227
227
  {
228
- callback.OnSyncRelationshipSuccess(openId, "");
228
+ taskSource.TrySetResult(true);
229
229
  }
230
230
  else
231
231
  {
232
- string errorMessage = SafeDictionary.GetValue<string>(dic, "error_message");
233
- callback.OnSyncRelationshipFail(errorMessage, openId, "");
232
+ string errorMessage = SafeDictionary.GetValue<string>(dic, "error_message", "unknown error");
233
+ taskSource.TrySetException(new TapException(-1, errorMessage));
234
234
  }
235
235
  }
236
236
  else
237
237
  {
238
- 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
+
239
240
  }
240
241
  }
241
242
  catch (Exception e)
242
243
  {
243
- callback.OnSyncRelationshipFail(e.Message, "", "");
244
+ taskSource.TrySetException(new TapException(-1, e.Message));
244
245
  TapLog.Error($"SyncRelationshipWithOpenId parse result error: {e.Message}");
245
246
  }
246
247
  });
247
-
248
+ return taskSource.Task;
248
249
  }
249
250
 
250
- 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)
251
252
  {
253
+ var taskSource = new TaskCompletionSource<bool>();
252
254
  TapLog.Log($"TapTapRelationLite SyncRelationshipWithUnionId with action: {action}, nickname: {nickname}, friendNickname: {friendNickname}, friendUnionId: {friendUnionId}");
253
255
 
254
256
  EngineBridge.GetInstance().CallHandler(new Command.Builder()
255
257
  .Service(SERVICE_NAME)
256
258
  .Method("syncRelationshipWithUnionId")
257
- .Args("action", action)
259
+ .Args("syncRelationAction", action)
258
260
  .Args("nickname", nickname)
259
261
  .Args("friendNickname", friendNickname)
260
262
  .Args("friendUnionId", friendUnionId)
@@ -262,43 +264,41 @@ namespace TapSDK.RelationLite
262
264
  .OnceTime(true)
263
265
  .CommandBuilder(), (result) =>
264
266
  {
265
- if (callback == null) return;
266
-
267
267
  try
268
268
  {
269
269
  if (result.code != Result.RESULT_SUCCESS || string.IsNullOrEmpty(result.content))
270
270
  {
271
- 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));
272
272
  return;
273
273
  }
274
274
 
275
275
  var dic = Json.Deserialize(result.content) as Dictionary<string, object>;
276
- if (dic != null && dic.ContainsKey("success") && dic.ContainsKey("union_id"))
276
+ if (dic != null && dic.ContainsKey("success"))
277
277
  {
278
- string unionId = SafeDictionary.GetValue<string>(dic, "union_id");
279
- bool success = SafeDictionary.GetValue<bool>(dic, "success");
280
- if (success)
278
+ int success = SafeDictionary.GetValue<int>(dic, "success", -1);
279
+ if (success == 0)
281
280
  {
282
- callback.OnSyncRelationshipSuccess("", unionId);
281
+ taskSource.TrySetResult(true);
283
282
  }
284
283
  else
285
284
  {
286
- string errorMessage = SafeDictionary.GetValue<string>(dic, "error_message");
287
- 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));
288
288
  }
289
289
  }
290
290
  else
291
291
  {
292
- 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));
293
293
  }
294
294
  }
295
295
  catch (Exception e)
296
296
  {
297
- callback.OnSyncRelationshipFail(e.Message, "", "");
297
+ taskSource.TrySetException(new TapException(-1, e.Message));
298
298
  TapLog.Error($"SyncRelationshipWithOpenId parse result error: {e.Message}");
299
299
  }
300
300
  });
301
-
301
+ return taskSource.Task;
302
302
  }
303
303
 
304
304
  public void ShowTapUserProfile(string openId, string unionId)
@@ -308,7 +308,7 @@ namespace TapSDK.RelationLite
308
308
  EngineBridge.GetInstance().CallHandler(new Command.Builder()
309
309
  .Service(SERVICE_NAME)
310
310
  .Method("showTapUserProfile")
311
- .Args("openId", openId)
311
+ .Args("relationLiteOpenId", openId)
312
312
  .Args("unionId", unionId)
313
313
  .Callback(false)
314
314
  .OnceTime(true)
@@ -331,26 +331,17 @@ namespace TapSDK.RelationLite
331
331
  if (callback != null)
332
332
  {
333
333
  callbacks.Remove(callback);
334
- var command = new Command.Builder();
335
- command.Service(SERVICE_NAME);
336
- command.Method("unregisterRelationLiteCallback")
337
- .Callback(true)
338
- .OnceTime(false);
339
- EngineBridge.GetInstance().CallHandler(command.CommandBuilder(), (result) =>
334
+ // 当引擎中清除所有回调时,移除原生 callback
335
+ if (callbacks.Count == 0)
340
336
  {
341
- if (result.code != Result.RESULT_SUCCESS)
342
- {
343
- return;
344
- }
345
-
346
- if (string.IsNullOrEmpty(result.content))
347
- {
348
- return;
349
- }
350
- TapLog.Log("TapSdk4UnityDemo -->> Bridge Callback == " + JsonConvert.SerializeObject(result));
351
-
352
- });
353
- 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
+ }
354
345
  }
355
346
  }
356
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
 
@@ -46,29 +47,29 @@ namespace TapSDK.RelationLite.Internal
46
47
  _impl?.InviteTeam(teamId);
47
48
  }
48
49
 
49
- public void GetFriendsList(string nextPageToken, ITapTapRelationLiteRequestCallback callback)
50
+ public Task<RelationLiteUserResult> GetFriendsList(string nextPageToken)
50
51
  {
51
- _impl?.GetFriendsList(nextPageToken, callback);
52
+ return _impl?.GetFriendsList(nextPageToken);
52
53
  }
53
54
 
54
- public void GetFollowingList(string nextPageToken, ITapTapRelationLiteRequestCallback callback)
55
+ public Task<RelationLiteUserResult> GetFollowingList(string nextPageToken)
55
56
  {
56
- _impl?.GetFollowingList(nextPageToken, callback);
57
+ return _impl?.GetFollowingList(nextPageToken);
57
58
  }
58
59
 
59
- public void GetFansList(string nextPageToken, ITapTapRelationLiteRequestCallback callback)
60
+ public Task<RelationLiteUserResult> GetFansList(string nextPageToken)
60
61
  {
61
- _impl?.GetFansList(nextPageToken, callback);
62
+ return _impl?.GetFansList(nextPageToken);
62
63
  }
63
64
 
64
- 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)
65
66
  {
66
- _impl?.SyncRelationshipWithOpenId(action, nickname, friendNickname, friendOpenId, callback);
67
+ return _impl?.SyncRelationshipWithOpenId(action, nickname, friendNickname, friendOpenId);
67
68
  }
68
69
 
69
- 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)
70
71
  {
71
- _impl?.SyncRelationshipWithUnionId(action, nickname, friendNickname, friendUnionId, callback);
72
+ return _impl?.SyncRelationshipWithUnionId(action, nickname, friendNickname, friendUnionId);
72
73
  }
73
74
 
74
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
@@ -11,15 +12,15 @@ namespace TapSDK.RelationLite
11
12
 
12
13
  void InviteTeam(string teamId);
13
14
 
14
- void GetFriendsList(string nextPageToken, ITapTapRelationLiteRequestCallback callback);
15
+ Task<RelationLiteUserResult> GetFriendsList(string nextPageToken);
15
16
 
16
- void GetFollowingList(string nextPageToken, ITapTapRelationLiteRequestCallback callback);
17
+ Task<RelationLiteUserResult> GetFollowingList(string nextPageToken);
17
18
 
18
- void GetFansList(string nextPageToken, ITapTapRelationLiteRequestCallback callback);
19
+ Task<RelationLiteUserResult> GetFansList(string nextPageToken);
19
20
 
20
- void SyncRelationshipWithOpenId(int action, string nickname,string friendNickname, string friendOpenId, ITapTapRelationLiteRequestCallback callback);
21
+ Task SyncRelationshipWithOpenId(int action, string nickname,string friendNickname, string friendOpenId);
21
22
 
22
- void SyncRelationshipWithUnionId(int action, string nickname,string friendNickname, string friendUnionId, ITapTapRelationLiteRequestCallback callback);
23
+ Task SyncRelationshipWithUnionId(int action, string nickname,string friendNickname, string friendUnionId);
23
24
 
24
25
  void ShowTapUserProfile(string openId, string unionId);
25
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
  {
@@ -32,29 +33,29 @@ namespace TapSDK.RelationLite
32
33
  TapTapRelationLiteManager.Instance.InviteTeam(teamId);
33
34
  }
34
35
 
35
- public static void GetFriendsList(string nextPageToken, ITapTapRelationLiteRequestCallback callback)
36
+ public static Task<RelationLiteUserResult> GetFriendsList(string nextPageToken)
36
37
  {
37
- TapTapRelationLiteManager.Instance.GetFriendsList(nextPageToken, callback);
38
+ return TapTapRelationLiteManager.Instance.GetFriendsList(nextPageToken);
38
39
  }
39
40
 
40
- public static void GetFollowingList(string nextPageToken, ITapTapRelationLiteRequestCallback callback)
41
+ public static Task<RelationLiteUserResult> GetFollowingList(string nextPageToken)
41
42
  {
42
- TapTapRelationLiteManager.Instance.GetFollowingList(nextPageToken, callback);
43
+ return TapTapRelationLiteManager.Instance.GetFollowingList(nextPageToken);
43
44
  }
44
45
 
45
- public static void GetFansList(string nextPageToken, ITapTapRelationLiteRequestCallback callback)
46
+ public static Task<RelationLiteUserResult> GetFansList(string nextPageToken)
46
47
  {
47
- TapTapRelationLiteManager.Instance.GetFansList(nextPageToken, callback);
48
+ return TapTapRelationLiteManager.Instance.GetFansList(nextPageToken);
48
49
  }
49
50
 
50
- 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)
51
52
  {
52
- TapTapRelationLiteManager.Instance.SyncRelationshipWithOpenId(action, nickname, friendNickname, friendOpenId, callback);
53
+ return TapTapRelationLiteManager.Instance.SyncRelationshipWithOpenId(action, nickname, friendNickname, friendOpenId);
53
54
  }
54
55
 
55
- 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)
56
57
  {
57
- TapTapRelationLiteManager.Instance.SyncRelationshipWithUnionId(action, nickname, friendNickname, friendUnionId, callback);
58
+ return TapTapRelationLiteManager.Instance.SyncRelationshipWithUnionId(action, nickname, friendNickname, friendUnionId);
58
59
  }
59
60
 
60
61
  public static void ShowTapUserProfile(string openId, string unionId)
@@ -72,6 +73,6 @@ namespace TapSDK.RelationLite
72
73
  TapTapRelationLiteManager.Instance.UnregisterRelationLiteCallback(callback);
73
74
  }
74
75
 
75
- public static readonly string Version = "4.8.1";
76
+ public static readonly string Version = "4.8.3";
76
77
  }
77
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",
5
+ "version": "4.8.3",
6
6
  "unity": "2019.4",
7
7
  "license": "MIT",
8
8
  "dependencies": {
9
- "com.taptap.sdk.core": "4.8.1",
10
- "com.taptap.sdk.login": "4.8.1"
9
+ "com.taptap.sdk.core": "4.8.3",
10
+ "com.taptap.sdk.login": "4.8.3"
11
11
  }
12
12
  }