Skip to content

Instantly share code, notes, and snippets.

@kakha13
Last active July 16, 2021 23:28
Show Gist options
  • Save kakha13/756afee1b1a594af226acb6f5f97df36 to your computer and use it in GitHub Desktop.
Save kakha13/756afee1b1a594af226acb6f5f97df36 to your computer and use it in GitHub Desktop.
How to get nativescript-plugin-firebase admob SMART_BANNER height
First we are getting screen size and then doing calculations with SMART_BANNER logics
const platform = require("platform") // import this
......
const screenHeightDp =platform.screen.mainScreen.heightPixels / platform.screen.mainScreen.scale; // height divided by scale
const BannerHeight = screenHeightDp > 720 ? 90 : screenHeightDp > 400 ? 50 : 32; // doing calculations as smart banner works
console.log(BannerHeight); // this is our banner height
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment