Swing2App Manual
Help CenterFAQContact UsBuild an app
  • Swing2App
  • Swing2App Update
  • FAQ
    • FAQ(Frequently Asked Questions)
      • Frequently Asked Questions (FAQ)
      • App Creation FAQ
      • App Operations & Features FAQ
      • App installation and download FAQ
      • Registration and Login FAQ
      • App Preview FAQ
      • Swing Shop FAQ
      • Billing FAQs
      • Paid App Passes & Tickets FAQ
      • Paid usage and uploading FAQ
      • Unlimited Usage and Package FAQ
      • Push sending FAQs
      • PlayStore FAQ
      • App Store FAQ
      • AdMob FAQ
      • Affiliate Program FAQ
      • Customization FAQ
  • Manual
    • App production manual (V3)
      • Start App Creation With MakerV3 Screen
      • Manual on How to Create an App In MakerV3 Screen
      • STEP1 Basic Information
      • STEP2 Prototype
      • STEP3 Page
        • How to Create a Home Screen For an App
        • Registering a menu icon image
        • How to use: Menu Exposure Settings
        • Set menu settings: Access permissions
        • Page Design - UI KIT
        • Page Design - eStore Page
        • Page Design - eStore Deals
        • Page Design - Product Category
        • Page Design- Page Templates
        • Page Design - Image Page
        • Page Design - HTML Editor
        • Page Design - Sign Up, login & Settings Page.
        • Page Design - Search Posts Page
        • Page Design - View Favorite Page
        • Page Design - View Coupons Page
        • Page Design - Share Your App Function
        • Page Design - App Introduction Page
        • Page Design - Admin Chat Page
        • Page Design - Chat List Page
        • Page Design - Surveys Page
        • Page Design - View My Posts Page
        • Page Design - Attendance Check Page
        • Page Design- Web Link
      • STEP4 Complete App Creation
        • How to create an additional app
        • How to update an app
        • App launch screen by update type
    • App production manual(V2)
      • App basics
        • Guide to create an app
        • App Update Type And Method
        • App Launch Screen Update Type
        • Push or WebView version creation method (super simple app creation)
        • WebView App Manual(production and operation)
        • Push App Manual(production and operation)
        • Remove Push App Toolbar
        • App Production
        • Guide to create App Icon Image
        • Guide to Create an Idle Screen Image
        • Image Editing Tool
      • Design Theme
        • Prototype UI Design
        • App Main Design Style
        • App Navigation Styles
        • Applying Slide Prototype
      • Page Menu
        • Page Menu – Main Menu Management
        • Creating an App Home Screen
        • How to use Web Link
        • Home screen: Applying App Introduction Page
        • How to use file attachment
        • How to use the image attachment
        • How to use Product category
        • How to use Weblink-linkeditor
        • How to use User Page
        • How to create an Image Page
        • How to create a web template page
        • How to create HTML editor page
        • Swing2App Page – Signup, Login, Settings
        • Swing2App Page – Search Post
        • Swing2App Page – View Favorites
        • Swing2App Page – View Coupon
        • Swing2App Page – Share App
        • Swing2App Page – App Introduction
        • Swing2App Page – Admin Chat
        • Swing2App Page – How to read my article
        • Swing2App Page - Survey
    • App Production Application TIP
      • Sending a push using the push API
      • Insert GIF image
      • Create a Flash style home screen
      • Change App Loading Icon
      • Set device mode (switch app screens)
      • How to use the app review button
    • App operation manual
      • Bulletin board management
        • Create a bulletin board
        • Bulletin board type, design style
        • Bulletin Board – How to Enter Posts
        • Bulletin Board – Post Schedule Settings
        • Set post detail options
        • Bulletin Board – How to Attach Files
        • Register video post(how to register a video)
        • Bulletin Board – How to Attach Music Files
        • How to enter post comments and comments
        • How to set up Bulletin Board Permission
        • Bulletin board authority setting
        • How to create a Form in Bulletin Board
        • How to write a bulletin board
        • How to use the list screen and creation screen
        • How to set up a bulletin board post alarm
        • Set Up a Board Administrator
        • Google Map Bulletin Board
        • Google Map Bulletin Board Advanced setting
        • HTML Editor Writing
        • Report and manage posts
        • Block posts
        • Create bulletin board by membership level
        • Bulletin board thumbnail image registration
        • Search Post Functions
        • Post Management Options
        • How to use the bulk registration bulletin board
        • Copy Bulletin Board
        • Copy Post
        • Move a post
        • How to delete bulk posts
        • Group Chat
        • Create a Secret Bulletin Board (1:1 Customer Service)
        • Create a link for a post
        • How to Use Calendar
        • Calendar Application - How To Use
        • How to create and register a stamp
        • Stamp application: Issue coupons upon completion of stamps
        • How to use the bulletin board header
        • Using 2 hash-tags Options
        • How to use hashtag search option
        • Download Posts
      • Service management
        • How to use Pop-up
        • Check-ins
        • Surveys
        • Resource Management – Capacity Management
        • Coupon Management: Create and Issue Coupon
        • How to use Admin Chat [1:1 Chat]
        • Chat Administrator Page – Chat List
        • Chat Administrator page – Chat settings
        • How to use chat list
        • Unified Notification Settings
        • App Policy Management – App Subscription Policy
        • App Terms of Use And Privacy Policy
        • App Policy Management-Membership Form
        • App policy management – How to set up a membership completion message
        • Membership Form-ID Setting
        • App Terms and Conditions, Privacy Policy
        • Create a Private App
        • App string management
        • Link Wizard
      • Push & Member Menu
        • Send push
        • Send Push from Push Version App
        • Push Posts
        • Display messages after getting push notifications
        • Delete or Mark as Read Push Notifications
        • Push history
        • Member Inquiry - Check Member Information
        • Member Inquiry - Setting up an Associate Administrator
        • Member Inquiry - Create User Account
        • Setting up an App Administrator
        • Permission Group Settings-Membership Rating
        • Admin Screen: Change App member's name
        • How to use Push device management
      • Analytics
      • Version control
        • Version management-App production and market registration history
        • How to apply for App Store Upload
        • How to apply for Google Play Store Upload
        • How to apply for a mobile web upload
      • Payment
        • Introduction of paid products and payment methods
        • Payment-How to use my payment status
        • How to Use 1000 SMS Tickets
        • WebView Lifetime Paid App
        • PushOnly Lifetime Paid App
        • How to use mobile web registration
        • Budget package
        • AdMob Power Package
        • Large Storage Packages
        • Online Stores – Coupon
      • Full Search Function
    • SwingShop
      • Apply for Swing Store
      • Swing Store Product Type
      • Introduction of pages provided by Swing Shop
      • How to Apply a Swing Store Menu to your App
      • Swing Shop - Shopping Mall Main Page How to Use
      • Shopping Mall Main Page Slide Image
      • Store Management - Basic Information Settings
      • Store Management - Shipping Management
      • Product Management - Set how to receive goods
      • Product Management - Product Category Registration
      • Store Management-Policy Settings
      • Product Management - Physical Product Registration
      • Product Management - Digital Products: PDF File Registration
      • Product Management - Digital Products: Video Files Registration
      • Product Management-Digital Products: Authorized Sales
      • Product Management-Digital Products: Coupon Registration
      • Product Management-Reservation system product registration
      • Product management - Reservation system, Time reservation product registration
      • Product management-Reservation System Operation TIP
      • Product Management - Product Post Management
      • Product Management- Product Inquiry, Reservation Product Inquiry
      • Product Management - Product Exposure Management
      • Order Management
      • Reservation Order Management
      • Store Statistics
      • Swing2App Page-shopinfo
      • Swing2App Page-Search
      • Swing2App Page - Category List
      • Swing2App Page-mypage
      • Swing2App Page - Cart
      • Swing2App Page-digital products
      • Product Modification - Modify a registered product
    • Affiliate program
      • How to apply for affiliate program
  • Web App - Webview, Push
    • Web App - Webview, Push
      • Swing2App WebView App
      • Swing2App Push App
      • webview app manual
      • Pushapp manual
      • How to create a push app or webview app easily
      • Push-app toolbar
      • How to use the first run address in webview and push app
      • WebviewApp basic settings and advanced setting options
      • Push App Toolbar - Introduction: How to Use and Functions
      • Registering a Push Notification Icon Image
      • Progress Bar Color Settings
      • Remove progress bar (not in use)
  • App Guide
    • How to use Swing2App Preview
    • Application operation
      • How to convert and use paid apps.
      • How to install APK file on your phone
      • How to install apps by sharing
      • Free app conversion method after Paid period ends/expires
      • Download the app after accessing the mobile Swing2App site
      • Download the app using the app installation link address
      • If you can not install the free version of the app (APK file), please check!
      • If you can not install the paid version app (APK file), please check!
      • Find App Password
      • Registering and changing your app profile picture
      • How to re-register with the same ID after leaving the app
      • Share app
      • App – Share your Bulletin Board Posts
      • How to use the App Administrator menu
      • App Administrator menu: Chat
      • App Administrator Menu: Registering Stamp
      • App Administrator Menu: Use Coupon
  • STORE
    • Play Store
      • How to create a Google Developer Account
      • Create a Google Developer - Business Account
      • Google Developer Account Identity Verification
      • Launching Play Store App
      • Setting up Play Store app auto-updates
      • Transfer your app to another developer account on the Play Store
      • How to change the name of Play Store Developer
      • Delete Play Store app
      • How to use Google Help Center
      • Issuing Google Maps API Key
      • Invite a Play Store Developer Account
      • How to get app updates released on the Play Store
      • Launch the Play Store Private App (Alpha release)
      • Check Play Store App Installs
      • Reply to Play Store app reviews
      • Play Store Developer Page
      • Play Store prior notice
      • Linking Play Store Privacy Links
      • Play Store App Search TIP
      • How to restore Play Store app
      • Update the Play Store App
    • App Store
      • App Store Apple Developer Account Registration
      • Check app store app downloads
      • How to use the App Store Customer Center
      • Delete apps from the App Store
      • AppStore App Rejection Cases
      • App Store TestFlight
      • How to invite Swing2App account on App Store Connect and share information on App Store Upload form
    • AdMob (Google AdMob Ads)
      • Admob Banner Ad Frequency Settings
      • Admob Operation Precautions
      • How to apply AdMob plug-in
      • AdMob Plug-in check
      • What is AdMob plugin setting?
      • How to join AdMobs, create an Ad Unit ID
  • Developer Document
    • Server Side API Specifications
      • Sending a push notification By API
    • Webview (Webview, Push only) Development tool
      • Implementing Google and Facebook Login in WebView
      • Website Member Integration Guide
        • Wix Website User Integration Guide
        • WordPress Website Member Integration Guide
      • Javascript API Documentation
  • Policy
    • Store Policy
    • Limit on the Number of Devices for Free User
    • Swing Store Terms and Conditions
