src/components/activities.js
/**
   * Registers the callback for the result of the activity opened with the
   * specified `requestId` (see the `open()` method). The callback is a
   * function that takes a single `ActivityPort` argument. The client
   * can use this object to verify the port using it's origin, verified and
   * secure channel flags. Then the client can call
   * `ActivityPort.acceptResult()` method to accept the result.
   *
   * The activity result is handled via a separate callback because of a
   * possible redirect. So use of direct callbacks and/or promises is not
   * possible in that case.
   *
   * A typical implementation would look like:
   * ```
   * ports.onResult('request1', function(port) {
   *   port.acceptResult().then(function(result) {
   *     // Only verified origins are allowed.
   *     if (result.origin == expectedOrigin &&
   *         result.originVerified &&
   *         result.secureChannel) {
   *       handleResultForRequest1(result);
   *     }
   *   });
   * })
   *
   * ports.open('request1', request1Url, '_blank');
   * ```
   *
   * @param {string} requestId
   * @param {function(!ActivityPortDef)} callback
   */
Registers the callback for the result of the activity opened with the
specified `requestId` ` method). The callback is a
function that takes a single `ActivityPort` argument. The client
can use this object to verify the port using it's origin, verified and
secure channel flags. Then the client can call
`ActivityPort.acceptResult()` method to accept the result.

The activity result is handled via a separate callback because of a
possible redirect. So use of direct callbacks and/or promises is not
possible in that case.





@param {string} requestId
@param {function(!ActivityPortDef)} callback
Registers the callback for the result of the activity opened with the specified ` requestId ` ` method ) . The callback is a function that takes a single ` ActivityPort ` argument . The client can use this object to verify the port using it ' s origin verified and secure channel flags . Then the client can call ` ActivityPort . acceptResult () ` method to accept the result . The activity result is handled via a separate callback because of a possible redirect . So use of direct callbacks and / or promises is not possible in that case . @param { string } requestId @param { function ( !ActivityPortDef ) } callback
onResult(requestId, callback) {
    this.activityPorts_.onResult(requestId, (port) => {
      callback(new ActivityPortDeprecated(port));
    });
  }
onResult ( requestId , callback ) { this . activityPorts_ . onResult ( requestId , ( port ) => { callback ( new ActivityPortDeprecated ( port ) ) ; } ) ; }
Registers the callback for the result of the activity opened with the
 specified `requestId` (see the `open()` method).
Registers the callback for the result of the activity opened with the specified ` requestId ` ( see the ` open () ` method ) .