Search code examples
cordovawindows-8winjsibm-mobilefirst

Mobilefirst 7 -> windows 8 URL activation scheme parameters


I've a problem with activation protocols in mobilefirst / windows8(.1). In a standard winJS app I can get the parameters after activating an app by custom protocol in the canonical way:

   //register event
    WinJS.Application.addEventListener("activated", onActivatedHandler, false);

//handle
function onActivatedHandler(eventArgs) {
   if (eventArgs.detail.kind == Windows.ApplicationModel.Activation.ActivationKind.protocol) 
   {    
       // The received URI is eventArgs.detail.uri.rawUri
   }
}

My problem is that in the app written in mobilefirst the app don't raise event! Someone has similar problems? Thanks, f.


Solution

  • Where are you calling the addEventListener ? Perhaps, the onactivated event has already been raised before you called the addEventListener.

    I was able to intercept the loading in the cordova.js file and added an event listener and the appropriate function was fired.