Powered by GitBook
On this page
  • WebView Javascript API Specifications
  • Webview Control Related Methods
  • Controlling the Toolbar methods
  • Application-related methods
  • Methods for Controlling App UI
  • Method for Controlling App Screen
  • Application Event
  • Methods related to AdMob
Edit on GitHub
  1. Developer Document
  2. Webview (Webview, Push only) Development tool

Javascript 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

<script src="https://pcdn2.swing2app.co.kr/swing_public_src/v3/2024_02_28_002/js/swing_app_on_web.js"></script>

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

swingWebViewPlugin.app.webview.back();

• Webview Forward

Move to the front page in the webview app. Same style as the forward function in the web browser

swingWebViewPlugin.app.webview.forward();

• Go to Webview Home

Ability to navigate from the webview app to the home page (set initial page) set in the Swing2App.

swingWebViewPlugin.app.navigateToHome()

• Clean Web Cache

Command to Clear Cache in WebView

*Available from js lib version 2024_02_28_002

swingWebViewPlugin.app.webview.clearCache()

Controlling the Toolbar methods

• Enabling the Toolbar

You can control the Toolbar via API in a push-only prototype.

You can hide, enable, and set the auto-hide option for the toolbar while the app is running.

*Available from js lib version 2024_02_28_002

// toolbar active , autohide inactive
// swingWebViewPlugin.app.webview.updateToolbar(true,false)
// toolbar active , autohide active 
// swingWebViewPlugin.app.webview.updateToolbar(true,true)
// toolbar inactive , autohide inactive
// swingWebViewPlugin.app.webview.updateToolbar(false,false)
swingWebViewPlugin.app.webview.updateToolbar(false,false)

