App/Mobile Apps/android/Project/app/src/main/assets/public/default~firebase-messaging~login-login-module~signup-signup-module~student-ec-form-ec-form-module~st~88bf8aaa-es5.js
/**
     * This method deletes the token from the database, unsubscribes the token from
     * FCM, and unregisters the push subscription if it exists.
     */
This method deletes the token from the database, unsubscribes the token from
FCM, and unregisters the push subscription if it exists.
This method deletes the token from the database unsubscribes the token from FCM and unregisters the push subscription if it exists .
function deleteToken(firebaseDependencies, swRegistration) {
      return Object(tslib__WEBPACK_IMPORTED_MODULE_3__["__awaiter"])(this, void 0, void 0, function () {
        var tokenDetails, pushSubscription;
        return Object(tslib__WEBPACK_IMPORTED_MODULE_3__["__generator"])(this, function (_a) {
          switch (_a.label) {
            case 0:
              return [4
              , dbGet(firebaseDependencies)];
            case 1:
              tokenDetails = _a.sent();
              if (!tokenDetails) return [3
              , 4];
              return [4
              , requestDeleteToken(firebaseDependencies, tokenDetails.token)];
            case 2:
              _a.sent();
              return [4
              , dbRemove(firebaseDependencies)];
            case 3:
              _a.sent();
              _a.label = 4;
            case 4:
              return [4
              , swRegistration.pushManager.getSubscription()];
            case 5:
              pushSubscription = _a.sent();
              if (pushSubscription) {
                return [2
                , pushSubscription.unsubscribe()];
              } 
              return [2
              , true];
          }
        });
      });
    }
function deleteToken ( firebaseDependencies , swRegistration ) { return Object ( tslib__WEBPACK_IMPORTED_MODULE_3__ [ "__awaiter" ] ) ( this , void 0 , void 0 , function ( ) { var tokenDetails , pushSubscription ; return Object ( tslib__WEBPACK_IMPORTED_MODULE_3__ [ "__generator" ] ) ( this , function ( _a ) { switch ( _a . label ) { case 0 : return [ 4 , dbGet ( firebaseDependencies ) ] ; case 1 : tokenDetails = _a . sent ( ) ; if ( ! tokenDetails ) return [ 3 , 4 ] ; return [ 4 , requestDeleteToken ( firebaseDependencies , tokenDetails . token ) ] ; case 2 : _a . sent ( ) ; return [ 4 , dbRemove ( firebaseDependencies ) ] ; case 3 : _a . sent ( ) ; _a . label = 4 ; case 4 : return [ 4 , swRegistration . pushManager . getSubscription ( ) ] ; case 5 : pushSubscription = _a . sent ( ) ; if ( pushSubscription ) { return [ 2 , pushSubscription . unsubscribe ( ) ] ; } return [ 2 , true ] ; } } ) ; } ) ; }
This method deletes the token from the database, unsubscribes the token from
 FCM, and unregisters the push subscription if it exists.
This method deletes the token from the database unsubscribes the token from FCM and unregisters the push subscription if it exists .
/*yield*/ /*break*/ /*yield*/ /*yield*/ /*yield*/ /*return*/ // If there's no SW, consider it a success. /*return*/