-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
MirageXRServiceBootstrapper.cs
73 lines (60 loc) · 2.51 KB
/
MirageXRServiceBootstrapper.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
using i5.Toolkit.Core.DeepLinkAPI;
using i5.Toolkit.Core.ExperienceAPI;
using i5.Toolkit.Core.OpenIDConnectClient;
using i5.Toolkit.Core.ServiceCore;
using UnityEngine;
namespace MirageXR
{
public class MirageXRServiceBootstrapper : BaseServiceBootstrapper
{
[SerializeField]
private VestServiceConfiguration vestServiceConfiguration;
[SerializeField]
private ExperienceAPIClientCredentials xAPICredentials;
public DeepLinkDefinition deepLinkAPI;
protected override void RegisterServices()
{
ServiceManager.RegisterService(new WorldAnchorService());
ServiceManager.RegisterService(new KeywordService());
ServiceManager.RegisterService(new VestService()
{
VestEnabled = vestServiceConfiguration.vestEnabled
});
if (xAPICredentials != null)
{
ExperienceAPIClient xAPIClient = new ExperienceAPIClient()
{
XApiEndpoint = new System.Uri("https://lrs.tech4comp.dbis.rwth-aachen.de/data/xAPI"),
AuthorizationToken = xAPICredentials.authToken,
Version = "1.0.3"
};
ServiceManager.RegisterService(new ExperienceService(xAPIClient));
}
else
{
Debug.LogWarning("xAPI credentials not set. You will not be able to use the ExperienceService and xAPI analytics");
}
ServiceManager.RegisterService(new VideoAudioTrackGlobalService());
ServiceManager.RegisterService(new EditorSceneService());
OpenIDConnectService oidc = new OpenIDConnectService
{
OidcProvider = new SketchfabOidcProvider()
};
#if !UNITY_EDITOR
oidc.RedirectURI = "https://wekit-community.org/sketchfab/callback.php";
#else
// here could be the link to a nicer web page that tells the user to return to the app
#endif
ServiceManager.RegisterService(oidc);
DeepLinkingService deepLinks = new DeepLinkingService();
ServiceManager.RegisterService(deepLinks);
deepLinkAPI = new DeepLinkDefinition();
deepLinks.AddDeepLinkListener(deepLinkAPI);
}
protected override void UnRegisterServices()
{
ServiceManager.GetService<DeepLinkingService>().RemoveDeepLinkListener(deepLinkAPI);
ServiceManager.RemoveService<DeepLinkingService>();
}
}
}