public static void PerformActionForShortcutItem(UIApplication application, UIApplicationShortcutItem shortcutItem, UIOperationHandler completionHandler) { if (shortcutItem.Type == AppActions.Type) { var appAction = shortcutItem.ToAppAction(); AppActions.InvokeOnAppAction(application, shortcutItem.ToAppAction()); } }
static void CheckAppActions(AndroidIntent intent) { if (intent?.Action == Intent.ActionAppAction) { var appAction = intent.ToAppAction(); if (!string.IsNullOrEmpty(appAction?.Id)) { AppActions.InvokeOnAppAction(Platform.CurrentActivity, appAction); } } }
static void CheckAppActions(AndroidIntent intent) { if (intent?.Action == Intent.ActionAppAction && !intent.GetBooleanExtra(AppActions.extraAppActionHandled, false)) { // prevent launch intent getting handled on activity resume intent.PutExtra(AppActions.extraAppActionHandled, true); var appAction = intent.ToAppAction(); if (!string.IsNullOrEmpty(appAction?.Id)) { AppActions.InvokeOnAppAction(Platform.CurrentActivity, appAction); } } }
internal static async Task OnLaunched(LaunchActivatedEventArgs e) { if (e?.Arguments?.StartsWith(appActionPrefix) ?? false) { var id = ArgumentsToId(e.Arguments); if (!string.IsNullOrEmpty(id)) { var actions = await PlatformGetAsync(); var appAction = actions.FirstOrDefault(a => a.Id == id); if (appAction != null) { AppActions.InvokeOnAppAction(null, appAction); } } } }
public static async void OnLaunched(LaunchActivatedEventArgs e) => await AppActions.OnLaunched(e);