nativescript-oauth2 icon indicating copy to clipboard operation
nativescript-oauth2 copied to clipboard

Warning: topmost() is deprecated. Use Frame.topmost() instead.

Open sarboleda22 opened this issue 5 years ago • 2 comments

Version numbers:

  • CLI: 6.5.0
  • Cross-platform modules: 6.5.1
  • Runtime(s):
"tns-android": {
      "version": "6.0.0"
    },
    "tns-ios": {
      "version": "6.0.1"
    }
  • Plugin(s):
  "dependencies": {
    "nativescript-vue": "^2.5.1",
    "@nativescript/theme": "^2.2.1",
    "nativescript-oauth2": "^2.4.0",
    "tns-core-modules": "^6.0.0",
    "electron": "^8.2.1",
    "email-validator": "^2.0.4",
    "vue-class-component": "^7.2.3",
    "vue-property-decorator": "^8.4.1"
  },
  "devDependencies": {
    "@babel/core": "^7.0.0",
    "@babel/preset-env": "^7.0.0",
    "@types/node": "^12.12.16",
    "@typescript-eslint/eslint-plugin": "^2.26.0",
    "@typescript-eslint/parser": "^2.26.0",
    "@vue/cli-plugin-eslint": "^4.2.3",
    "@vue/eslint-config-airbnb": "^5.0.2",
    "@vue/eslint-config-standard": "^5.1.0",
    "babel-loader": "^8.0.2",
    "eslint": "^6.8.0",
    "eslint-config-airbnb-base": "^14.1.0",
    "eslint-config-standard": "^14.1.1",
    "eslint-plugin-import": "^2.20.2",
    "eslint-plugin-node": "^11.1.0",
    "eslint-plugin-promise": "^4.2.1",
    "eslint-plugin-standard": "^4.0.1",
    "eslint-plugin-vue": "^7.0.0-alpha.0",
    "lint-staged": "^9.5.0",
    "nativescript-dev-webpack": "^1.0.0",
    "nativescript-vue-template-compiler": "^2.5.0",
    "nativescript-worker-loader": "~0.9.0",
    "node-sass": "^4.9.2",
    "prettier": "^2.0.2",
    "tns-platform-declarations": "^6.0.0",
    "tslint": "^6.1.1",
    "typescript": "^3.8.3",
    "vue": "^2.5.22",
    "vue-loader": "^15.4.0"
  }

Steps to reproduce it.

Follow any tutorial with ^6.5.0 versions of {N}. Run:

client = new TnsOAuthClient(providerType, true)
client.loginWithCompletion((tokenResult: ITnsOAuthTokenResult, error) => {
    if (error) {
        console.log(error)
    } else {
        console.log(tokenResult)
    }
})

You get in console: topmost() is deprecated. Use Frame.topmost() instead.

Solution

In both loginWithCompletion and logoutWithCompletion in oauth.ts, change:

frameModule.topmost()

For:

frameModule.Frame.topmost()

sarboleda22 avatar Apr 10 '20 16:04 sarboleda22

It's the same here. I get an "topmost() is deprecated. Use Frame.topmost() instead."

emog avatar May 17 '20 21:05 emog

This fix works ok

Przemase avatar Jun 12 '20 10:06 Przemase