Application-related methods

• Get platform information

Functions for getting platform information from the web

if( swingWebViewPlugin.app.methods.getCurrentPlatform() == 'android' )
{
    console.log('android');
}
else if( swingWebViewPlugin.app.methods.getCurrentPlatform() == 'ios' )
{
    console.log('ios');
}
else
{
    console.log('web browser');
}

• 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

// android
swingWebViewPlugin.app.methods.getAppVersion(function(value){
    console.log('model : ' + value.model);
    console.log('sdk_version : ' + value.version);
    console.log('version_release : ' + value.version_release);
    console.log('manufacturer : ' + value.manufacturer);
    console.log('app_version : ' + value.appVersion);
    console.log('radio_version : ' + value.radio_version);
    console.log('package_name : ' + value.packageName);
});

// ios
swingWebViewPlugin.app.methods.getAppVersion(function(value){
    console.log('model : ' + value.model);
    console.log('name : ' + value.name);
    console.log('systemVersion : ' + value.systemVersion);
    console.log('appVersion : ' + value.appVersion);
    console.log('bundleVersion : ' + value.bundleVersion);
    console.log('bundleID : ' + value.bundleID);
});

• Close application

Command to terminate a running app

swingWebViewPlugin.app.methods.doExitApp();

• 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.

swingWebViewPlugin.app.methods.doExternalOpen('https://www.swing2app.com');

