Javascript Integration API Documentation
It is a javascript API that allows you to control the web view and the push-only prototype app provided by Swing2App.
In short, include and use the following js file through the API specification below and perform the functions you need.
Common js file Please include the following js file in your HTML file
WebView Javascript API Specifications
Webview Control Related Methods
Webview Backwards
To Move to the previous page in the webview app. Same style as the back function in the web browser
Webview Forward
Move to the front page in the webview app. Same style as the forward function in the web browser
Go to Webview Home
Ability to navigate from the webview app to the home page (set initial page) set in the Swing2App.
Application-related methods
Get platform information
Functions for getting platform information from the web
Get version and device information
A function that gets the version of the app and the H/W and S/W information of the device
Ability to close the app
Command to terminate a running app
Run a URL with an external browser
If you want to open a specific page with the default browser of an app such as Chrome or Safari, you can use the following function.
Run URLs with the embedded browser
Run using Android and iOS's own built-in browser.
If you must use Chrome and Safari, you can operate Chrome and Safari from inside the app through the code below.
Share the current page
Run the code below for the current Web page-sharing feature
Share a custom URL
If you want to share the specified URL, run the code as shown below.
Checking the notification setting status of the application
Ability to check the status of push alarm settings in the application.
If the push is disabled or if the push is turned off by the OS itself,
You can check if the app is turned off with its own settings.
Ex:) Code example for recommending activation when Off setting according to push setting
Alarm Settings
Ability to move alarm settings of applications or systems
(1) Go to the screen where you can set the alarm by the application itself
(2) Go to the screen where you can set your own alarm for the system (Android, iOS)
Methods related to AdMob
This is a command that allows you to manage in-app AdMob ads directly from the website.
Please refer to the information below to use the ads.
This command only works for apps with ad mob enabled
Show banner ads
Commands to display AdMob banner ads in applications
Parameter | Explanation | Example values |
---|---|---|
adId | Enter banner ad unit ID | ca-app-pub-3940256099942544/6300978111 |
End banner ads
Command to stop AdMob banner ads in the application
Show interstitial ads
Commands to display AdMob interstitial ads in applications
Parameter | Explanation | Example values |
---|---|---|
adId | Enter interstitial unit ID | ca-app-pub-3940256099942544/6300978111 |
Last updated