locked
Cordova (Multi-Device Hybrid Apps) + URI Activation - How to Get the URL

    Question

  • I am using a cordova app, running in HTML5/Javascript and have followed the URI Activitation guide here:

    http://msdn.microsoft.com/en-us/library/windows/apps/Hh452686%28v=win.10%29.aspx

    My App Launches from the URI that I've registered in the package.appxmanifest, but I cannot retrieve the URI.  The sample code indicates that I need to register for the "activated" event, ie:

    WinJS.Application.addEventListener("activated", onActivateHandler, false);

    And then the uri is in the event args.

    Unfortunately, this event doesn't seem to get raised within the Cordova application.  Any suggestions on what else I can try, or does anyone have a solution?

    Friday, September 19, 2014 3:59 PM

Answers

  • Figured it out myself, had to add a WinJS.Application.start() to the cordova app.  Thanks for the help Jamles.
    • Marked as answer by FBNitro Monday, September 22, 2014 3:19 PM
    Monday, September 22, 2014 3:19 PM

All replies

  • Hi FBNitro,

    You mean the URI cannot be found in event args?

    I'm not sure if cordova will handle the onActivateHandler for you but if you test with a blank app, you should be able to get the URI from args.detail.arguments.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, September 22, 2014 8:00 AM
    Moderator
  • No, I mean the activated event isn't even thrown...
    Monday, September 22, 2014 2:29 PM
  • Figured it out myself, had to add a WinJS.Application.start() to the cordova app.  Thanks for the help Jamles.
    • Marked as answer by FBNitro Monday, September 22, 2014 3:19 PM
    Monday, September 22, 2014 3:19 PM