• 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.

swingWebViewPlugin.app.methods.openBrowser('https://www.swing2app.com');

• Share the current page

Run the code below for the current Web page-sharing feature

swingWebViewPlugin.app.methods.doShareCurrentPage();

• Share a custom URL

If you want to share the specified URL, run the code as shown below.

swingWebViewPlugin.app.methods.doShareWithUrl('https://www.swing2app.com');

• 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.

swingWebViewPlugin.app.methods.isNotificationEnabled(function (result) {
    if( result == '1' ) // Able to send push notification
    {
        console.log('push active');
    }
    else if( result == 'off_on_system' )    // Disabling app push by OS setting
    {
        console.log('push inactive');
    }
    else if( result == 'off_on_app' )       // Disable App Push by App Settings
    {
        console.log('push inactive');
    }
});

Ex:) Code example for recommending activation when Off setting according to push setting

swingWebViewPlugin.app.methods.isNotificationEnabled(function (result) {
    if( result == '1' ) // Able to send push notification
    {
        console.log('push active');
    }
    else if( result == 'off_on_system' )    // Disabling app push by OS setting
    {
        console.log('push inactive');
        swingWebViewPlugin.app.methods.goToNotificationSetting("system"); // Open Notification Setting in System setting
    }
    else if( result == 'off_on_app' )       // Disable App Push by App Settings
    {
        console.log('push inactive');
        swingWebViewPlugin.app.methods.goToNotificationSetting("app");    // Open Notification Setting in App
    }
});

Ability to move alarm settings of applications or systems

(1) Go to the screen where you can set the alarm by the application itself

swingWebViewPlugin.app.methods.goToNotificationSetting('app');

(2) Go to the screen where you can set your own alarm for the system (Android, iOS)

swingWebViewPlugin.app.methods.goToNotificationSetting('system');

• Saving Text to Clipboard

A feature that allows you to save text to the clipboard.

Due to security issues, the window.navigator.clipboard.writeText API does not function properly in WebView.

