Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions Assets/Plugins/DeepLink.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//
//
// Copyright (c) 2016 eppz! mobile, Gergely Borbás (SP)
//
// http://www.twitter.com/_eppz
Expand All @@ -14,14 +14,15 @@
using UnityEngine;
using UnityEngine.UI;
using System.Runtime.InteropServices;

using UnityEngine.Events;

public class DeepLink : MonoBehaviour
{


public Text label;

public static string LastURL;
[System.Serializable]
public class StringEvent : UnityEvent<string> { }
public StringEvent urlOpenedEvent;

#if !UNITY_EDITOR && (UNITY_IOS || UNITY_STANDALONE_OSX)

Expand All @@ -35,11 +36,16 @@ public class DeepLink : MonoBehaviour
static extern string DeepLink_GetSourceApplication();


void Update()
void OnEnable()
{
if (DeepLink_GetURL() == "") return;
label.text = DeepLink_GetURL().Replace("override://", "");
LastURL = DeepLink_GetURL();

urlOpenedEvent.Invoke(url);

DeepLink_Reset();


}

#endif
Expand Down