forked from dfinity/examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update readme files, simply the app link workflow which can be used b…
…y iOS integration in the future.
- Loading branch information
1 parent
6b828bc
commit bf23f9f
Showing
15 changed files
with
77 additions
and
251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
native-apps/unity_ii_applink/unity_project/Assets/Android.meta
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
native-apps/unity_ii_applink/unity_project/Assets/Android/Plugins.meta
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
native-apps/unity_ii_applink/unity_project/Assets/Android/Plugins/com.meta
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
native-apps/unity_ii_applink/unity_project/Assets/Android/Plugins/com/icgamekit.meta
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
native-apps/unity_ii_applink/unity_project/Assets/Android/Plugins/com/icgamekit/plugin.meta
This file was deleted.
Oops, something went wrong.
77 changes: 0 additions & 77 deletions
77
...ii_applink/unity_project/Assets/Android/Plugins/com/icgamekit/plugin/ICGameKitPlugin.java
This file was deleted.
Oops, something went wrong.
32 changes: 0 additions & 32 deletions
32
...plink/unity_project/Assets/Android/Plugins/com/icgamekit/plugin/ICGameKitPlugin.java.meta
This file was deleted.
Oops, something went wrong.
47 changes: 47 additions & 0 deletions
47
native-apps/unity_ii_applink/unity_project/Assets/Scripts/DeepLinkPlugin.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using UnityEngine; | ||
using EdjCase.ICP.Candid.Utilities; | ||
using Newtonsoft.Json; | ||
using System.Web; | ||
|
||
namespace IC.GameKit | ||
{ | ||
public class DeepLinkPlugin : MonoBehaviour | ||
{ | ||
TestICPAgent mTestICPAgent = null; | ||
|
||
private void Awake() | ||
{ | ||
// Register action for deep link activated. | ||
Application.deepLinkActivated += OnDeepLinkActivated; | ||
} | ||
|
||
public void Start() | ||
{ | ||
mTestICPAgent = gameObject.GetComponent<TestICPAgent>(); | ||
} | ||
|
||
public void OpenBrowser() | ||
{ | ||
var target = mTestICPAgent.greetFrontend + "?sessionkey=" + ByteUtil.ToHexString(mTestICPAgent.TestIdentity.PublicKey.Value); | ||
Application.OpenURL(target); | ||
} | ||
|
||
public void OnDeepLinkActivated(string url) | ||
{ | ||
if (string.IsNullOrEmpty(url)) | ||
return; | ||
|
||
const string kDelegationParam = "delegation="; | ||
var indexOfDelegation = url.IndexOf(kDelegationParam); | ||
if (indexOfDelegation == -1) | ||
{ | ||
Debug.LogError("Cannot find delegation"); | ||
return; | ||
} | ||
|
||
var delegationString = HttpUtility.UrlDecode(url.Substring(indexOfDelegation + kDelegationParam.Length)); | ||
var delegation = JsonConvert.DeserializeObject<DelegationChainModel>(delegationString); | ||
mTestICPAgent.Delegation = delegation; | ||
} | ||
} | ||
} |
File renamed without changes.
53 changes: 0 additions & 53 deletions
53
native-apps/unity_ii_applink/unity_project/Assets/Scripts/PluginProxy.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.