Product Documentation

JavaScript APIs (v3.2)

Special JS Functions that works only with Website 2 APK v3.2

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 text, String title, String ok)
<script>
      	Website2APK.showAboutDialog("Hello There, It 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>
  • 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>
  • Print Page
<script>
      	Website2APK.printPage();
</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>
  • 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 development, we 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 issues, you can contact Support