com.taptap.sdk.relationlite 4.10.4-beta.2 → 4.10.4
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.
- package/Mobile/Editor/BuidPostProcessor.cs +21 -0
- package/Mobile/Editor/NativeDependencies.xml +2 -2
- package/Mobile/Editor/TapRelationLiteAndroidPostGenerateGradleProject.cs +221 -0
- package/Mobile/Editor/TapRelationLiteAndroidPostGenerateGradleProject.cs.meta +11 -0
- package/Mobile/Runtime/TapTapRelationLiteImpl.cs +89 -2
- package/Plugins/iOS/TapTapSDKRelationLiteAppDelegate.mm +37 -0
- package/Plugins/iOS/TapTapSDKRelationLiteAppDelegate.mm.meta +37 -0
- package/Plugins/iOS.meta +8 -0
- package/Plugins.meta +8 -0
- package/Runtime/Internal/TapTapRelationLiteManager.cs +11 -2
- package/Runtime/Public/ITapTapRelationLite.cs +6 -2
- package/Runtime/Public/ITapTapRelationLiteInviteCallback.cs +9 -0
- package/Runtime/Public/ITapTapRelationLiteInviteCallback.cs.meta +11 -0
- package/Runtime/Public/TapTapRelationLite.cs +12 -2
- package/package.json +3 -3
|
@@ -12,11 +12,16 @@ using TapSDK.Core.Editor;
|
|
|
12
12
|
#if UNITY_IOS
|
|
13
13
|
public class BuildPostProcessor
|
|
14
14
|
{
|
|
15
|
+
private const string RELATION_URL_SCHEME_PREFIX = "tds";
|
|
16
|
+
private const string RELATION_URL_SCHEME_NAME = "TapTapRelation";
|
|
17
|
+
|
|
15
18
|
[PostProcessBuild(999)]
|
|
16
19
|
public static void OnPostProcessBuild(BuildTarget buildTarget, string path)
|
|
17
20
|
{
|
|
18
21
|
if (buildTarget == BuildTarget.iOS)
|
|
19
22
|
{
|
|
23
|
+
AddRelationURLScheme(path);
|
|
24
|
+
|
|
20
25
|
var projPath = TapSDKCoreCompile.GetProjPath(path);
|
|
21
26
|
var proj = TapSDKCoreCompile.ParseProjPath(projPath);
|
|
22
27
|
var target = TapSDKCoreCompile.GetUnityTarget(proj);
|
|
@@ -52,5 +57,21 @@ public class BuildPostProcessor
|
|
|
52
57
|
Debug.LogWarning("TapRelationLite add Bundle Failed!");
|
|
53
58
|
}
|
|
54
59
|
}
|
|
60
|
+
|
|
61
|
+
private static void AddRelationURLScheme(string path)
|
|
62
|
+
{
|
|
63
|
+
var clientId = TapSDKCoreCompile.GetAppClientIdFromTDSInfo(Application.dataPath);
|
|
64
|
+
if (string.IsNullOrEmpty(clientId))
|
|
65
|
+
{
|
|
66
|
+
Debug.LogError("TapRelationLite Can't find app.client_id in TDS-Info.json or taptap.client_id in fallback TDS-Info.plist!");
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
TapSDKCoreCompile.AddURLSchemeToPlist(
|
|
71
|
+
Path.GetFullPath(path),
|
|
72
|
+
RELATION_URL_SCHEME_NAME,
|
|
73
|
+
RELATION_URL_SCHEME_PREFIX + clientId
|
|
74
|
+
);
|
|
75
|
+
}
|
|
55
76
|
}
|
|
56
77
|
#endif
|
|
@@ -4,12 +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.10.4
|
|
7
|
+
<androidPackage spec="com.taptap.sdk:tap-relation-lite-unity:4.10.4" />
|
|
8
8
|
</androidPackages>
|
|
9
9
|
<iosPods>
|
|
10
10
|
<sources>
|
|
11
11
|
<source>https://github.com/CocoaPods/Specs.git</source>
|
|
12
12
|
</sources>
|
|
13
|
-
<iosPod addToAllTargets="false" bitcodeEnabled="false" name="TapTapSDK/RelationLite" version="4.10.4
|
|
13
|
+
<iosPod addToAllTargets="false" bitcodeEnabled="false" name="TapTapSDK/RelationLite" version="4.10.4" />
|
|
14
14
|
</iosPods>
|
|
15
15
|
</dependencies>
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
using System.Collections.Generic;
|
|
2
|
+
using System.IO;
|
|
3
|
+
using System.Xml;
|
|
4
|
+
using TapSDK.Core.Editor;
|
|
5
|
+
using UnityEditor.Android;
|
|
6
|
+
using UnityEngine;
|
|
7
|
+
|
|
8
|
+
namespace TapSDK.RelationLite.Mobile.Editor
|
|
9
|
+
{
|
|
10
|
+
public class TapRelationLiteAndroidPostGenerateGradleProject : IPostGenerateGradleAndroidProject
|
|
11
|
+
{
|
|
12
|
+
private const string AndroidNamespaceUri = "http://schemas.android.com/apk/res/android";
|
|
13
|
+
private const string RouterActivityName = "com.taptap.sdk.relation.lite.TapRelationLiteRouterActivity";
|
|
14
|
+
private const string RouterActivityTheme = "@android:style/Theme.Translucent.NoTitleBar";
|
|
15
|
+
private static readonly string[] InviteHosts = { "invite_game", "invite_team" };
|
|
16
|
+
|
|
17
|
+
public int callbackOrder => 0;
|
|
18
|
+
|
|
19
|
+
public void OnPostGenerateGradleAndroidProject(string path)
|
|
20
|
+
{
|
|
21
|
+
string manifestPath = GetLauncherManifestPath(path);
|
|
22
|
+
if (string.IsNullOrEmpty(manifestPath) || !File.Exists(manifestPath))
|
|
23
|
+
{
|
|
24
|
+
Debug.LogWarning($"[TapSDK][RelationLite] AndroidManifest.xml not found under: {path}");
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
var clientIds = ExtractClientIds();
|
|
29
|
+
if (clientIds.Count == 0)
|
|
30
|
+
{
|
|
31
|
+
Debug.LogWarning("[TapSDK][RelationLite] No clientId found, skip relation lite scheme intent-filter.");
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
EnsureRelationRouterIntentFilters(manifestPath, clientIds);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
private static string GetLauncherManifestPath(string exportPath)
|
|
39
|
+
{
|
|
40
|
+
string[] candidates =
|
|
41
|
+
{
|
|
42
|
+
Path.Combine(exportPath, "launcher", "src", "main", "AndroidManifest.xml"),
|
|
43
|
+
Path.Combine(exportPath, "src", "main", "AndroidManifest.xml")
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
foreach (string candidate in candidates)
|
|
47
|
+
{
|
|
48
|
+
if (File.Exists(candidate))
|
|
49
|
+
{
|
|
50
|
+
return candidate;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
private static HashSet<string> ExtractClientIds()
|
|
58
|
+
{
|
|
59
|
+
var clientIds = new HashSet<string>();
|
|
60
|
+
var clientId = TapSDKCoreCompile.GetAppClientIdFromTDSInfo(Application.dataPath);
|
|
61
|
+
if (string.IsNullOrEmpty(clientId))
|
|
62
|
+
{
|
|
63
|
+
Debug.LogWarning("[TapSDK][RelationLite] app.client_id not found in TDS-Info.json or taptap.client_id not found in fallback TDS-Info.plist, skip relation lite scheme intent-filter.");
|
|
64
|
+
return clientIds;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
clientIds.Add(clientId);
|
|
68
|
+
return clientIds;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
private static void EnsureRelationRouterIntentFilters(string manifestPath, HashSet<string> clientIds)
|
|
72
|
+
{
|
|
73
|
+
var document = new XmlDocument();
|
|
74
|
+
document.Load(manifestPath);
|
|
75
|
+
|
|
76
|
+
XmlElement manifestElement = document.DocumentElement;
|
|
77
|
+
XmlElement applicationElement = manifestElement?.SelectSingleNode("application") as XmlElement;
|
|
78
|
+
if (applicationElement == null)
|
|
79
|
+
{
|
|
80
|
+
Debug.LogWarning($"[TapSDK][RelationLite] <application> node not found in manifest: {manifestPath}");
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
XmlElement activityElement = FindActivity(applicationElement);
|
|
85
|
+
bool changed = false;
|
|
86
|
+
if (activityElement == null)
|
|
87
|
+
{
|
|
88
|
+
activityElement = document.CreateElement("activity");
|
|
89
|
+
activityElement.SetAttribute("name", AndroidNamespaceUri, RouterActivityName);
|
|
90
|
+
applicationElement.AppendChild(activityElement);
|
|
91
|
+
changed = true;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (activityElement.GetAttribute("exported", AndroidNamespaceUri) != "true")
|
|
95
|
+
{
|
|
96
|
+
activityElement.SetAttribute("exported", AndroidNamespaceUri, "true");
|
|
97
|
+
changed = true;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (activityElement.GetAttribute("noHistory", AndroidNamespaceUri) != "true")
|
|
101
|
+
{
|
|
102
|
+
activityElement.SetAttribute("noHistory", AndroidNamespaceUri, "true");
|
|
103
|
+
changed = true;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (activityElement.GetAttribute("theme", AndroidNamespaceUri) != RouterActivityTheme)
|
|
107
|
+
{
|
|
108
|
+
activityElement.SetAttribute("theme", AndroidNamespaceUri, RouterActivityTheme);
|
|
109
|
+
changed = true;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
foreach (string clientId in clientIds)
|
|
113
|
+
{
|
|
114
|
+
string scheme = "tds" + clientId;
|
|
115
|
+
foreach (string host in InviteHosts)
|
|
116
|
+
{
|
|
117
|
+
if (HasIntentFilter(activityElement, scheme, host))
|
|
118
|
+
{
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
activityElement.AppendChild(CreateIntentFilter(document, scheme, host));
|
|
123
|
+
changed = true;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if (changed)
|
|
128
|
+
{
|
|
129
|
+
SaveXml(document, manifestPath);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
private static XmlElement FindActivity(XmlElement applicationElement)
|
|
134
|
+
{
|
|
135
|
+
foreach (XmlNode child in applicationElement.ChildNodes)
|
|
136
|
+
{
|
|
137
|
+
XmlElement element = child as XmlElement;
|
|
138
|
+
if (element == null || element.Name != "activity")
|
|
139
|
+
{
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if (element.GetAttribute("name", AndroidNamespaceUri) == RouterActivityName)
|
|
144
|
+
{
|
|
145
|
+
return element;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
private static bool HasIntentFilter(XmlElement activityElement, string scheme, string host)
|
|
153
|
+
{
|
|
154
|
+
foreach (XmlNode filterNode in activityElement.ChildNodes)
|
|
155
|
+
{
|
|
156
|
+
XmlElement filterElement = filterNode as XmlElement;
|
|
157
|
+
if (filterElement == null || filterElement.Name != "intent-filter")
|
|
158
|
+
{
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
foreach (XmlNode dataNode in filterElement.ChildNodes)
|
|
163
|
+
{
|
|
164
|
+
XmlElement dataElement = dataNode as XmlElement;
|
|
165
|
+
if (dataElement == null || dataElement.Name != "data")
|
|
166
|
+
{
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
if (dataElement.GetAttribute("scheme", AndroidNamespaceUri) == scheme &&
|
|
171
|
+
dataElement.GetAttribute("host", AndroidNamespaceUri) == host)
|
|
172
|
+
{
|
|
173
|
+
return true;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
private static XmlElement CreateIntentFilter(XmlDocument document, string scheme, string host)
|
|
182
|
+
{
|
|
183
|
+
XmlElement intentFilter = document.CreateElement("intent-filter");
|
|
184
|
+
|
|
185
|
+
XmlElement action = document.CreateElement("action");
|
|
186
|
+
action.SetAttribute("name", AndroidNamespaceUri, "android.intent.action.VIEW");
|
|
187
|
+
intentFilter.AppendChild(action);
|
|
188
|
+
|
|
189
|
+
XmlElement defaultCategory = document.CreateElement("category");
|
|
190
|
+
defaultCategory.SetAttribute("name", AndroidNamespaceUri, "android.intent.category.DEFAULT");
|
|
191
|
+
intentFilter.AppendChild(defaultCategory);
|
|
192
|
+
|
|
193
|
+
XmlElement browsableCategory = document.CreateElement("category");
|
|
194
|
+
browsableCategory.SetAttribute("name", AndroidNamespaceUri, "android.intent.category.BROWSABLE");
|
|
195
|
+
intentFilter.AppendChild(browsableCategory);
|
|
196
|
+
|
|
197
|
+
XmlElement data = document.CreateElement("data");
|
|
198
|
+
data.SetAttribute("scheme", AndroidNamespaceUri, scheme);
|
|
199
|
+
data.SetAttribute("host", AndroidNamespaceUri, host);
|
|
200
|
+
intentFilter.AppendChild(data);
|
|
201
|
+
|
|
202
|
+
return intentFilter;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
private static void SaveXml(XmlDocument document, string path)
|
|
206
|
+
{
|
|
207
|
+
var settings = new XmlWriterSettings
|
|
208
|
+
{
|
|
209
|
+
Indent = true,
|
|
210
|
+
IndentChars = " ",
|
|
211
|
+
NewLineChars = "\n",
|
|
212
|
+
NewLineHandling = NewLineHandling.Replace
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
using (XmlWriter writer = XmlWriter.Create(path, settings))
|
|
216
|
+
{
|
|
217
|
+
document.Save(writer);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
@@ -17,9 +17,16 @@ namespace TapSDK.RelationLite
|
|
|
17
17
|
{
|
|
18
18
|
public class TapTapRelationLiteImpl : ITapTapRelationLite
|
|
19
19
|
{
|
|
20
|
+
#if UNITY_IOS
|
|
21
|
+
[DllImport("__Internal")]
|
|
22
|
+
private static extern void RegisterTapTapSDKRelationLiteAppDelegateListener();
|
|
23
|
+
#endif
|
|
24
|
+
|
|
20
25
|
private const string SERVICE_NAME = "BridgeRelationLiteService";
|
|
21
26
|
private static List<ITapTapRelationLiteCallback> callbacks = new List<ITapTapRelationLiteCallback>();
|
|
27
|
+
private static List<ITapTapRelationLiteInviteCallback> inviteCallbacks = new List<ITapTapRelationLiteInviteCallback>();
|
|
22
28
|
private static bool hasRegisterCallBack = false;
|
|
29
|
+
private static bool hasRegisterInviteCallBack = false;
|
|
23
30
|
private string _clientId;
|
|
24
31
|
private TapTapRegionType _regionType;
|
|
25
32
|
|
|
@@ -34,6 +41,9 @@ namespace TapSDK.RelationLite
|
|
|
34
41
|
{
|
|
35
42
|
_clientId = clientId;
|
|
36
43
|
_regionType = regionType;
|
|
44
|
+
#if UNITY_IOS
|
|
45
|
+
RegisterTapTapSDKRelationLiteAppDelegateListener();
|
|
46
|
+
#endif
|
|
37
47
|
TapLog.Log($"TapTapRelationLite Init with clientId: {clientId}, regionType: {regionType}");
|
|
38
48
|
}
|
|
39
49
|
|
|
@@ -332,7 +342,7 @@ namespace TapSDK.RelationLite
|
|
|
332
342
|
{
|
|
333
343
|
callbacks.Remove(callback);
|
|
334
344
|
// 当引擎中清除所有回调时,移除原生 callback
|
|
335
|
-
if (callbacks.Count == 0)
|
|
345
|
+
if (callbacks.Count == 0 && hasRegisterCallBack)
|
|
336
346
|
{
|
|
337
347
|
var command = new Command.Builder()
|
|
338
348
|
.Service(SERVICE_NAME)
|
|
@@ -340,11 +350,43 @@ namespace TapSDK.RelationLite
|
|
|
340
350
|
.Callback(false)
|
|
341
351
|
.OnceTime(false);
|
|
342
352
|
EngineBridge.GetInstance().CallHandler(command.CommandBuilder());
|
|
353
|
+
hasRegisterCallBack = false;
|
|
343
354
|
TapLog.Log("TapTapRelationLite UnregisterRelationLiteCallback");
|
|
344
355
|
}
|
|
345
356
|
}
|
|
346
357
|
}
|
|
347
358
|
|
|
359
|
+
public void RegisterRelationLiteInviteCallback(ITapTapRelationLiteInviteCallback callback)
|
|
360
|
+
{
|
|
361
|
+
if (callback == null) return;
|
|
362
|
+
InitRegisterInviteCallBack();
|
|
363
|
+
if (!inviteCallbacks.Contains(callback))
|
|
364
|
+
{
|
|
365
|
+
inviteCallbacks.Add(callback);
|
|
366
|
+
TapLog.Log("TapTapRelationLite RegisterRelationLiteInviteCallback");
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
public void UnregisterRelationLiteInviteCallback(ITapTapRelationLiteInviteCallback callback)
|
|
371
|
+
{
|
|
372
|
+
if (callback != null)
|
|
373
|
+
{
|
|
374
|
+
inviteCallbacks.Remove(callback);
|
|
375
|
+
// 当引擎中清除所有回调时,移除原生 invite callback
|
|
376
|
+
if (inviteCallbacks.Count == 0 && hasRegisterInviteCallBack)
|
|
377
|
+
{
|
|
378
|
+
var command = new Command.Builder()
|
|
379
|
+
.Service(SERVICE_NAME)
|
|
380
|
+
.Method("unregisterRelationLiteInviteCallback")
|
|
381
|
+
.Callback(false)
|
|
382
|
+
.OnceTime(false);
|
|
383
|
+
EngineBridge.GetInstance().CallHandler(command.CommandBuilder());
|
|
384
|
+
hasRegisterInviteCallBack = false;
|
|
385
|
+
TapLog.Log("TapTapRelationLite UnregisterRelationLiteInviteCallback");
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
348
390
|
private void InitRegisterCallBack()
|
|
349
391
|
{
|
|
350
392
|
if (hasRegisterCallBack)
|
|
@@ -382,5 +424,50 @@ namespace TapSDK.RelationLite
|
|
|
382
424
|
|
|
383
425
|
TapLog.Log("TapTapRelationLite InitRegisterCallBack");
|
|
384
426
|
}
|
|
427
|
+
|
|
428
|
+
private void InitRegisterInviteCallBack()
|
|
429
|
+
{
|
|
430
|
+
if (hasRegisterInviteCallBack)
|
|
431
|
+
{
|
|
432
|
+
return;
|
|
433
|
+
}
|
|
434
|
+
hasRegisterInviteCallBack = true;
|
|
435
|
+
|
|
436
|
+
var command = new Command.Builder();
|
|
437
|
+
command.Service(SERVICE_NAME);
|
|
438
|
+
command.Method("registerRelationLiteInviteCallback")
|
|
439
|
+
.Callback(true)
|
|
440
|
+
.OnceTime(false);
|
|
441
|
+
EngineBridge.GetInstance().CallHandler(command.CommandBuilder(), (result) =>
|
|
442
|
+
{
|
|
443
|
+
if (result.code != Result.RESULT_SUCCESS || string.IsNullOrEmpty(result.content))
|
|
444
|
+
{
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
try
|
|
449
|
+
{
|
|
450
|
+
TapLog.Log("TapTapRelationLite Invite -->> Bridge Callback == " + JsonConvert.SerializeObject(result));
|
|
451
|
+
var dic = Json.Deserialize(result.content) as Dictionary<string, object>;
|
|
452
|
+
var inviteType = SafeDictionary.GetValue<string>(dic, "invite_type");
|
|
453
|
+
var openId = SafeDictionary.GetValue<string>(dic, "open_id");
|
|
454
|
+
var unionId = SafeDictionary.GetValue<string>(dic, "union_id");
|
|
455
|
+
var teamId = SafeDictionary.GetValue<string>(dic, "team_id");
|
|
456
|
+
|
|
457
|
+
if (inviteType == "invite_team")
|
|
458
|
+
{
|
|
459
|
+
inviteCallbacks.ForEach(x => x.OnTeamInviteReceived(openId, unionId, teamId));
|
|
460
|
+
}
|
|
461
|
+
else if (inviteType == "invite_game")
|
|
462
|
+
{
|
|
463
|
+
inviteCallbacks.ForEach(x => x.OnGameInviteReceived(openId, unionId));
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
catch (Exception e)
|
|
467
|
+
{
|
|
468
|
+
TapLog.Error($"TapTapRelationLite invite callback parse result error: {e.Message}");
|
|
469
|
+
}
|
|
470
|
+
});
|
|
471
|
+
}
|
|
385
472
|
}
|
|
386
|
-
}
|
|
473
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#import <UIKit/UIKit.h>
|
|
2
|
+
#import <Foundation/Foundation.h>
|
|
3
|
+
#import <TapTapRelationLiteSDK/TapTapRelationLiteSDK-Swift.h>
|
|
4
|
+
#import "UnityAppController.h"
|
|
5
|
+
#import "AppDelegateListener.h"
|
|
6
|
+
|
|
7
|
+
@interface TapTapSDKRelationLiteAppDelegateListener : NSObject<AppDelegateListener>
|
|
8
|
+
|
|
9
|
+
+ (instancetype)sharedInstance;
|
|
10
|
+
|
|
11
|
+
@end
|
|
12
|
+
|
|
13
|
+
@implementation TapTapSDKRelationLiteAppDelegateListener
|
|
14
|
+
|
|
15
|
+
+ (instancetype)sharedInstance {
|
|
16
|
+
static TapTapSDKRelationLiteAppDelegateListener *sharedInstance = nil;
|
|
17
|
+
static dispatch_once_t onceToken;
|
|
18
|
+
dispatch_once(&onceToken, ^{
|
|
19
|
+
sharedInstance = [[TapTapSDKRelationLiteAppDelegateListener alloc] init];
|
|
20
|
+
});
|
|
21
|
+
return sharedInstance;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
- (void)onOpenURL:(NSNotification *)notification {
|
|
25
|
+
NSDictionary *userInfo = notification.userInfo;
|
|
26
|
+
NSURL *url = [userInfo valueForKey:@"url"];
|
|
27
|
+
if (url) {
|
|
28
|
+
[TapTapRelationLite openWithUrl:url];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@end
|
|
33
|
+
|
|
34
|
+
extern "C" void RegisterTapTapSDKRelationLiteAppDelegateListener() {
|
|
35
|
+
TapTapSDKRelationLiteAppDelegateListener *listener = TapTapSDKRelationLiteAppDelegateListener.sharedInstance;
|
|
36
|
+
UnityRegisterAppDelegateListener(listener);
|
|
37
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: ee266ca6e7074cc7bf3e7cf2d80745d8
|
|
3
|
+
PluginImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
iconMap: {}
|
|
7
|
+
executionOrder: {}
|
|
8
|
+
defineConstraints: []
|
|
9
|
+
isPreloaded: 0
|
|
10
|
+
isOverridable: 0
|
|
11
|
+
isExplicitlyReferenced: 0
|
|
12
|
+
validateReferences: 1
|
|
13
|
+
platformData:
|
|
14
|
+
- first:
|
|
15
|
+
Any:
|
|
16
|
+
second:
|
|
17
|
+
enabled: 0
|
|
18
|
+
settings: {}
|
|
19
|
+
- first:
|
|
20
|
+
Editor: Editor
|
|
21
|
+
second:
|
|
22
|
+
enabled: 0
|
|
23
|
+
settings:
|
|
24
|
+
DefaultValueInitialized: true
|
|
25
|
+
- first:
|
|
26
|
+
iPhone: iOS
|
|
27
|
+
second:
|
|
28
|
+
enabled: 1
|
|
29
|
+
settings: {}
|
|
30
|
+
- first:
|
|
31
|
+
tvOS: tvOS
|
|
32
|
+
second:
|
|
33
|
+
enabled: 1
|
|
34
|
+
settings: {}
|
|
35
|
+
userData:
|
|
36
|
+
assetBundleName:
|
|
37
|
+
assetBundleVariant:
|
package/Plugins/iOS.meta
ADDED
package/Plugins.meta
ADDED
|
@@ -77,7 +77,6 @@ namespace TapSDK.RelationLite.Internal
|
|
|
77
77
|
_impl?.ShowTapUserProfile(openId ?? "", unionId ?? "");
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
|
|
81
80
|
public void RegisterRelationLiteCallback(ITapTapRelationLiteCallback callback)
|
|
82
81
|
{
|
|
83
82
|
if (callback != null && !_relationCallbacks.Contains(callback))
|
|
@@ -95,5 +94,15 @@ namespace TapSDK.RelationLite.Internal
|
|
|
95
94
|
_impl?.UnregisterRelationLiteCallback(callback);
|
|
96
95
|
}
|
|
97
96
|
}
|
|
97
|
+
|
|
98
|
+
public void RegisterRelationLiteInviteCallback(ITapTapRelationLiteInviteCallback callback)
|
|
99
|
+
{
|
|
100
|
+
_impl?.RegisterRelationLiteInviteCallback(callback);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
public void UnregisterRelationLiteInviteCallback(ITapTapRelationLiteInviteCallback callback)
|
|
104
|
+
{
|
|
105
|
+
_impl?.UnregisterRelationLiteInviteCallback(callback);
|
|
106
|
+
}
|
|
98
107
|
}
|
|
99
|
-
}
|
|
108
|
+
}
|
|
@@ -23,9 +23,13 @@ namespace TapSDK.RelationLite
|
|
|
23
23
|
Task SyncRelationshipWithUnionId(int action, string nickname,string friendNickname, string friendUnionId);
|
|
24
24
|
|
|
25
25
|
void ShowTapUserProfile(string openId, string unionId);
|
|
26
|
-
|
|
26
|
+
|
|
27
27
|
void RegisterRelationLiteCallback(ITapTapRelationLiteCallback callback);
|
|
28
28
|
|
|
29
29
|
void UnregisterRelationLiteCallback(ITapTapRelationLiteCallback callback);
|
|
30
|
+
|
|
31
|
+
void RegisterRelationLiteInviteCallback(ITapTapRelationLiteInviteCallback callback);
|
|
32
|
+
|
|
33
|
+
void UnregisterRelationLiteInviteCallback(ITapTapRelationLiteInviteCallback callback);
|
|
30
34
|
}
|
|
31
|
-
}
|
|
35
|
+
}
|
|
@@ -68,6 +68,16 @@ namespace TapSDK.RelationLite
|
|
|
68
68
|
TapTapRelationLiteManager.Instance.UnregisterRelationLiteCallback(callback);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
public static
|
|
71
|
+
public static void RegisterRelationLiteInviteCallback(ITapTapRelationLiteInviteCallback callback)
|
|
72
|
+
{
|
|
73
|
+
TapTapRelationLiteManager.Instance.RegisterRelationLiteInviteCallback(callback);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
public static void UnregisterRelationLiteInviteCallback(ITapTapRelationLiteInviteCallback callback)
|
|
77
|
+
{
|
|
78
|
+
TapTapRelationLiteManager.Instance.UnregisterRelationLiteInviteCallback(callback);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
public static readonly string Version = "4.10.4";
|
|
72
82
|
}
|
|
73
|
-
}
|
|
83
|
+
}
|
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.10.4
|
|
5
|
+
"version": "4.10.4",
|
|
6
6
|
"unity": "2019.4",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"com.taptap.sdk.core": "4.10.4
|
|
10
|
-
"com.taptap.sdk.login": "4.10.4
|
|
9
|
+
"com.taptap.sdk.core": "4.10.4",
|
|
10
|
+
"com.taptap.sdk.login": "4.10.4"
|
|
11
11
|
}
|
|
12
12
|
}
|