Startup/ Launch Arguments

I'm interested in starting my application by way of each platform's voice assistant but am not really finding anything. Usually it means I'm looking for something so straightforward that there's little published about it.

Would like to receive the command argument and take the appropriate action.

Starting with Windows, I see that there is or should be, maybe an override for OnActivated but when trying to implement there's nothing defined to override.

Ok to ask if I could get pointed the right direction?

Answers

  • GeraldVersluisGeraldVersluis NLUniversity ✭✭✭✭
    edited January 2016

    I don't think it is available in the form that you are used to in desktop development. A user does not have the freedom the freedom to specify how an app gets started, let alone which parameters should be given.

    There are, however, some options. One of them, which is available on all platforms if I'm not mistaken, is custom url schemes.
    This does require platform specific code. Check here for Windows Phone, iOS and Android.

    For iOS specific, moreover iPhone 6 s (plus) specific, you can use the 3D touch quick actions.

    For Windows Phone you can specify a custom url for a pinned tile. They are called Secondary Tiles. I'm not aware of any Android stuff regarding this kind of functionality.

  • MichaelLaskieMichaelLaskie USMember
    edited February 2016

    Nice... I'll look into that realm. Thank you.

    I made some progress, looks like it'll be platform specific, that's fine. I hope each has a little something for working with their assistant, I'd have to think so.

    I've located a briefing that also mentions OnActivated on the Microsoft device here.

    However in lieu, I found that the OnNavigatedTo was still a good place to drill in and inspect NavigationContext.

    protected override void OnNavigatedTo(NavigationEventArgs e) { if (e.NavigationMode == NavigationMode.New) { string voiceCommandName; if (NavigationContext.QueryString.TryGetValue("voiceCommandName", out voiceCommandName)) { HandleVoiceCommand(voiceCommandName); } ...

Sign In or Register to comment.