com.taptap.sdk.relation 4.6.0-beta.1
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/NativeDependencies.xml +9 -0
- package/Mobile/Editor/NativeDependencies.xml.meta +7 -0
- package/Mobile/Editor/TapRelationMobileProcessBuild.cs +20 -0
- package/Mobile/Editor/TapRelationMobileProcessBuild.cs.meta +11 -0
- package/Mobile/Editor/TapTap.Relation.Mobile.Editor.asmdef +17 -0
- package/Mobile/Editor/TapTap.Relation.Mobile.Editor.asmdef.meta +7 -0
- package/Mobile/Editor.meta +3 -0
- package/Mobile/Runtime/TapSDK.Relation.Mobile.Runtime.asmdef +21 -0
- package/Mobile/Runtime/TapSDK.Relation.Mobile.Runtime.asmdef.meta +7 -0
- package/Mobile/Runtime/TapTapRelationImpl.cs +257 -0
- package/Mobile/Runtime/TapTapRelationImpl.cs.meta +11 -0
- package/Mobile/Runtime.meta +8 -0
- package/Mobile.meta +8 -0
- package/Runtime/Internal/Init/RelationInitTask.cs +20 -0
- package/Runtime/Internal/Init/RelationInitTask.cs.meta +11 -0
- package/Runtime/Internal/Init.meta +8 -0
- package/Runtime/Internal/TapTapRelationManager.cs +102 -0
- package/Runtime/Internal/TapTapRelationManager.cs.meta +11 -0
- package/Runtime/Internal.meta +8 -0
- package/Runtime/Public/DisplayInfo.cs +22 -0
- package/Runtime/Public/DisplayInfo.cs.meta +11 -0
- package/Runtime/Public/ITapTapRelation.cs +32 -0
- package/Runtime/Public/ITapTapRelation.cs.meta +11 -0
- package/Runtime/Public/ITapTapRelationCallback.cs +11 -0
- package/Runtime/Public/ITapTapRelationCallback.cs.meta +11 -0
- package/Runtime/Public/TapTapRelation.cs +83 -0
- package/Runtime/Public/TapTapRelation.cs.meta +11 -0
- package/Runtime/Public.meta +8 -0
- package/Runtime/TapSDK.Relation.Runtime.asmdef +15 -0
- package/Runtime/TapSDK.Relation.Runtime.asmdef.meta +7 -0
- package/Runtime.meta +8 -0
- package/package.json +12 -0
- package/package.json.meta +7 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<?xml version="1.0" ?>
|
|
2
|
+
<dependencies>
|
|
3
|
+
<androidPackages>
|
|
4
|
+
<repositories>
|
|
5
|
+
<repository>https://repo.maven.apache.org/maven2</repository>
|
|
6
|
+
</repositories>
|
|
7
|
+
<androidPackage spec="com.taptap.sdk:tap-relation-unity:4.6.0-beta.1"/>
|
|
8
|
+
</androidPackages>
|
|
9
|
+
</dependencies>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using UnityEditor.Build.Reporting;
|
|
3
|
+
using TapSDK.Core.Editor;
|
|
4
|
+
|
|
5
|
+
namespace TapTap.Relation.Mobile.Editor {
|
|
6
|
+
public class TapRelationMobileProcessBuild : SDKLinkProcessBuild {
|
|
7
|
+
public override int callbackOrder => 0;
|
|
8
|
+
|
|
9
|
+
public override string LinkPath => "TapSDK/Relation/link.xml";
|
|
10
|
+
|
|
11
|
+
public override LinkedAssembly[] LinkedAssemblies => new LinkedAssembly[] {
|
|
12
|
+
new LinkedAssembly { Fullname = "TapTap.Relation.Runtime" },
|
|
13
|
+
new LinkedAssembly { Fullname = "TapTap.Relation.Mobile.Runtime" }
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
public override Func<BuildReport, bool> IsTargetPlatform => (report) => {
|
|
17
|
+
return BuildTargetUtils.IsSupportMobile(report.summary.platform);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "TapTap.Relation.Mobile.Editor",
|
|
3
|
+
"references": [
|
|
4
|
+
"GUID:56f3da7a178484843974054bafe77e73"
|
|
5
|
+
],
|
|
6
|
+
"includePlatforms": [
|
|
7
|
+
"Editor"
|
|
8
|
+
],
|
|
9
|
+
"excludePlatforms": [],
|
|
10
|
+
"allowUnsafeCode": false,
|
|
11
|
+
"overrideReferences": false,
|
|
12
|
+
"precompiledReferences": [],
|
|
13
|
+
"autoReferenced": true,
|
|
14
|
+
"defineConstraints": [],
|
|
15
|
+
"versionDefines": [],
|
|
16
|
+
"noEngineReferences": false
|
|
17
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "TapSDK.Relation.Mobile.Runtime",
|
|
3
|
+
"references": [
|
|
4
|
+
"GUID:5f5654759b7534ddebacbe2e8ef8a8da",
|
|
5
|
+
"GUID:7d5ef2062f3704e1ab74aac0e4d5a1a7",
|
|
6
|
+
"GUID:10560023d8780423cb943c7a324b69f2",
|
|
7
|
+
"GUID:6f33d8db82c9445088544f91d41e65a2"
|
|
8
|
+
],
|
|
9
|
+
"includePlatforms": [
|
|
10
|
+
"Android",
|
|
11
|
+
"iOS"
|
|
12
|
+
],
|
|
13
|
+
"excludePlatforms": [],
|
|
14
|
+
"allowUnsafeCode": false,
|
|
15
|
+
"overrideReferences": false,
|
|
16
|
+
"precompiledReferences": [],
|
|
17
|
+
"autoReferenced": true,
|
|
18
|
+
"defineConstraints": [],
|
|
19
|
+
"versionDefines": [],
|
|
20
|
+
"noEngineReferences": false
|
|
21
|
+
}
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Threading.Tasks;
|
|
3
|
+
using TapSDK.Core;
|
|
4
|
+
using TapSDK.Relation;
|
|
5
|
+
using UnityEngine;
|
|
6
|
+
using System.Collections.Generic;
|
|
7
|
+
using Newtonsoft.Json;
|
|
8
|
+
using System.Runtime.InteropServices;
|
|
9
|
+
#if UNITY_IOS
|
|
10
|
+
using UnityEngine.iOS;
|
|
11
|
+
#endif
|
|
12
|
+
|
|
13
|
+
namespace TapSDK.Relation.Mobile
|
|
14
|
+
{
|
|
15
|
+
public class TapTapRelationImpl : ITapTapRelation
|
|
16
|
+
{
|
|
17
|
+
private const string SERVICE_NAME = "BridgeRelationService";
|
|
18
|
+
private static List<ITapTapRelationCallback> callbacks = new List<ITapTapRelationCallback>();
|
|
19
|
+
private static bool hasRegisterCallBack = false;
|
|
20
|
+
|
|
21
|
+
public TapTapRelationImpl()
|
|
22
|
+
{
|
|
23
|
+
EngineBridge.GetInstance().Register(
|
|
24
|
+
"com.taptap.sdk.relation.unity.BridgeRelationService",
|
|
25
|
+
"com.taptap.sdk.relation.unity.BridgeRelationServiceImpl");
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public void Init(string clientId, TapTapRegionType regionType, int screenOrientation)
|
|
29
|
+
{
|
|
30
|
+
EngineBridge.GetInstance().CallHandler(new Command.Builder()
|
|
31
|
+
.Service(SERVICE_NAME)
|
|
32
|
+
.Method("setOrientation")
|
|
33
|
+
.Args("orientation", screenOrientation)
|
|
34
|
+
.Callback(false)
|
|
35
|
+
.OnceTime(true)
|
|
36
|
+
.CommandBuilder());
|
|
37
|
+
}
|
|
38
|
+
|
|
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
|
+
public void StartMessenger()
|
|
51
|
+
{
|
|
52
|
+
EngineBridge.GetInstance().CallHandler(new Command.Builder()
|
|
53
|
+
.Service(SERVICE_NAME)
|
|
54
|
+
.Method("startMessenger")
|
|
55
|
+
.Callback(false)
|
|
56
|
+
.OnceTime(true)
|
|
57
|
+
.CommandBuilder());
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
public void Prepare()
|
|
61
|
+
{
|
|
62
|
+
EngineBridge.GetInstance().CallHandler(new Command.Builder()
|
|
63
|
+
.Service(SERVICE_NAME)
|
|
64
|
+
.Method("prepare")
|
|
65
|
+
.Callback(false)
|
|
66
|
+
.OnceTime(true)
|
|
67
|
+
.CommandBuilder());
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
public void InviteGame()
|
|
71
|
+
{
|
|
72
|
+
EngineBridge.GetInstance().CallHandler(new Command.Builder()
|
|
73
|
+
.Service(SERVICE_NAME)
|
|
74
|
+
.Method("inviteGame")
|
|
75
|
+
.Callback(false)
|
|
76
|
+
.OnceTime(true)
|
|
77
|
+
.CommandBuilder());
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
public void InviteTeam(string teamId)
|
|
81
|
+
{
|
|
82
|
+
EngineBridge.GetInstance().CallHandler(new Command.Builder()
|
|
83
|
+
.Service(SERVICE_NAME)
|
|
84
|
+
.Method("inviteTeam")
|
|
85
|
+
.Args("teamId", teamId)
|
|
86
|
+
.Callback(false)
|
|
87
|
+
.OnceTime(true)
|
|
88
|
+
.CommandBuilder());
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
public void ShowTapUserProfile(string openId, string unionId)
|
|
92
|
+
{
|
|
93
|
+
EngineBridge.GetInstance().CallHandler(new Command.Builder()
|
|
94
|
+
.Service(SERVICE_NAME)
|
|
95
|
+
.Method("showTapUserProfile")
|
|
96
|
+
.Args("openId", openId)
|
|
97
|
+
.Args("unionId", unionId)
|
|
98
|
+
.Callback(false)
|
|
99
|
+
.OnceTime(true)
|
|
100
|
+
.CommandBuilder());
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
public void GetNewFansCount(Action<int> callback)
|
|
104
|
+
{
|
|
105
|
+
EngineBridge.GetInstance().CallHandler(new Command.Builder()
|
|
106
|
+
.Service(SERVICE_NAME)
|
|
107
|
+
.Method("getNewFansCount")
|
|
108
|
+
.Callback(true)
|
|
109
|
+
.OnceTime(true)
|
|
110
|
+
.CommandBuilder(), (result) =>
|
|
111
|
+
{
|
|
112
|
+
if (callback == null) return;
|
|
113
|
+
|
|
114
|
+
try
|
|
115
|
+
{
|
|
116
|
+
if (result.code != Result.RESULT_SUCCESS || string.IsNullOrEmpty(result.content))
|
|
117
|
+
{
|
|
118
|
+
callback(0);
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
var dic = Json.Deserialize(result.content) as Dictionary<string, object>;
|
|
123
|
+
if (dic != null && dic.ContainsKey("new_fans_count"))
|
|
124
|
+
{
|
|
125
|
+
int fansCount = SafeDictionary.GetValue<int>(dic, "new_fans_count");
|
|
126
|
+
callback(fansCount);
|
|
127
|
+
}
|
|
128
|
+
else
|
|
129
|
+
{
|
|
130
|
+
callback(0);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
catch (Exception e)
|
|
134
|
+
{
|
|
135
|
+
Debug.LogError($"GetNewFansCount parse result error: {e.Message}");
|
|
136
|
+
callback(0);
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
public void GetUnreadMessageCount(Action<int> callback)
|
|
142
|
+
{
|
|
143
|
+
EngineBridge.GetInstance().CallHandler(new Command.Builder()
|
|
144
|
+
.Service(SERVICE_NAME)
|
|
145
|
+
.Method("getUnreadMessageCount")
|
|
146
|
+
.Callback(true)
|
|
147
|
+
.OnceTime(true)
|
|
148
|
+
.CommandBuilder(), (result) =>
|
|
149
|
+
{
|
|
150
|
+
if (callback == null) return;
|
|
151
|
+
|
|
152
|
+
try
|
|
153
|
+
{
|
|
154
|
+
if (result.code != Result.RESULT_SUCCESS || string.IsNullOrEmpty(result.content))
|
|
155
|
+
{
|
|
156
|
+
callback(0);
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
var dic = Json.Deserialize(result.content) as Dictionary<string, object>;
|
|
161
|
+
if (dic != null && dic.ContainsKey("unread_message_count"))
|
|
162
|
+
{
|
|
163
|
+
int unreadCount = SafeDictionary.GetValue<int>(dic, "unread_message_count");
|
|
164
|
+
callback(unreadCount);
|
|
165
|
+
}
|
|
166
|
+
else
|
|
167
|
+
{
|
|
168
|
+
callback(0);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
catch (Exception e)
|
|
172
|
+
{
|
|
173
|
+
Debug.LogError($"GetUnreadMessageCount parse result error: {e.Message}");
|
|
174
|
+
callback(0);
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
public void RegisterRelationCallback(ITapTapRelationCallback callback)
|
|
180
|
+
{
|
|
181
|
+
if (callback == null) return;
|
|
182
|
+
InitRegisterCallBack();
|
|
183
|
+
if (!callbacks.Contains(callback))
|
|
184
|
+
{
|
|
185
|
+
callbacks.Add(callback);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
public void UnregisterRelationCallback(ITapTapRelationCallback callback)
|
|
190
|
+
{
|
|
191
|
+
if (callback != null)
|
|
192
|
+
{
|
|
193
|
+
callbacks.Remove(callback);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
public void Destroy()
|
|
198
|
+
{
|
|
199
|
+
callbacks.Clear();
|
|
200
|
+
hasRegisterCallBack = false;
|
|
201
|
+
EngineBridge.GetInstance().CallHandler(new Command.Builder()
|
|
202
|
+
.Service(SERVICE_NAME)
|
|
203
|
+
.Method("destroy")
|
|
204
|
+
.Callback(false)
|
|
205
|
+
.OnceTime(true)
|
|
206
|
+
.CommandBuilder());
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
private void InitRegisterCallBack()
|
|
210
|
+
{
|
|
211
|
+
if (hasRegisterCallBack)
|
|
212
|
+
{
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
hasRegisterCallBack = true;
|
|
216
|
+
var command = new Command.Builder();
|
|
217
|
+
command.Service(SERVICE_NAME);
|
|
218
|
+
command.Method("registerRelationCallback")
|
|
219
|
+
.Callback(true)
|
|
220
|
+
.OnceTime(false);
|
|
221
|
+
EngineBridge.GetInstance().CallHandler(command.CommandBuilder(), (result) =>
|
|
222
|
+
{
|
|
223
|
+
if (result.code != Result.RESULT_SUCCESS)
|
|
224
|
+
{
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
if (string.IsNullOrEmpty(result.content))
|
|
229
|
+
{
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
Debug.Log("TapSdk4UnityDemo -->> Bridge Callback == " + JsonConvert.SerializeObject(result));
|
|
233
|
+
var dic = Json.Deserialize(result.content) as Dictionary<string, object>;
|
|
234
|
+
var code = SafeDictionary.GetValue<int>(dic, "relation_code");
|
|
235
|
+
var newFansCount = SafeDictionary.GetValue<int>(dic, "new_fans_count");
|
|
236
|
+
var unreadMessageCount = SafeDictionary.GetValue<int>(dic, "unread_message_count");
|
|
237
|
+
|
|
238
|
+
if (code != null)
|
|
239
|
+
{
|
|
240
|
+
callbacks.ForEach((x) => x.OnMessengerCodeResult(code));
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
if (newFansCount != null)
|
|
244
|
+
{
|
|
245
|
+
callbacks.ForEach((x) => x.OnNewFansCountChanged(code, newFansCount));
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
if (unreadMessageCount != null)
|
|
249
|
+
{
|
|
250
|
+
callbacks.ForEach((x) => x.OnUnreadMessageCountChanged(code, unreadMessageCount));
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
}
|
|
257
|
+
}
|
package/Mobile.meta
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
using TapSDK.Core;
|
|
2
|
+
using TapSDK.Core.Internal.Init;
|
|
3
|
+
using UnityEngine;
|
|
4
|
+
|
|
5
|
+
namespace TapSDK.Relation.Internal.Init {
|
|
6
|
+
public class RelationInitTask : IInitTask {
|
|
7
|
+
public int Order => 104;
|
|
8
|
+
|
|
9
|
+
public void Init(TapTapSdkOptions coreOption, TapTapSdkBaseOptions[] otherOptions)
|
|
10
|
+
{
|
|
11
|
+
Debug.LogWarningFormat("[TapSDK-init]Relation task init: " + "clientId=" + coreOption.clientId + ", region=" + coreOption.region + ", screenOrientation=" + coreOption.screenOrientation);
|
|
12
|
+
TapTapRelationManager.Instance.Init(coreOption.clientId, coreOption.region, coreOption.screenOrientation);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public void Init(TapTapSdkOptions coreOption)
|
|
16
|
+
{
|
|
17
|
+
TapTapRelationManager.Instance.Init(coreOption.clientId, coreOption.region, coreOption.screenOrientation);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using TapSDK.Core;
|
|
3
|
+
using TapSDK.Core.Internal.Utils;
|
|
4
|
+
using UnityEngine;
|
|
5
|
+
|
|
6
|
+
namespace TapSDK.Relation.Internal
|
|
7
|
+
{
|
|
8
|
+
public class TapTapRelationManager
|
|
9
|
+
{
|
|
10
|
+
private static TapTapRelationManager instance;
|
|
11
|
+
private ITapTapRelation platformWrapper;
|
|
12
|
+
|
|
13
|
+
private TapTapRelationManager()
|
|
14
|
+
{
|
|
15
|
+
Debug.LogWarningFormat("[TapSDK-init]create TapTapRelationManager");
|
|
16
|
+
platformWrapper = BridgeUtils.CreateBridgeImplementation(typeof(ITapTapRelation),
|
|
17
|
+
"TapSDK.Relation") as ITapTapRelation;
|
|
18
|
+
Debug.LogWarningFormat("[TapSDK-init]created TapTapRelationManager: " + platformWrapper);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
public static TapTapRelationManager Instance
|
|
22
|
+
{
|
|
23
|
+
get
|
|
24
|
+
{
|
|
25
|
+
if (instance == null)
|
|
26
|
+
{
|
|
27
|
+
instance = new TapTapRelationManager();
|
|
28
|
+
}
|
|
29
|
+
return instance;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public void Init(string clientId, TapTapRegionType regionType, int screenOrientation)
|
|
34
|
+
{
|
|
35
|
+
if (platformWrapper == null)
|
|
36
|
+
{
|
|
37
|
+
Debug.LogErrorFormat("[TapSDK-init]relation platformWrapper is null");
|
|
38
|
+
}
|
|
39
|
+
else
|
|
40
|
+
{
|
|
41
|
+
Debug.LogErrorFormat("[TapSDK-init]relation platformWrapper is not null");
|
|
42
|
+
}
|
|
43
|
+
platformWrapper.Init(clientId, regionType, screenOrientation);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public void SetOrientation(int orientation)
|
|
47
|
+
{
|
|
48
|
+
platformWrapper.SetOrientation(orientation);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
public void StartMessenger()
|
|
52
|
+
{
|
|
53
|
+
platformWrapper.StartMessenger();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
public void Prepare()
|
|
57
|
+
{
|
|
58
|
+
platformWrapper.Prepare();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
public void InviteGame()
|
|
62
|
+
{
|
|
63
|
+
platformWrapper.InviteGame();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
public void InviteTeam(string teamId)
|
|
67
|
+
{
|
|
68
|
+
platformWrapper.InviteTeam(teamId);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
public void ShowTapUserProfile(string openId, string unionId)
|
|
72
|
+
{
|
|
73
|
+
platformWrapper.ShowTapUserProfile(openId, unionId);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
public void GetNewFansCount(Action<int> callback)
|
|
77
|
+
{
|
|
78
|
+
platformWrapper.GetNewFansCount(callback);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
public void GetUnreadMessageCount(Action<int> callback)
|
|
82
|
+
{
|
|
83
|
+
platformWrapper.GetUnreadMessageCount(callback);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
public void RegisterRelationCallback(ITapTapRelationCallback callback)
|
|
87
|
+
{
|
|
88
|
+
platformWrapper.RegisterRelationCallback(callback);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
public void UnregisterRelationCallback(ITapTapRelationCallback callback)
|
|
92
|
+
{
|
|
93
|
+
platformWrapper.UnregisterRelationCallback(callback);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
public void Destroy()
|
|
97
|
+
{
|
|
98
|
+
platformWrapper.Destroy();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
using System.Collections.Generic;
|
|
2
|
+
using Newtonsoft.Json;
|
|
3
|
+
|
|
4
|
+
namespace TapSDK.Relation
|
|
5
|
+
{
|
|
6
|
+
public class DisplayInfo
|
|
7
|
+
{
|
|
8
|
+
// 页面名称
|
|
9
|
+
[JsonProperty("page")]
|
|
10
|
+
public string Page { get; set; }
|
|
11
|
+
// 额外信息
|
|
12
|
+
[JsonProperty("extras")]
|
|
13
|
+
public Dictionary<string, string> Extras { get; set; }
|
|
14
|
+
|
|
15
|
+
// 构造函数
|
|
16
|
+
public DisplayInfo(string page = "", Dictionary<string, string> extras = null)
|
|
17
|
+
{
|
|
18
|
+
Page = page;
|
|
19
|
+
Extras = extras ?? new Dictionary<string, string>();
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using TapSDK.Core;
|
|
3
|
+
|
|
4
|
+
namespace TapSDK.Relation
|
|
5
|
+
{
|
|
6
|
+
public interface ITapTapRelation
|
|
7
|
+
{
|
|
8
|
+
void Init(string clientId, TapTapRegionType regionType, int orientation);
|
|
9
|
+
|
|
10
|
+
void SetOrientation(int orientation);
|
|
11
|
+
|
|
12
|
+
void StartMessenger();
|
|
13
|
+
|
|
14
|
+
void Prepare();
|
|
15
|
+
|
|
16
|
+
void InviteGame();
|
|
17
|
+
|
|
18
|
+
void InviteTeam(string teamId);
|
|
19
|
+
|
|
20
|
+
void ShowTapUserProfile(string openId, string unionId);
|
|
21
|
+
|
|
22
|
+
void GetNewFansCount(Action<int> callback);
|
|
23
|
+
|
|
24
|
+
void GetUnreadMessageCount(Action<int> callback);
|
|
25
|
+
|
|
26
|
+
void RegisterRelationCallback(ITapTapRelationCallback callback);
|
|
27
|
+
|
|
28
|
+
void UnregisterRelationCallback(ITapTapRelationCallback callback);
|
|
29
|
+
|
|
30
|
+
void Destroy();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Collections.Generic;
|
|
3
|
+
using TapSDK.Relation.Internal;
|
|
4
|
+
using TapSDK.Core;
|
|
5
|
+
using TapSDK.Core.Internal.Utils;
|
|
6
|
+
|
|
7
|
+
namespace TapSDK.Relation
|
|
8
|
+
{
|
|
9
|
+
public class TapTapRelationConstants
|
|
10
|
+
{
|
|
11
|
+
//
|
|
12
|
+
public static readonly int CALLBACK_CODE_ON_STOP = 500;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public class TapTapRelation
|
|
16
|
+
{
|
|
17
|
+
|
|
18
|
+
public static void Init(string clientId, TapTapRegionType regionType, int screenOrientation)
|
|
19
|
+
{
|
|
20
|
+
TapTapRelationManager.Instance.Init(clientId, regionType, screenOrientation);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public static void SetOrientation(int orientation)
|
|
24
|
+
{
|
|
25
|
+
TapTapRelationManager.Instance.SetOrientation(orientation);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public static void StartMessenger()
|
|
29
|
+
{
|
|
30
|
+
TapTapRelationManager.Instance.StartMessenger();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public static void Prepare()
|
|
34
|
+
{
|
|
35
|
+
TapTapRelationManager.Instance.Prepare();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
public static void InviteGame()
|
|
39
|
+
{
|
|
40
|
+
TapTapRelationManager.Instance.InviteGame();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public static void InviteTeam(string teamId)
|
|
44
|
+
{
|
|
45
|
+
TapTapRelationManager.Instance.InviteTeam(teamId);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public static void ShowTapUserProfile(string openId, string unionId)
|
|
49
|
+
{
|
|
50
|
+
TapTapRelationManager.Instance.ShowTapUserProfile(openId, unionId);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public static void GetNewFansCount(Action<int> callback)
|
|
54
|
+
{
|
|
55
|
+
TapTapRelationManager.Instance.GetNewFansCount(callback);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
public static void GetUnreadMessageCount(Action<int> callback)
|
|
59
|
+
{
|
|
60
|
+
TapTapRelationManager.Instance.GetUnreadMessageCount(callback);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public static void RegisterRelationCallback(ITapTapRelationCallback callback)
|
|
64
|
+
{
|
|
65
|
+
TapTapRelationManager.Instance.RegisterRelationCallback(callback);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
public static void UnregisterRelationCallback(ITapTapRelationCallback callback)
|
|
69
|
+
{
|
|
70
|
+
TapTapRelationManager.Instance.UnregisterRelationCallback(callback);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
public static void Destroy()
|
|
74
|
+
{
|
|
75
|
+
TapTapRelationManager.Instance.Destroy();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
public static readonly string Version = "4.6.0-beta.1";
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "TapSDK.Relation.Runtime",
|
|
3
|
+
"references": [
|
|
4
|
+
"GUID:7d5ef2062f3704e1ab74aac0e4d5a1a7"
|
|
5
|
+
],
|
|
6
|
+
"includePlatforms": [],
|
|
7
|
+
"excludePlatforms": [],
|
|
8
|
+
"allowUnsafeCode": false,
|
|
9
|
+
"overrideReferences": false,
|
|
10
|
+
"precompiledReferences": [],
|
|
11
|
+
"autoReferenced": true,
|
|
12
|
+
"defineConstraints": [],
|
|
13
|
+
"versionDefines": [],
|
|
14
|
+
"noEngineReferences": false
|
|
15
|
+
}
|
package/Runtime.meta
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "com.taptap.sdk.relation",
|
|
3
|
+
"displayName": "TapTapSDK Relation",
|
|
4
|
+
"description": "TapTapSDK Relation",
|
|
5
|
+
"version": "4.6.0-beta.1",
|
|
6
|
+
"unity": "2019.4",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"com.taptap.sdk.core": "4.6.0-beta.1",
|
|
10
|
+
"com.taptap.sdk.login": "4.6.0-beta.1"
|
|
11
|
+
}
|
|
12
|
+
}
|