In Swing2App WebView, you can use the following API to save text to the clipboard.

swingWebViewPlugin.app.methods.copyToClipboard("copyToClipboard Text test");

• Activate Push Notification

API to active push notification

swingWebViewPlugin.app.methods.activePush();

• Inactivate Push Notification

API to inactive push notification

swingWebViewPlugin.app.methods.inactivePush();

• Saving Variables on the Device

Saving Storage Variables within the App

If you have data you want to store in the app's storage, you can use the following function to save it.

You can utilize this feature to easily implement automatic website login.

*Available from js lib version 2024_02_28_002

swingWebViewPlugin.app.methods.setVariable('id','test');

• Retrieving Saved Variables on the Device

Fetching Stored Variable Values within the App

*Available from js lib version 2024_02_28_002

swingWebViewPlugin.app.methods.getVariable('id',function(value) {
    console.log(JSON.parse(value).value);
    // 출력예시 : test
});

• Playing TTS (Premium Feature) - Customization Required

Function to enable the TTS feature that converts text to speech

*Available from js lib version 2024_02_28_002

swingWebViewPlugin.app.methods.speakOutViaTTS('hello');

• Checking First App Launch

API to check if the app is being launched for the first time, a function to determine the first launch of the app

*Available from js lib version 2024_02_28_002

swingWebViewPlugin.app.methods.isFirstRun(function (value) {
    if (JSON.parse(value).result) 
    {
        console.log('First App Launching');
    }
});

Methods for Controlling App UI

• Setting Background Color for iOS

An option to set the SafeArea region and main color due to the device notch and home bar UI on iOS.

Please input the color as a hex value without the # symbol.

This setting only works on iOS.

*Available from js lib version 2024_02_28_002

swingWebViewPlugin.app.ui.setIosBackColor('00ff00');

Method for Controlling App Screen

• Navigating to Settings Screen

API command to navigate to the settings screen.

You can move to the settings screen without using the toolbar or menu bar.

*Available from js lib version 2024_02_28_002

swingWebViewPlugin.app.screen.setting.show();

• Navigating to Notification List Screen

API command to navigate to the notification list screen.

You can move to the notification list screen without using the toolbar or menu bar.

*Available from js lib version 2024_02_28_002

swingWebViewPlugin.app.screen.notificationList.show();

• Navigating to Menu Screen

API command to navigate to the menu screen.

You can move to the menu screen without using the toolbar.

*Available from js lib version 2024_02_28_002

swingWebViewPlugin.app.screen.menu.show();

• Navigating to Bookmark List Screen

API command to navigate to the bookmark list screen.

You can move to the bookmark list screen without using the menu or toolbar.

*Available from js lib version 2024_02_28_002

swingWebViewPlugin.app.screen.bookmarkList.show();

Application Event

Commands to manage the app's native events.

• Adding WebView Navigation Event for Android App Back Key

When you add an exit event to the app's Back button, the back navigation function triggered by the Back button will not work.

Therefore, if you add a backEvent, you need to implement the back navigation function yourself, as it will not work when the WebView navigation goes back due to the Back key.

swingWebViewPlugin.event.addEvent('backEvent' , function() {
    // Android back event 
    swingWebViewPlugin.app.webview.back(); // webview back navigation code
})

• Adding Exit Event for Android App Back Key

When you add an exit event to the app's back button, the app will not exit when the back button is pressed.

Therefore, if you add a backExitEvent, you need to implement the exit functionality directly within the callback function.

swingWebViewPlugin.event.addEvent('backExitEvent' , function() {
    // Implementing App Exit Logic Directly
    swingWebViewPlugin.app.methods.doExitApp();    // Exit App 
});

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

swingWebViewPlugin.app.admob.showBanner('ca-app-pub-3940256099942544/6300978111');
  • End banner ads

Command to stop AdMob banner ads in the application

swingWebViewPlugin.app.admob.closeBanner();
  • 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

swingWebViewPlugin.app.admob.showInterstitialAd('ca-app-pub-3940256099942544/6300978111');

Last updated 11 months ago