activated

activated

The event fires when Windows Runtime activation has occurred. See MSDN docs for further details and activation types.

Quick Example

document.addEventListener("activated", activated, false);

function activated(args) {
    if (args && args.kind === Windows.ApplicationModel.Activation.ActivationKind.file) {
       // Using args.raw to get the native StorageFile object
        Windows.Storage.FileIO.readTextAsync(args.raw.detail[0].files[0]).done(function (text) {
            console.log(text);
        }, function (err) {
            console.error(err);
        });
    }
}

Windows Quirks

  • Original activated event args are available in args.raw.detail[0] property and can be used to get a type information or invoke methods of one of the activation arguments,

  • Original activated event args are also cloned to args.detail[0] and can be used as a fallback in case an inner args property has been lost.
    See https://issues.apache.org/jira/browse/CB-10653 for details.

  • activated event might be fired before deviceready so you should save the activation flag and args to the app context in case you need them - for example in the Share target case. The subscription to the activated event should be done before deviceready handler (in app.bindEvents in terms of the Cordova template).

doc_cordova
2017-01-31 03:39:53
Comments
Leave a Comment

Please login to continue.