App Shortcuts akin to AppLinks

ChaseFlorellChaseFlorell CAInsider, University mod

Summary

Similar to how AppLinks works, I'd like to have AppShortcuts so that we can implement UIApplicationShortcutItem (iOS 9) or Dynamic Shortcuts via the ShortcutManager (API 25). Apologies in advance, I know there's something in UWP, but I'm not sure what it's called.

iOS Sample
Android Sample

API Changes

public interface IAppShortcutEntry {
    string Label { get; set; }
    Uri AppLink { get; set; }
    ImageSource Thumbnail { get; set; }
}

public class AppShortcutEntry : IAppShortcutEntry { /* implement interface*/ }

Application.Current.AppShortcuts.RegisterShortcut(IAppShortcutEntry entry);
Application.Current.AppShortcuts.DeregisterShortcut(IAppShortcutEntry entry);

implementation

var url = $"http://app.mycompany.com/special-link/{someObject.Id.ToString()}";
var entry = new AppShortcutEntry
{
    Label = session.Title,
    AppLinkUri = new Uri(url, UriKind.RelativeOrAbsolute),
    Thumbnail = ImageSource.FromFile("Icon.png")
};
Application.Current.AppShortcuts.RegisterShortcut(entry);

Intended Use Case

The use case is pretty obvious. I'd like to see Forms add support for some of the nice features found in the newer platform APIs. This is a step in that direction, and this feature would really bolster app that are using frameworks like Prism.

0
0 votes

Open · Last Updated

Posts

Sign In or Register to comment.