#Getting the deep link the app was opened with
1 messages · Page 1 of 1 (latest)
Did you try registering for events? https://voxelbusters.github.io/cross-platform-essential-kit/api/VoxelBusters.EssentialKit.DeepLinkServices.html?q=deeplinkservices#events
We have events for both - scheme and universal link actions.
Yes, we subscribe to both
But if the app was fully closed, the event doesn't trigger, does it?
It should. We cache the event and fire once registered. What platform are you on?
When does the event get fired? When something subscribes for the first time?
We schdeuled a test tomorrow to look into.
Ideally, the event should get fired when the app opens from the link once it's clicked.
I see you are expecting it right. Just need to double check in my test why it's failing to fire the event.
@frozen goblet Any update on this?
Hi! Let me jump into it right now.
Are you using scheme or app link/universal link?
@slate pond I can reproduce the issue on my end. Let me find out the cause and get you a fix.
Thanks!
It was on universal
Where are you registering the event?
public abstract class DeeplinkHandler : SerializedMonoBehaviour
{
[SerializeField]
[InfoBox("Should always start with /")]
private string _path = "/path";
private void OnEnable()
{
DeepLinkServices.OnCustomSchemeUrlOpen += TryExecute;
DeepLinkServices.OnUniversalLinkOpen += TryExecute;
}
private void OnDisable()
{
DeepLinkServices.OnCustomSchemeUrlOpen -= TryExecute;
DeepLinkServices.OnUniversalLinkOpen -= TryExecute;
}
private void TryExecute(DeepLinkServicesDynamicLinkOpenResult result)
{
Debug.Log("Executing deep link: " + result.Url.AbsolutePath);
if (_path != result.Url.AbsolutePath) return;
Debug.Log("Handle deep link : " + result.Url);
string query = result.Url.Query;
NameValueCollection parsedQuery = HttpUtility.ParseQueryString(query);
ExecuteAction(parsedQuery);
}
protected abstract void ExecuteAction(NameValueCollection query);
}
OnEnable / OnDisable
Can you please update this file?
I noticed we missed adding the caching of event if the events are not registeted yet. Now it should work fine!
I'll have a look in a moment, thanks!
@frozen goblet We're getting some errors, but let me check what version we're on
We're still on 2.6.1. Let me update
That fixes it, thank you @frozen goblet!
Hey @slate pond
If you don't mind, can you please share how you are using deep links feature in your product?
@frozen goblet We have a walking app where we let towns make walks for people to walk around. We have a back-end platform where they can make the walks. They can use a deep link with a QR code to test the walk before putting it live on the app