Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-10653

Universal Windows Platform -- activationContext is incomplete

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: cordova-windows
    • Labels:
    • Environment:

      Windows 10, Windows 10 Phone

      Description

      CB-8674 modified cordova-js-src/platform.js to capture the application's onactivated event, and record the details in the platform.activationContext instance.

      Unfortunately, CB-8674 covers only a few of the 12 types of UWP activation events. As an example, if an app is activated by a Cortana voice command, the details are missed. See here for more details: https://msdn.microsoft.com/en-us/library/windows/apps/br212679.aspx

      The proposed fix is to change:

      var activationHandler = function (e) {
      var args = e.detail.arguments;
      var actType = e.detail.type;
      platform.activationContext =

      { type: actType, args: args }

      ;
      cordova.fireDocumentEvent('activated', platform.activationContext, true);
      };

      To be:

      var activationHandler = function (e)

      { platform.activationContext = utils.clone(e.detail); platform.activationContext.args = e.detail.arguments; // Backwards compatibility cordova.fireDocumentEvent('activated', platform.activationContext, true); }

      ;

      This also means that platform.js should require("cordova/utils")

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rakatyal Raghav Katyal
                Reporter:
                adam.fourney@gmail.com Adam Fourney
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 2h
                  2h
                  Remaining:
                  Remaining Estimate - 2h
                  2h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified