×

注意!页面内容来自https://websitetoapk.com/docs/javascript-apis.html,本站不储存任何内容,为了更好的阅读体验进行在线解析,若有广告出现,请及时反馈。若您觉得侵犯了您的利益,请通知我们进行删除,然后访问 原网页

Product Documentation

JavaScript APIs (v5.2)

Special JS Functions that works only with Website 2 APK v6.0

Make your app perform like a native app using these API access functions!


  • Share App
<script>
      	Website2APK.shareIntent();
</script>
  • Display a Toast Notification
<script>
      	Website2APK.showToast("This is a Toast");
</script>
  • Exit or Close App
<script>
      	Website2APK.exitApp();
</script>
  • Display App About Dialog
<script>
      	Website2APK.showAboutDialog();
</script>
  • Display Custom Dialog
    showAboutDialog(String textString titleString ok)
<script>
      	Website2APK.showAboutDialog("Hello ThereIt is a Custom Dialog","Title Text","OK");
</script>
  • Open Link in External Browser
    openExternal(String url)
<script>
      	Website2APK.openExternal("https://websitetoapk.com/");
</script>
  • Rate App on Google Play
<script>
      	Website2APK.rateUs();
</script>
  • Prompt User to Enable GPS
<script>
      	Website2APK.askEnableGPS();
</script>
  • Get Unique Device ID
<script>
      	var devId = Website2APK.getUniqueDeviceID();
	alert(devId);
</script>
  • Get Device API Level
<script>
      	var devId = Website2APK.getDeviceApiLevel();
	alert(devId);
</script>
  • Refresh Page
<script>
      	Website2APK.refreshPage();
</script>
  • Open Options Menu
<script>
      	Website2APK.clickMenuButton();
</script>
  • Get App Version Name
<script>
      	var verName = Website2APK.getAppVersionName();
	alert(verName);
</script>
  • Get App Version Code
<script>
      	var verCode = Website2APK.getAppVersionCode();
	alert(verCode);
</script>
  • Get App Package Name
<script>
      	var pkgname = Website2APK.getAppPackageName();
	alert(pkgname);
</script>
  • Print Page
<script>
      	Website2APK.printPage();
</script>
  • Keep Screen On
<script>
      	Website2APK.keepScreenOn(true); //true to keep onfalse to disable keepScreenOn
</script>
  • Get Firebase Messaging Device Token
<script>
      	var token = Website2APK.getFirebaseDeviceToken();
</script>
  • Enable Broadcast Push
<script>
      	Website2APK.subscribeBroadcastPush();
</script>
  • Disable Broadcast Push
<script>
      	Website2APK.unsubscribeBroadcastPush();
</script>
  • Hide/Show AdMob Banner on Specific Pages
  • enableShowBannerAd(Boolean boolean)
<script>
      	Website2APK.enableShowBannerAd(false); //true to displayfalse to hide
</script>
  • Display Interstitial Ad
<script>
      	Website2APK.showInterstitialAd();
</script>
  • Disable Non Personalized Ads
<script>
      	Website2APK.disableNpa();
</script>
  • Enable Non Personalized Ads
<script>
      	Website2APK.enableNpa();
</script>
  • Check Non Personalized Ads Status
<script>
      	var check = Website2APK.isNpaEnabled();
</script>

This documentation is still under developmentwe are working to add more things to it to make it complete. Keep yourself up to date by visiting this page whenever you needs any help. If heaving some issuesyou can contact Support