com.taptap.sdk.moment 4.3.0-aplha.5
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 +18 -0
- package/Mobile/Editor/NativeDependencies.xml.meta +7 -0
- package/Mobile/Editor/TapMomentIOSProcessor.cs +49 -0
- package/Mobile/Editor/TapMomentIOSProcessor.cs.meta +3 -0
- package/Mobile/Editor/TapMomentMobileProcessBuild.cs +20 -0
- package/Mobile/Editor/TapMomentMobileProcessBuild.cs.meta +11 -0
- package/Mobile/Editor/TapTap.Moment.Mobile.Editor.asmdef +17 -0
- package/Mobile/Editor/TapTap.Moment.Mobile.Editor.asmdef.meta +7 -0
- package/Mobile/Editor.meta +3 -0
- package/Mobile/Runtime/TapSDK.Moment.Mobile.Runtime.asmdef +20 -0
- package/Mobile/Runtime/TapSDK.Moment.Mobile.Runtime.asmdef.meta +7 -0
- package/Mobile/Runtime/TapTapMomentImpl.cs +142 -0
- package/Mobile/Runtime/TapTapMomentImpl.cs.meta +11 -0
- package/Mobile/Runtime.meta +8 -0
- package/Mobile.meta +8 -0
- package/Plugins/iOS/Resource.meta +8 -0
- package/Plugins/iOS.meta +8 -0
- package/Plugins.meta +8 -0
- package/Runtime/Internal/ITapTapMomentPlatform.cs +26 -0
- package/Runtime/Internal/ITapTapMomentPlatform.cs.meta +11 -0
- package/Runtime/Internal/Init/MomentInitTask.cs +18 -0
- package/Runtime/Internal/Init/MomentInitTask.cs.meta +11 -0
- package/Runtime/Internal/Init.meta +8 -0
- package/Runtime/Internal/TapTapMomentManager.cs +69 -0
- package/Runtime/Internal/TapTapMomentManager.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/PublishMetaData.cs +23 -0
- package/Runtime/Public/PublishMetaData.cs.meta +11 -0
- package/Runtime/Public/TapTapMoment.cs +88 -0
- package/Runtime/Public/TapTapMoment.cs.meta +11 -0
- package/Runtime/Public.meta +8 -0
- package/Runtime/TapSDK.Moment.Runtime.asmdef +15 -0
- package/Runtime/TapSDK.Moment.Runtime.asmdef.meta +7 -0
- package/Runtime.meta +8 -0
- package/Standalone/Editor/TapMomentStandaloneProcessBuild.cs +20 -0
- package/Standalone/Editor/TapMomentStandaloneProcessBuild.cs.meta +11 -0
- package/Standalone/Editor/TapSDK.Moment.Standalone.Editor.asmdef +17 -0
- package/Standalone/Editor/TapSDK.Moment.Standalone.Editor.asmdef.meta +7 -0
- package/Standalone/Editor.meta +8 -0
- package/Standalone/Runtime/TapMomentStandalone.cs +72 -0
- package/Standalone/Runtime/TapMomentStandalone.cs.meta +11 -0
- package/Standalone/Runtime/TapSDK.Moment.Standalone.Runtime.asmdef +22 -0
- package/Standalone/Runtime/TapSDK.Moment.Standalone.Runtime.asmdef.meta +7 -0
- package/Standalone/Runtime.meta +8 -0
- package/Standalone.meta +8 -0
- package/link.xml +4 -0
- package/link.xml.meta +7 -0
- package/package.json +12 -0
- package/package.json.meta +7 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<dependencies>
|
|
2
|
+
|
|
3
|
+
<!-- Android maven dependencies -->
|
|
4
|
+
<androidPackages>
|
|
5
|
+
<repositories>
|
|
6
|
+
<repository>https://repo.maven.apache.org/maven2</repository>
|
|
7
|
+
</repositories>
|
|
8
|
+
<androidPackage spec="com.taptap.sdk:tap-moment-unity:4.3.0"/>
|
|
9
|
+
</androidPackages>
|
|
10
|
+
<!-- iOS Cocoapod dependencies can be specified by each iosPod element. -->
|
|
11
|
+
<iosPods>
|
|
12
|
+
<sources>
|
|
13
|
+
<source>https://github.com/CocoaPods/Specs.git</source>
|
|
14
|
+
</sources>
|
|
15
|
+
<iosPod name="TapTapMomentSDK" version="~> 4.3.0" bitcodeEnabled="false" addToAllTargets="false"/>
|
|
16
|
+
</iosPods>
|
|
17
|
+
</dependencies>
|
|
18
|
+
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
using TapSDK.Core.Editor;
|
|
2
|
+
using UnityEditor;
|
|
3
|
+
using UnityEditor.Callbacks;
|
|
4
|
+
using UnityEngine;
|
|
5
|
+
|
|
6
|
+
namespace TapTap.Moment.Editor
|
|
7
|
+
{
|
|
8
|
+
#if UNITY_IOS
|
|
9
|
+
public static class TapMomentIOSProcessor
|
|
10
|
+
{
|
|
11
|
+
[PostProcessBuild(101)]
|
|
12
|
+
public static void OnPostprocessBuild(BuildTarget buildTarget, string path)
|
|
13
|
+
{
|
|
14
|
+
if (buildTarget != BuildTarget.iOS) return;
|
|
15
|
+
|
|
16
|
+
var projPath = TapSDKCoreCompile.GetProjPath(path);
|
|
17
|
+
var proj = TapSDKCoreCompile.ParseProjPath(projPath);
|
|
18
|
+
var target = TapSDKCoreCompile.GetUnityTarget(proj);
|
|
19
|
+
var unityFrameworkTarget = TapSDKCoreCompile.GetUnityFrameworkTarget(proj);
|
|
20
|
+
if (TapSDKCoreCompile.CheckTarget(target))
|
|
21
|
+
{
|
|
22
|
+
Debug.LogError("Unity-iPhone is NUll");
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
proj.AddFrameworkToProject(unityFrameworkTarget, "AVFoundation.framework", false);
|
|
27
|
+
proj.AddFrameworkToProject(unityFrameworkTarget, "CoreTelephony.framework", false);
|
|
28
|
+
proj.AddFrameworkToProject(unityFrameworkTarget, "MobileCoreServices.framework", false);
|
|
29
|
+
proj.AddFrameworkToProject(unityFrameworkTarget, "Photos.framework", false);
|
|
30
|
+
proj.AddFrameworkToProject(unityFrameworkTarget, "SystemConfiguration.framework", false);
|
|
31
|
+
proj.AddFrameworkToProject(unityFrameworkTarget, "WebKit.framework", false);
|
|
32
|
+
|
|
33
|
+
if (TapSDKCoreCompile.HandlerIOSSetting(path,
|
|
34
|
+
Application.dataPath,
|
|
35
|
+
"TapTapMomentResource",
|
|
36
|
+
"com.taptap.sdk.moment",
|
|
37
|
+
"Moment",
|
|
38
|
+
new[] {"TapTapMomentResource.bundle"},
|
|
39
|
+
target, projPath, proj, "TapTapMomentSDK"))
|
|
40
|
+
{
|
|
41
|
+
Debug.Log("TapMoment add Bundle Success!");
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
Debug.LogError("TapMoment add Bundle Failed!");
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
#endif
|
|
49
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using UnityEditor.Build.Reporting;
|
|
3
|
+
using TapSDK.Core.Editor;
|
|
4
|
+
|
|
5
|
+
namespace TapTap.Moment.Mobile.Editor {
|
|
6
|
+
public class TapMomentMobileProcessBuild : SDKLinkProcessBuild {
|
|
7
|
+
public override int callbackOrder => 0;
|
|
8
|
+
|
|
9
|
+
public override string LinkPath => "TapTap/Moment/link.xml";
|
|
10
|
+
|
|
11
|
+
public override LinkedAssembly[] LinkedAssemblies => new LinkedAssembly[] {
|
|
12
|
+
new LinkedAssembly { Fullname = "TapTap.Moment.Runtime" },
|
|
13
|
+
new LinkedAssembly { Fullname = "TapTap.Moment.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.Moment.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,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "TapSDK.Moment.Mobile.Runtime",
|
|
3
|
+
"references": [
|
|
4
|
+
"GUID:5f5654759b7534ddebacbe2e8ef8a8da",
|
|
5
|
+
"GUID:7d5ef2062f3704e1ab74aac0e4d5a1a7",
|
|
6
|
+
"GUID:10560023d8780423cb943c7a324b69f2"
|
|
7
|
+
],
|
|
8
|
+
"includePlatforms": [
|
|
9
|
+
"Android",
|
|
10
|
+
"iOS"
|
|
11
|
+
],
|
|
12
|
+
"excludePlatforms": [],
|
|
13
|
+
"allowUnsafeCode": false,
|
|
14
|
+
"overrideReferences": false,
|
|
15
|
+
"precompiledReferences": [],
|
|
16
|
+
"autoReferenced": true,
|
|
17
|
+
"defineConstraints": [],
|
|
18
|
+
"versionDefines": [],
|
|
19
|
+
"noEngineReferences": false
|
|
20
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Threading.Tasks;
|
|
3
|
+
using TapSDK.Core;
|
|
4
|
+
using TapSDK.Moment.Internal;
|
|
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.Moment.Mobile
|
|
14
|
+
{
|
|
15
|
+
public class TapTapMomentImpl : ITapTapMomentPlatform
|
|
16
|
+
{
|
|
17
|
+
private const string SERVICE_NAME = "BridgeMomentService";
|
|
18
|
+
|
|
19
|
+
public void Init(string clientId, TapTapRegionType regionType)
|
|
20
|
+
{
|
|
21
|
+
EngineBridge.GetInstance().Register(
|
|
22
|
+
"com.taptap.sdk.moment.unity.BridgeMomentService",
|
|
23
|
+
"com.taptap.sdk.moment.unity.BridgeMomentServiceImpl");
|
|
24
|
+
#if UNITY_IOS
|
|
25
|
+
if (Platform.IsIOS())
|
|
26
|
+
{
|
|
27
|
+
if (Device.deferSystemGesturesMode != SystemGestureDeferMode.None)
|
|
28
|
+
{
|
|
29
|
+
NeedDeferSystemGestures();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
#endif
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
public void Close()
|
|
36
|
+
{
|
|
37
|
+
EngineBridge.GetInstance().CallHandler(new Command.Builder()
|
|
38
|
+
.Service(SERVICE_NAME)
|
|
39
|
+
.Method("close")
|
|
40
|
+
.Callback(false)
|
|
41
|
+
.OnceTime(true)
|
|
42
|
+
.CommandBuilder());
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
public void CloseWithConfirmWindow(string title, string content)
|
|
46
|
+
{
|
|
47
|
+
EngineBridge.GetInstance().CallHandler(new Command.Builder()
|
|
48
|
+
.Service(SERVICE_NAME)
|
|
49
|
+
.Method("closeWithConfirmWindow")
|
|
50
|
+
.Args("title", title)
|
|
51
|
+
.Args("content", content)
|
|
52
|
+
.Callback(false)
|
|
53
|
+
.OnceTime(true)
|
|
54
|
+
.CommandBuilder());
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public void OpenMoment()
|
|
58
|
+
{
|
|
59
|
+
EngineBridge.GetInstance().CallHandler(new Command.Builder()
|
|
60
|
+
.Service(SERVICE_NAME)
|
|
61
|
+
.Method("openMoment")
|
|
62
|
+
.Callback(false)
|
|
63
|
+
.OnceTime(true)
|
|
64
|
+
.CommandBuilder());
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
public void OpenScene(string sceneId)
|
|
68
|
+
{
|
|
69
|
+
EngineBridge.GetInstance().CallHandler(new Command.Builder()
|
|
70
|
+
.Service(SERVICE_NAME)
|
|
71
|
+
.Method("openScene")
|
|
72
|
+
.Args("sceneId", sceneId)
|
|
73
|
+
.Callback(false)
|
|
74
|
+
.OnceTime(true)
|
|
75
|
+
.CommandBuilder());
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
public void Publish(PublishMetaData publishMetaData)
|
|
79
|
+
{
|
|
80
|
+
string json = JsonConvert.SerializeObject(publishMetaData);
|
|
81
|
+
Debug.Log("TapSdk4UnityDemo -->> PublishMetaData json = " + json);
|
|
82
|
+
EngineBridge.GetInstance().CallHandler(new Command.Builder()
|
|
83
|
+
.Service(SERVICE_NAME)
|
|
84
|
+
.Method("publish")
|
|
85
|
+
.Args("publishMetaData", json)
|
|
86
|
+
.Callback(false)
|
|
87
|
+
.OnceTime(true)
|
|
88
|
+
.CommandBuilder());
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
public void FetchNotification()
|
|
92
|
+
{
|
|
93
|
+
EngineBridge.GetInstance().CallHandler(new Command.Builder()
|
|
94
|
+
.Service(SERVICE_NAME)
|
|
95
|
+
.Method("fetchNotification")
|
|
96
|
+
.Callback(false)
|
|
97
|
+
.OnceTime(true)
|
|
98
|
+
.CommandBuilder());
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
public void SetCallback(Action<int, string> callback)
|
|
102
|
+
{
|
|
103
|
+
|
|
104
|
+
var command = new Command.Builder();
|
|
105
|
+
command.Service(SERVICE_NAME);
|
|
106
|
+
command.Method("setCallback")
|
|
107
|
+
.Callback(true)
|
|
108
|
+
.OnceTime(false);
|
|
109
|
+
EngineBridge.GetInstance().CallHandler(command.CommandBuilder(), (result) =>
|
|
110
|
+
{
|
|
111
|
+
if (result.code != Result.RESULT_SUCCESS)
|
|
112
|
+
{
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (string.IsNullOrEmpty(result.content))
|
|
117
|
+
{
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
var dic = Json.Deserialize(result.content) as Dictionary<string, object>;
|
|
121
|
+
var code = SafeDictionary.GetValue<int>(dic, "code");
|
|
122
|
+
var msg = SafeDictionary.GetValue<string>(dic, "msg");
|
|
123
|
+
//
|
|
124
|
+
Debug.Log("TapSdk4UnityDemo -->> Callback code = " + code + " , msg = " + msg);
|
|
125
|
+
callback(code, msg);
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
public void NeedDeferSystemGestures()
|
|
130
|
+
{
|
|
131
|
+
if (Platform.IsIOS())
|
|
132
|
+
{
|
|
133
|
+
EngineBridge.GetInstance().CallHandler(new Command.Builder()
|
|
134
|
+
.Service(SERVICE_NAME)
|
|
135
|
+
.Method("needDeferSystemGestures")
|
|
136
|
+
.Callback(false)
|
|
137
|
+
.OnceTime(true)
|
|
138
|
+
.CommandBuilder());
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
package/Mobile.meta
ADDED
package/Plugins/iOS.meta
ADDED
package/Plugins.meta
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
using System.Threading.Tasks;
|
|
2
|
+
using TapSDK.Core;
|
|
3
|
+
using System;
|
|
4
|
+
using System.Collections.Generic;
|
|
5
|
+
|
|
6
|
+
namespace TapSDK.Moment.Internal
|
|
7
|
+
{
|
|
8
|
+
public interface ITapTapMomentPlatform
|
|
9
|
+
{
|
|
10
|
+
void Init(string clientId, TapTapRegionType regionType);
|
|
11
|
+
|
|
12
|
+
void Close();
|
|
13
|
+
|
|
14
|
+
void CloseWithConfirmWindow(String title, String content);
|
|
15
|
+
|
|
16
|
+
void OpenMoment();
|
|
17
|
+
|
|
18
|
+
void OpenScene(string sceneId);
|
|
19
|
+
|
|
20
|
+
void Publish(PublishMetaData publishMetaData);
|
|
21
|
+
|
|
22
|
+
void SetCallback(Action<int, string> callback);
|
|
23
|
+
|
|
24
|
+
void FetchNotification();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
using TapSDK.Core;
|
|
2
|
+
using TapSDK.Core.Internal.Init;
|
|
3
|
+
|
|
4
|
+
namespace TapSDK.Moment.Internal.Init {
|
|
5
|
+
public class MomentInitTask : IInitTask {
|
|
6
|
+
public int Order => 103;
|
|
7
|
+
|
|
8
|
+
public void Init(TapTapSDKCoreOptions coreOption, TapTapSDKBaseOption[] otherOptions)
|
|
9
|
+
{
|
|
10
|
+
TapTapMomentManager.Instance.Init(coreOption.clientId, coreOption.region);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
public void Init(TapTapSDKCoreOptions coreOption)
|
|
14
|
+
{
|
|
15
|
+
TapTapMomentManager.Instance.Init(coreOption.clientId, coreOption.region);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Threading.Tasks;
|
|
3
|
+
using TapSDK.Core;
|
|
4
|
+
using TapSDK.Core.Internal.Utils;
|
|
5
|
+
|
|
6
|
+
namespace TapSDK.Moment.Internal
|
|
7
|
+
{
|
|
8
|
+
public class TapTapMomentManager
|
|
9
|
+
{
|
|
10
|
+
private static TapTapMomentManager instance;
|
|
11
|
+
private ITapTapMomentPlatform platformWrapper;
|
|
12
|
+
|
|
13
|
+
private TapTapMomentManager()
|
|
14
|
+
{
|
|
15
|
+
platformWrapper = BridgeUtils.CreateBridgeImplementation(typeof(ITapTapMomentPlatform),
|
|
16
|
+
"TapSDK.Moment") as ITapTapMomentPlatform;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public static TapTapMomentManager Instance
|
|
20
|
+
{
|
|
21
|
+
get
|
|
22
|
+
{
|
|
23
|
+
if (instance == null)
|
|
24
|
+
{
|
|
25
|
+
instance = new TapTapMomentManager();
|
|
26
|
+
}
|
|
27
|
+
return instance;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
public void Init(string clientId, TapTapRegionType regionType) => platformWrapper.Init(clientId, regionType);
|
|
32
|
+
|
|
33
|
+
public void OpenMoment()
|
|
34
|
+
{
|
|
35
|
+
platformWrapper.OpenMoment();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
public void OpenScene(string sceneId)
|
|
39
|
+
{
|
|
40
|
+
platformWrapper.OpenScene(sceneId);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public void Publish(PublishMetaData publishMetaData)
|
|
44
|
+
{
|
|
45
|
+
platformWrapper.Publish(publishMetaData);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public void Close()
|
|
49
|
+
{
|
|
50
|
+
platformWrapper.Close();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public void CloseWithConfirmWindow(String title, String content)
|
|
54
|
+
{
|
|
55
|
+
platformWrapper.CloseWithConfirmWindow(title, content);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
public void SetCallback(Action<int, string> callback)
|
|
59
|
+
{
|
|
60
|
+
platformWrapper.SetCallback(callback);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public void FetchNotification()
|
|
64
|
+
{
|
|
65
|
+
platformWrapper.FetchNotification();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
using System.Collections.Generic;
|
|
2
|
+
using Newtonsoft.Json;
|
|
3
|
+
|
|
4
|
+
namespace TapSDK.Moment
|
|
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,23 @@
|
|
|
1
|
+
using System.Collections.Generic;
|
|
2
|
+
using Newtonsoft.Json;
|
|
3
|
+
namespace TapSDK.Moment
|
|
4
|
+
{
|
|
5
|
+
public class PublishMetaData
|
|
6
|
+
{
|
|
7
|
+
// 内容
|
|
8
|
+
[JsonProperty("content")]
|
|
9
|
+
public string Content { get; set; }
|
|
10
|
+
// 图片路径列表
|
|
11
|
+
[JsonProperty("imagePaths")]
|
|
12
|
+
public List<string> ImagePaths { get; set; }
|
|
13
|
+
|
|
14
|
+
// 构造函数
|
|
15
|
+
public PublishMetaData(
|
|
16
|
+
string content = "",
|
|
17
|
+
List<string> imagePaths = null)
|
|
18
|
+
{
|
|
19
|
+
Content = content;
|
|
20
|
+
ImagePaths = imagePaths ?? new List<string>();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Collections.Generic;
|
|
3
|
+
using TapSDK.Moment.Internal;
|
|
4
|
+
using TapSDK.Core.Internal.Utils;
|
|
5
|
+
|
|
6
|
+
namespace TapSDK.Moment
|
|
7
|
+
{
|
|
8
|
+
public class TapTapMomentConstants
|
|
9
|
+
{
|
|
10
|
+
public static readonly string TapMomentPageShortCut = "tap://moment/scene/";
|
|
11
|
+
|
|
12
|
+
public static readonly string TapMomentPageShortCutKey = "scene_id";
|
|
13
|
+
//
|
|
14
|
+
public static readonly int CALLBACK_CODE_ON_STOP = 500;
|
|
15
|
+
//
|
|
16
|
+
public static readonly int CALLBACK_CODE_ON_RESUME = 600;
|
|
17
|
+
// 动态发布成功
|
|
18
|
+
public static readonly int CALLBACK_CODE_PUBLISH_SUCCESS = 10000;
|
|
19
|
+
// 动态发布失败
|
|
20
|
+
public static readonly int CALLBACK_CODE_PUBLISH_FAIL = 10100;
|
|
21
|
+
// 关闭动态发布页面
|
|
22
|
+
public static readonly int CALLBACK_CODE_PUBLISH_CANCEL = 10200;
|
|
23
|
+
// 获取新消息成功
|
|
24
|
+
public static readonly int CALLBACK_CODE_GET_NOTICE_SUCCESS = 20000;
|
|
25
|
+
// 获取新消息失败
|
|
26
|
+
public static readonly int CALLBACK_CODE_GET_NOTICE_FAIL = 20100;
|
|
27
|
+
// 动态页面打开
|
|
28
|
+
public static readonly int CALLBACK_CODE_MOMENT_APPEAR = 30000;
|
|
29
|
+
// 动态页面关闭
|
|
30
|
+
public static readonly int CALLBACK_CODE_MOMENT_DISAPPEAR = 30100;
|
|
31
|
+
//
|
|
32
|
+
public static readonly int CALLBACK_CODE_INIT_SUCCESS = 40000;
|
|
33
|
+
//
|
|
34
|
+
public static readonly int CALLBACK_CODE_INIT_FAIL = 40100;
|
|
35
|
+
// 取消关闭所有动态界面(弹框点击取消按钮)
|
|
36
|
+
public static readonly int CALLBACK_CODE_ClOSE_CANCEL = 50000;
|
|
37
|
+
// 确认关闭所有动态界面(弹框点击确认按钮)
|
|
38
|
+
public static readonly int CALLBACK_CODE_ClOSE_CONFIRM = 50100;
|
|
39
|
+
// 动态页面内登录成功
|
|
40
|
+
public static readonly int CALLBACK_CODE_LOGIN_SUCCESS = 60000;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public class TapTapMoment
|
|
44
|
+
{
|
|
45
|
+
|
|
46
|
+
// 显示动态页面
|
|
47
|
+
public static void OpenMoment()
|
|
48
|
+
{
|
|
49
|
+
TapTapMomentManager.Instance.OpenMoment();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// 显示动态页面
|
|
53
|
+
public static void OpenScene(string sceneId)
|
|
54
|
+
{
|
|
55
|
+
TapTapMomentManager.Instance.OpenScene(sceneId);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// 发布
|
|
59
|
+
public static void Publish(PublishMetaData publishMetaData)
|
|
60
|
+
{
|
|
61
|
+
TapTapMomentManager.Instance.Publish(publishMetaData);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// 直接关闭动态窗口,不弹出二次确认框
|
|
65
|
+
public static void Close()
|
|
66
|
+
{
|
|
67
|
+
TapTapMomentManager.Instance.Close();
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// 玩家可以在动态页面退出。 但在特定场景下,游戏可能需要主动关闭动态页面
|
|
71
|
+
// 比如,玩家排位等待结束,准备进入对局时提示玩家关闭动态页面,玩家确认后关闭
|
|
72
|
+
public static void CloseWithConfirmWindow(string title, string desc)
|
|
73
|
+
{
|
|
74
|
+
TapTapMomentManager.Instance.CloseWithConfirmWindow(title, desc);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// 定时调用获取消息通知的接口,有新信息时可以在 TapTap 动态入口显示小红点,提醒玩家查看新动态。
|
|
78
|
+
public static void FetchNotification()
|
|
79
|
+
{
|
|
80
|
+
TapTapMomentManager.Instance.FetchNotification();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
public static void SetCallback(Action<int, string> callback)
|
|
84
|
+
{
|
|
85
|
+
TapTapMomentManager.Instance.SetCallback(callback);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "TapSDK.Moment.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
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using UnityEditor.Build.Reporting;
|
|
3
|
+
using TapSDK.Core.Editor;
|
|
4
|
+
|
|
5
|
+
namespace TapSDK.Moment.Standalone.Editor {
|
|
6
|
+
public class TapMomentStandaloneProcessBuild : SDKLinkProcessBuild {
|
|
7
|
+
public override int callbackOrder => 0;
|
|
8
|
+
|
|
9
|
+
public override string LinkPath => "TapTap/Moment/link.xml";
|
|
10
|
+
|
|
11
|
+
public override LinkedAssembly[] LinkedAssemblies => new LinkedAssembly[] {
|
|
12
|
+
new LinkedAssembly { Fullname = "TapTap.Moment.Runtime" },
|
|
13
|
+
new LinkedAssembly { Fullname = "TapTap.Moment.Standalone.Runtime" }
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
public override Func<BuildReport, bool> IsTargetPlatform => (report) => {
|
|
17
|
+
return BuildTargetUtils.IsSupportStandalone(report.summary.platform);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "TapSDK.Moment.Standalone.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,72 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Collections.Generic;
|
|
3
|
+
using UnityEngine;
|
|
4
|
+
using TapSDK.Core;
|
|
5
|
+
using TapSDK.Moment.Internal;
|
|
6
|
+
using TapSDK.Moment;
|
|
7
|
+
|
|
8
|
+
namespace TapSDK.Moment.Standalone
|
|
9
|
+
{
|
|
10
|
+
public class TapMomentStandalone : ITapTapMomentPlatform
|
|
11
|
+
{
|
|
12
|
+
|
|
13
|
+
public void OpenMoment()
|
|
14
|
+
{
|
|
15
|
+
// // 打开论坛 web
|
|
16
|
+
// string url;
|
|
17
|
+
// TapTapSDKCoreOptions config = TapTapSDK.tapTapSDKCoreOptions;
|
|
18
|
+
// if (config == null || config.region == TapTapRegionType.CN)
|
|
19
|
+
// {
|
|
20
|
+
// url = $"https://www.taptap.cn/app/{TapMomentConfig.AppId}/topic?utm_medium=link&utm_source=pc_sdk";
|
|
21
|
+
// }
|
|
22
|
+
// else
|
|
23
|
+
// {
|
|
24
|
+
// url = $"https://www.taptap.io/app/{TapMomentConfig.AppId}?utm_medium=link&utm_source=pc_sdk";
|
|
25
|
+
// }
|
|
26
|
+
// Application.OpenURL(url);
|
|
27
|
+
|
|
28
|
+
TapLogger.Warn($"{nameof(OpenMoment)} NOT implemented.");
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
public void OpenScene(string sceneId)
|
|
32
|
+
{
|
|
33
|
+
TapLogger.Warn($"{nameof(OpenScene)} NOT implemented.");
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
public void Init(string clientId, TapTapRegionType regionType)
|
|
37
|
+
{
|
|
38
|
+
TapLogger.Warn($"{nameof(Init)} NOT implemented.");
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public void Close()
|
|
42
|
+
{
|
|
43
|
+
TapLogger.Warn($"{nameof(Close)} NOT implemented.");
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public void CloseWithConfirmWindow(string title, string content)
|
|
47
|
+
{
|
|
48
|
+
TapLogger.Warn($"{nameof(CloseWithConfirmWindow)} NOT implemented.");
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
public void FetchNotification()
|
|
52
|
+
{
|
|
53
|
+
TapLogger.Warn($"{nameof(FetchNotification)} NOT implemented.");
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
public void Publish(PublishMetaData publishMetaData)
|
|
58
|
+
{
|
|
59
|
+
TapLogger.Warn($"{nameof(Publish)} NOT implemented.");
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
public void SetCallback(Action<int, string> callback)
|
|
63
|
+
{
|
|
64
|
+
TapLogger.Warn($"{nameof(SetCallback)} NOT implemented.");
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
public void SetGameScreenAutoRotate(bool isAutoRotate)
|
|
68
|
+
{
|
|
69
|
+
TapLogger.Warn($"{nameof(SetGameScreenAutoRotate)} NOT implemented.");
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "TapSDK.Moment.Standalone.Runtime",
|
|
3
|
+
"references": [
|
|
4
|
+
"GUID:5f5654759b7534ddebacbe2e8ef8a8da",
|
|
5
|
+
"GUID:7d5ef2062f3704e1ab74aac0e4d5a1a7"
|
|
6
|
+
],
|
|
7
|
+
"includePlatforms": [
|
|
8
|
+
"Editor",
|
|
9
|
+
"LinuxStandalone64",
|
|
10
|
+
"macOSStandalone",
|
|
11
|
+
"WindowsStandalone32",
|
|
12
|
+
"WindowsStandalone64"
|
|
13
|
+
],
|
|
14
|
+
"excludePlatforms": [],
|
|
15
|
+
"allowUnsafeCode": false,
|
|
16
|
+
"overrideReferences": false,
|
|
17
|
+
"precompiledReferences": [],
|
|
18
|
+
"autoReferenced": true,
|
|
19
|
+
"defineConstraints": [],
|
|
20
|
+
"versionDefines": [],
|
|
21
|
+
"noEngineReferences": false
|
|
22
|
+
}
|
package/Standalone.meta
ADDED
package/link.xml
ADDED
package/link.xml.meta
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "com.taptap.sdk.moment",
|
|
3
|
+
"displayName": "TapTap Moment",
|
|
4
|
+
"description": "TapTap Develop Service",
|
|
5
|
+
"version": "4.3.0-aplha.5",
|
|
6
|
+
"unity": "2019.4",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"com.taptap.sdk.core": "4.3.0-aplha.5",
|
|
10
|
+
"com.taptap.sdk.login": "4.3.0-aplha.5"
|
|
11
|
+
}
|
|
12
|
+
}
|