Deep linking and shortcuts in Genexus (android)

91 Views Asked by At

I have a question about deep linking in genexus.

I have a site that calls a url. This url should be handled by an app installed on your phone. The procedure works correctly using the deep link.

The problem arises if the starting site is opened from a shortcut placed on the desktop. In this case the deep link of the app no ​​longer works.

I think the problem is related to this

Deep link in android app

and that the shortcut counts as an android app thus preventing me from calling another app. But in the past this link worked as long as the app was told beforehand to always handle the link.

Is there anything I can do in Genexus to use the deep link even starting from a desktop shortcut?

1

There are 1 best solutions below

0
On

The DeepLink external object helps you manually manage deep linking on your applications. This external object must be used only in the Smart Devices Main object.

Suppose that our website handles URIs such https://www.mystore.com/viewproduct?1

Event DeepLink.Handle( &URL, &IsHandled )
    Composite
      if &URL.ToLower().StartsWith("https://www.mystore.com/")
      and &URL.Contains("viewproduct") 
         &Index = &URL.indexof( "?" )+1
         &Query = &URL.Substring( &Index)
         &ProductId = &Query.Trim().ToNumeric()
         &IsHandled = True 
         SDViewProduct(&ProductId)
      endIf
    EndComposite
EndEvent

For more details: DeepLink external object