Deep linking and shortcuts in Genexus (android) - genexus

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?

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

Related

Navigating from xamarin multi-platform page to iOS or android page

I'm trying to follow this tutorial on creating a login page using Auth0: https://auth0.com/docs/quickstart/native/xamarin/01-login#handing-the-callback-url and noticed that the tutorial creates two separate login pages for android and iOS, as if they are two separate apps/projects/solutions. But my app is supposed to be compatible with both android and iOS, so I created a forms page under RoseySports.ios called Login_iOS (As indicated in screenshot 1) and would like to test it out to see if the login page works, but cannot seem to find a way to set the MainPage as Login_iOS (screenshot 2). I would like for it to be so that if a device is running iOS, it will redirect the user to the iOS version of the login page, and vice versa for android. Sorry if I'm not using the correct terminology when describing my issue. The reason I had to create two separate login pages for iOS and android was because i had to use using Auth0.OidcClient; as there are separate Nuget packages for the iOS solution and Android solution, which doesn't work when trying to put it on the main project (the one compatible for both iOS and Android).
And please let me know if there's a way to make just one login page for both platforms using Auth0.
UPDATE:
This is what I've done now, but I'm getting an error at MainPage = new RoseySports.Login_iOS(); saying that Login.iOS does not exist in the namespace RoseySports. This is the rest of the code:
`switch(Device.RuntimePlatform)
{
case Device.iOS:
MainPage = new RoseySports.Login_iOS();
break;
case Device.Android:
MainPage = new Login_Page();
break;
}`
You have multiple questions and in StackOverflow you should not ask them in one question, but let's try to address them:
Pages are only graphic elements and there is no need to implement separate graphic elements in iOS and Android in most cases, and yours doesn't look like a valid one for that
In general you can implement some code as platform specific. If you are using shared projects you can use conditional compiling, if not then dependency injection
You can use some of the technics above to do what you wanted to do (have different versions of pages per platform)

Xamarin-iOS: host application will not run with share extension

My app setup is a basic new app with default viewController with the default classes for share extension on iOS 11.2.
The host AppDelegate class FinishedLaunching never gets called.
Just shows the launch screen and closes the app.
The sample Xamarin app provided also has the same issue.
Link to the sample app:
Share Extension sample
Any idea whats going wrong?
Do you want to open the app which you created with the share extension, when user clicks the share button to use this share extension? If so, this app should be called Containing App.
But unfortunately, there's no way to do this on iOS8.3+ except Today Extension. From this post we know that:
The intended approach for share extensions is that they handle all of
the necessary work themselves.
Also from the Apple documentation about extension:
An extension’s UI should be simple, restrained, and focused on
facilitating a single task.
Apple doesn't recommend us to open its containing app from extensions, actually it avoids that. If you want to retrieve data in containing app, you can set up an app group so that data can be shared between these two apps.

Sharing Files with other Chrome Extensions using ARC

We have an Android application that we have developed and are testing with ARC. Part of the functionality is to share Word/PDF and other documents with other applications on an Android device and then have them pass the content back to us when done. However, since ARC applications run in their own sandbox instance of Android there are no other applications to share with using the standard intents. I know that Chrome Extensions can message each other, but is there a way to access this functionality from an Android APP running arc. Ideally we'd like to share a document have it open in say Google Drive, and then be able to get it back from there using the standard Android intents. Is this possible, or do we have to look at other ways to accomplish this (i.e. SDKs.)
Update: Here is the code we use to launch external activities to have them open files for editing:
Uri uri = Uri.fromFile(attachmentFile);
Intent intentUrl = new Intent(Intent.ACTION_VIEW);
intentUrl.setDataAndType(uri, applicationType);
intentUrl.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
getContext().startActivity(externalActivityIntent);
You can get the file from Google Drive or any other file provider available on the chromeOS using the new intent: ACTION_OPEN_DOCUMENT

Can we perform navigation between Windows Phone Silverlight 8.1 project page and a Windows Phone 8.1 project page under same solution?

I am working in Windows Phone application in which I have two projects one is Windows Phone Silverlight 8.1 and another is Windows Phone 8.1. I want to navigate from a xaml page in Windows Phone Silverlight 8.1 project to Windows Phone 8.1 Project on a button click and then return back to the page. Is there any possible way to do that?
Thanks,
Ekta
Regardless of their types, there is no way to directly navigate to a page in another app on Windows Phone. Your best option is to declare a URI association in the target app that the source app can launch with - see here for details.
As for returning to the source app, you should try to leverage the system back key if at all possible. However, if it's not going to be obvious to the user that she should hit the back key, you have two options:
Use Application.Current.Exit() to close the target app, which will
return the user to the last session in the back stack, which should
be the source app (unless the user task-switched in the interim).
Register a URI association in the source app and navigate back to
that from the target. Note that the process of registering and
handling invocation of URI association activation is different in WP
Silverlight apps - see here.
The difference between the two approaches is that if you Exit, the target app will be terminated and removed from the back stack whereas launching a URI association results in a new forward navigation and will leave the target app in the back stack.

Windows Phone - Call default web browser

I am trying to develop Windows Phone App, I would like to know that how can I call the default web browser with a specific URL(e.g. http://www.google.com) when I launch the program?
Thanks
When you're launching "the program" as you say (Internet Explorer) you use the following code:
WebBrowserTask browser = new WebBrowserTask();
browser.URL = new Uri("http://www.google.com", UriKind.Absolute);
browser.Show();
The WebBrowser task is inside the Microsoft.Phone.Tasks namespace, the documentaion of which is here: Microsoft.Phone.Tasks.WebBrowserTask
You should also know that the "default" browser is always Internet Explorer, because right now there is no way for users to define an alternative browser as their "default".
Edit:
After reading your question more closely, I can tell there is a little bit of ambiguity. If you want to launch the browser immediately when your app launches, you should know the following:
This kind of application will fail Microsoft's marketplace validation (check the Application Certification Requirements for Windows Phone
Even if it didn't fail the certification, it would be a kind of strange application... not one that is of very much use to your users.
If, however you intend to launch the phone's browser when the user clicks a button, then the above code I posted will work just like you want it to, just make sure to include this line at the top of the code file that it's in:
using Microsoft.Phone.Tasks;
Hope that helps!

Resources