WebViewGold for iOS



Provider: OnlineAppCreator.com
(distributed via CodeCanyon.net)

Get the source code: Download
FAQs: Click here
Support: Click here

WeSetupYourWebViewApp.com


Get WebViewGold for Android
Get WebViewGold for macOS
Get photos2webgallery for macOS




Intro

Thank you for downloading WebViewGold for iOS, it's a good choice for an WebView app template on iOS!


Stay tuned

Please do not forget to rate this project on CodeCanyon. It only takes a few seconds.
Just navigate to the Downloads section of CodeCanyon:

Don't forget to rate our item on CodeCanyon
We are looking forward to receiving your feedback :)




Follow us and don't miss any updates, coupons and more:
  • Instagram
  • Facebook
  • Twitter
  • YouTube
  • LinkedIn

  • If you have any questions, please feel free to ask!

     


    Changelog

    see the changelog here.


    1) Setup your web app/website/HTML files

    Option 1: Use a URL for accessing your web application (= store files online):

    Create a mobile-optimized website, for example, using jQuery Mobile and upload your site to your webserver/webspace. Please make sure to optimize your website to feel like an app.

    Option 2: Use a local HTML folder for accessing your web application (= store files within the app):

    WebViewGold supports web apps bases on local HTML folders too: Copy your HTML/CSS/JavaScript files to Xcode and set uselocalhtmlfolder to true (see next step). Make sure to import every single file into Xcode by dragging them into Xcode. Placing all data to root folder might be necessary (so make sure to not create or use subfolders within the local-www folder – do not access "css/style.css" but "style.css" within your files).


    2) Setup the Xcode project


    Download the WebViewGold app template here.

    Afterward, open WebViewGold.xcworkspace (instead of WebView.xcodeproj):

    Make sure to select the correct WebView project file when opening the Xcode project

    Within Xcode, open WebViewController.swift and you will see a document like this:

    Configuration is easy using the WebViewController.swift configuration file

    Here you can set up your app easily. Please take a look on our YouTube channel for specific setup tutorials. Please don't forget to add your envato/CodeCanyon Purchase Code in the purchasecode field for each app published by you. One license per each customized end product is required. License info of your CodeCanyon purchase: https://codecanyon.net/licenses/standard


    Setting up apps with WebViewGold is very easy and does not require any coding knowledge. Please take a look at this overview of all built-in configuration options:

    host
    required value
    Your domain host (e.g. "example.org")
    webviewurl
    required value
    Your full WebView URL (e.g. "example.org/app.html") which should be loaded in the WebView
    uselocalhtmlfolder
    true or false
    Set to true to use local "local-www/index.html" HTML file instead of remote WebView URL (make sure to not create or use subfolders within local-www)
    openallexternalurlsinsafaribydefault
    true or false
    Set to true to open all external hosts in Safari
    preventoverscroll
    true or false
    Set to true to remove WKWebView bounce animation (recommended for most cases)
    disablecallout
    true or false
    Set to true to remove WKWebView 3D touch Link Preview/callout window for links (recommended for most cases)
    deletecache
    true or false
    Set to true to delete the WebView cache with every launch of your app
    okbutton
    optional
    Set the text label of the "OK" buttons
    bigstatusbar
    true or false
    Set to true to enhance the Status Bar size
    useloadingsign
    true or false
    Set to false to hide the loading sign while loading your URL
    useragent_iphone
    optional
    Define a customized UserAgent on iPhone (or leave it empty to use the default iOS UserAgent)
    useragent_ipad
    optional
    Define a customized UserAgent on iPad (or leave it empty to use the default iOS UserAgent)
    activatefirstrundialog
    true or false
    Set to true to activate the "First run" dialog
    firstrunmessagetitle
    optional
    Set the title label of the "First run" dialog
    firstrunmessage
    optional
    Set the ext label of the "First run" dialog
    offlinetitle
    optional
    Set the title label of the Offline dialog
    offlinemsg
    optional
    Set the text of the Offline dialog
    screen1
    optional
    Set the text label 1 of the Offline screen
    screen2
    optional
    Set the text label 2 of the Offline screen
    buttontext
    optional
    Set the text label of the Try again button
    activateratemyappdialog
    true or false
    Set to true to activate the "Rate this app on App Store" dialog
    activatefacebookfriendsdialog
    true or false
    Set to true to activate the "Follow on Facebook" dialog
    becomefacebookfriendstitle
    optional
    Set the title label of the "Follow on Facebook" dialog
    becomefacebookfriendstext
    optional
    Set the text label of the "Follow on Facebook" dialog
    becomefacebookfriendsyes
    optional
    Set the text label of the "Yes" button of the "Follow on Facebook" dialog
    becomefacebookfriendsno
    optional
    Set the text label of the "No" button of the "Follow on Facebook" dialog
    becomefacebookfriendsurl
    optional
    Set the URL of your Facebook fan page (e.g., "https://facebook.com/OnlineAppCreator/")
    imagedownloadedtitle
    optional
    Set the title label of the "Image saved to your photo gallery" dialog box
    imagenotfound
    optional
    Set the title label of the "Image was not found" dialog box
    statusbarbackgroundcolor
    optional
    Set the background color of the iOS status bar
    usemystatusbarbackgroundcolor
    true or false
    Set to true to activate the custom status bar background color
    statusbarcolor
    optional
    Set the text color of the iOS status bar
    usemystatusbarcolor
    true or false
    Set to true to activate the custom status bar text color
    AdmobBannerID
    optional
    Insert your AdMob ID for banner ads
    AdmobinterstitialID
    optional
    Insert your AdMob ID for interstitial ads
    showBannerAd
    true or false
    Set to true if you want to show AdMob banner ads
    showFullScreenAd
    true or false
    Set to true if you want to show AdMob interstitial ads after X website clicks
    showadAfterX
    optional
    Define number X to show an AdMob interstitial ads after each X (e.g., 10) website clicks
    ShowExternalLink
    optional
    Set to true to register an iOS-wide URL scheme (like WebViewGold://) to open links in WebView app from other apps; example format: WebViewGold://url?link=https://www.google.com (would open google.com in WebView app).
    ShowNotificationLink
    optional
    Set to true to activate OneSignal URL deeplinking functionality
    sharingText
    optional
    Set the Sharing text of Share API (triggered by share://)
    sharingURL
    optional
    Set the Sharing URL of Share API (triggered by share://)
    kPushEnabled
    true or false
    Set to true to activate the OneSignal push functionality (this variable can be found in Constant.swift file)
    kPushEnhanceUrl
    true or false
    Set to true if you want to extend WebView Main URL requests by ?onesignal_push_id=XYZ (this variable can be found in Constant.swift file)
    kPushReloadOnUserId
    true or false
    Set to true if WebView should be reloaded after receiving the UserID from OneSignal (this variable can be found in Constant.swift file)
    AppBundleIdentifier
    optional
    Set the App Identifier in order to activate In-App Purchase API (details can be configured in App Store Connect; this variable can be found in Constant.swift file)
    IAPSharedSecret
    optional
    Set the App Secret in order to activate In-App Purchase API (details can be configured in App Store Connect; this variable can be found in Constant.swift file)
    remainSplashOption
    optional
    Set to true if you want to display the Splash Screen until your page was loaded successfully
    cssString
    optional
    Set any CSS classes to inject them into the HTML rendered by the WebView. Leave empty to not inject custom CSS into your webpage when accessed in WebView

    3) Change App Name, Icon, and Splash Screen

    It's effortless to change the Display Name of your app:

    Change the iOS name of your Web-View app

    Just insert a new name that should be displayed on the iOS home screen.
    Afterward, include your app icon. A beautiful app icon is a perfect first impression for your customers. It's easy to add your app icon to your WebViewGold project:

    Add your iOS icon to the project space
    Just replace the included image files with your own resized image files. Alternatively, use this helpful tool: Asset Catalog Creator - App Icon, Image Set & Launch Screen Generator for iOS & OS X by Bridge Technologies Limited (we are not affiliated with the developer company).

    Would you like to make your app more attractive to your customers and display your branding as a welcome image? Sure, add your individual splash screen graphics:

    Add your Splash Screen to your WebView app on iPhone/iPad

    Set the remainSplashOption option (can be found in WebViewController.swift file) to true if you want to display the Splash Screen until your page was loaded successfully. Otherwise, it will be displayed for a short time only, and the native iOS loading indicator will begin.


    Modify iPhone X/XS/XS Max Safe Area size

    The jump from iPhone 8 to iPhone X changed a lot in terms of User Interface in the mobile industry. Depending on your web app design, the lower menu bar may be positioned incorrectly on the iPhone X/XS/XS Max due to the safe area which replaces the Home button on these devices. The good news is that WebViewGold allows resizing the viewport height easily. Please search for this code snippet part (STRG+F) in WebViewController.swift file where you can set the border value to any desired value like 10, 20, 30, ...:

    Resize the Safe Area on iPhone X/XS/XS Max WebView apps


    HTML5 Geolocation

    The HTML5 Geolocation feature enables users to communicate their own position to a web application. Check out the Mozilla guide on how to implement geolocation into your website or web app. In WebViewGold, the HTML5 Geolocation API will work by default after you integrated it into your web content. Since iOS 10, Geolocation is available for https-sites only, so please make sure to use a web app URL starting with https:// instead of http:// when using location requests. Demo: https://www.w3schools.com/html/html5_geolocation.asp


    Push Notifications via OneSignal & JavaScript API

    Push notifications are notifications that appear on your smartphone without opening the app. These types of messages allow fantastic interaction with customers and users of the app. Your app does not have to be open. This way, your customers do not miss any important news or messages. Push Notifications are suitable for many cases, e.g., for updates to orders, live tickers, or social media community. There must be an internet connection to allow app users to receive push messages. WebViewGold supports multiple ways of reaching your users via push notifications. If you do NOT want to use push notifications at all, open AppDelegate.swift and set registerforpush to false in order to prevent asking the app user for notification permission.

    Option 1: Use Local Push Notification JavaScript API

    You can insert a piece of code (JavaScript) in your website, to define a push notification, which can be shown after your app was closed (while scheduling it during the app is open). This works without OneSignal configuration at all.

    <script>
    var seconds = 120; //seconds from now on
    var message = "It is Happy Hour now! Check it out!"; //the message
    var button = "Open App"; //the text of the button
    window.location.href = "sendlocalpushmsg://push.send?s="+ seconds +"=msg!"+ message +"&!#"+ button +"";
    </script>
    

    It could be used for different situations (countdowns, happy hours, specific reminders, ...).
    To cancel all scheduled local push notifications run:
        <script>
        window.location.href = "sendlocalpushmsg://push.send.cancel";
        </script>
    

    Option 2: Use OneSignal Remote Push Notifications



    If you want to use OneSignal in your app, activate these options in Constant.swift (by switching the values from false to true):
    Activate the OneSignal features of WebViewGold for push notification support

    Please set your OneSignal App ID in AppDelegate.swift file afterward:
    Enter your OneSignal identification numbers in your project


    Generate an iOS Push Certificate and import it:

    Generate an iOS Certificate for OneSignal Push Delivery

    Make sure to allow push notifications on global Xcode level for the project:


    Yay, you are done. You can send push notifications now:

    Send a new push notification to your app users

    If you want to use OneSignal URL Deeplinking (opens a specific URL when clicking on your notification), please add the desired URL with a custom field called url:

    Enter a web address into OneSignal to enable deeplinking into your WebView app


    Do you want to get each individual user ID on your server for further processing and individual user push messages? Just activate the „kPushEnhanceUrl“ option in Constant.swift (by switching the value from false to true) in order to append ?onesignal_push_id=XYZ to your WebView URL. If your WebView URL is https://www.example.org, WebViewGold will call https://www.example.org?onesignal_push_id=XYZ instead. Only your FIRST URL request will get that GET variable, so save it in a session or in a cookie to access it on your linked pages.




    Banner and Interstitial ads via AdMob

    AdMob offers the possibility of monetizing mobile projects. It is a Google-provided service for integrating Google ads into mobile applications. The AdMob program allows mobile application developers to incorporate ads on iOS and Android platforms. The ad space provided by the app developer is paid by clicks (CPC, Cost Per Click) or impressions (CPM, Cost Per Mille). WebViewGold is ready for activating AdMob ads by default, and it allows you to monetize your WebView-based applications. Make sure to buy an extended license of WebViewGold if you want to make money with apps based on WebViewGold.



    Open AppDelegate.swift file and set your AdMob global account ID:

    Add your AdMob Account ID to the project

    You can activate and deactivate banner and/or interstitial ads and define the interval of appearing interstitial ads. Please set your AdMob IDs in WebViewController.swift file before launching your app:

    Activate specific AdMob banner blocs into your application

    For more information, please consider the official AdMob SDK documentation as well (but skip the setup parts as WebViewGold already includes the framework).


    Activate HTML background audio

    For some scenarios, it may be useful to play audio content even after minimizing the app (for example, if you're making a radio stream or your music available in the app). Please take a look at the video to learn how your app's audio can play even when users switch to a different foreground app or when they lock their iPhone or iPad.




    Image, PDF and Music file downloader API

    If you offer to download or view documents or other downloads in your web app, our WebViewGold Download API will help you for the tremendous and native user experience of your app.

    Save images to the camera roll of the user by calling links with savethisimage://?url= prefix:

    <a href="savethisimage://?url=IMAGE URL HERE">Link</a>
    

    Save PDF files using iOS "Open with..." app dialog by calling links with .pdf suffix:

    <a href="https://www.example.org/file.pdf">Link</a>
    

    Save Music files by calling links with .mp3, .mp4 or .wav suffix:

    <a href="https://www.example.org/file.mp3">Link mp3</a>
    <a href="https://www.example.org/file.mp4">Link mp4</a>
    <a href="https://www.example.org/file.wav">Link wav</a>
    

    Sometimes only a restart helps. This is true in life as well as in digital life. Click on this link to reset your users' app to app factory settings (by clearing all cookies and cache):

       <a href="reset://">Link</a>
    

    Insert the https://www.onlineappcreator.com/reset_test.html URL into your WebViewGold app for a demo.



    Show/hide the loading sign manually

    The native iOS loading indicator of WebViewGold will be triggered automatically when a page starts or finishes loading. However it could be useful to know that it can be triggered manually as well (e.g., you could show the activity indicator as well when waiting in your live chat queue, or some cloud server action is running in the background, and you want to visualize the process on the client):

       <a href="spinneron://">Show the loading spinner</a>
       <a href="spinneroff://">Hide the loading spinner</a>

    It often makes sense in WebView based apps to treat different web addresses differently. If you place a social media button in your web app, a click on it should probably not open the social media page in your app, but in the right app (e.g., the system browser). It's good that WebViewGold has all the features to enable powerful configuration and treat links the way you want it.

    Option 1: Open all external hosts in Safari

    If you want to open every URL, which is not on your host in Safari, please set your host in setup and set openallexternalurlsinsafaribydefault to true.


    Option 2: Open specific hosts in Safari

    Open WebViewController.swift and scroll down until you see this code snippet:

    Handle external URLs for different opening behavior

    To add another domain, just copy this part and insert another host, which should be opened in Safari. Please enter the host exactly the way you link to it (with or without www, but always without HTTP/HTPPS/.. in Xcode).


    URL Handling – Open links in tab/additional In-App-Browser

    There are some cases for links that do not feel to be "important enough" to open them in the Safari browser externally but "too specific" for opening them in the app WebView itself (e.g., your Terms and Conditions page). For this particular kind of links, we added a creative idea of URL Handling: a tab that opens an additional in-app-browser over the main WebView content itself. It will look like this:

    Open a link in an additional in-app-browser/tab SFSafariViewController

    As you see this in-app-browser includes an address bar and navigation buttons (including an "Open in Safari" button). That's a considerable difference to the primary, full-screen WebView content. So this kind of combination of app and browser experience is great for tutorials, knowledge databases, and all type of content that requires any type of navigation. To use this kind of in-app-browser, link to an URL in this format:

    <a href='#' onClick="top.location.href='https://www.google.com';">Open Google</a>
    
    



    With Universal Links, it becomes easy to link to content inside your app. Apple introduced the feature with iOS 9, and it's supported with any version later than iOS 9 as well. WebViewGold allows configuring a link scheme like webviewgold:// which can be triggered from the Mail app, Safari app, ... and opens the attached link in the WebView app.



    Please change the scheme to your own app name (like your-app-name:// instead of webviewgold://) in Info.plist:

    Info.plist is a powerful location to configure Universal links which can be triggered from different apps as well

    Afterward, activate the ShowExternalLink option in WebViewController.swift file:

    Universal Links Setup

    Done! :) Example format: WebViewGold://url?link=https://www.google.com (would open google.com in WebView app).


    App Sharing Dialog

    The Sharing Dialog functionality of WebViewGold gives your app users the ability to share the download link of your application with their friends, family, and colleagues. It's an incredibly smooth and effective way of expanding the user base of your application.



    WebViewGold allows triggering a native App Sharing Dialog dialog (WhatsApp, SMS, Mail, ...) by calling shareapp:// links:

    <a href="shareapp://">Share app</a>

    Please configure the Sharing parameters in WebViewController.swift file:

    Set a Sharing Dialog text and URL


    In-App Purchases



    Within some apps, you can buy additional content or services. These kinds of purchases are called "in-app purchases". They can be an attractive source of revenue for developers and are very convenient for customers as they use existing accounts and payment sources for settlement. WebViewGold allows triggering App Store In-App Purchases. Make sure to own an extended license of WebViewGold if you plan to use this feature in an end product. In the first step, enter your In-App Purchase Bundle ID in IPAViewController.swift and IPAHelper.swift files:
    Enable In App-Purchases in your application

    Enter In-App Purchases details
    Afterward, just insert the App Store Connect details of your In-App Purchase Product in Constant.swift file:

    App Store Connect ID for your In App-Purchase

    Afterward, just link to this kind of URL:
    <a href="inapppurchase://">Buy In-App Purchase</a>


    Rename package name / build & publish your app

    To build your app, click on Run:

    Build and run your iOS app

    Do you want to publish your app in the Apple App Store?
    Use your Apple Developer Program Subscription to publish your app in the App Store. Before uploading, please change the package name:





    Afterward, please add customized texts to the permission details in terms of location, photo/camera access and all other API details. You find the details in Info.plist file:


    Activate or deactivate iOS permissions in Info.plist file

    Great, you are ready for the App Store submission of your web app. App Store approval works in most cases without any problems but highly depends on the content you provide in your app as WebViewGold does not provide content by itself. Please make sure to submit an app using a website/web app that behaves like a mobile app (for example, by using responsive design). Make sure that the content does not contradict the legal requirements of the Apple Developer Program. Use different link colors than standard HTML colors for better user experience.

    Tutorial: How to Submit Your App to the App Store

    If Apple rejects your app, please use Apple Resolution Center to explain the app feature in general (like "Our app enables our existing users to login in/use our products on their handheld device/....). If Apple still rejects your app, we can offer you a full refund of the WebViewGold license (by claiming within 14 days after purchase). Just contact us by mail.

    Congrats to your App Store app! :)


    Credits / License / Upgrade to Extended License

    Please don't forget to add your envato/CodeCanyon Purchase Code in the purchasecode field for each app published by you. One license per each customized end product is required.

    You will need an envato/CodeCanyon extended license if any of these cases apply:


    If you already bought a regular license, you can upgrade the existing license here.

    All rights (e.g. of images) belong to their respective owners. The provider of this source code is OnlineAppCreator.com c/o jocapps GmbH - registered in Germany - and is not affiliated with Apple. IOS is a registered trademark of Cisco and used under license by Apple Inc. iPad, iPhone, iPod, Xcode, and Xcode logo are registered trademarks of Apple Inc.

    One license per each customized end product is required. Please take a look for license info of your CodeCanyon purchase: https://codecanyon.net/licenses/standard



    Rate this project

    If you have 10 seconds, please rate this project (it is a great motivation for future updates ^^):

    1. Go to CodeCanyon.net and sign in
    2. Navigate to https://www.codecanyon.net/downloads
    3. Click the stars, as shown in this picture:

    Rate our project

    Thank you very much!



    Get WebViewGold for Android

    Get WebViewGold for Android

    Take a look here.


    Get WebViewGold for macOS

    Get WebViewGold for macOS

    Take a look here.


    Get photos2webgallery for macOS

    Get photos2webgallery for macOS

    Take a look here.


    Support


    OnlineAppCreator
    Designed and coded with lots of love and coffee in Germany. Made for everyone and made with 100% renewable energy. #MakeLoveNotWar

    © 2019 OnlineAppCreator.com [Privacy Policy | Legal Disclosure]
    exclusive distribution by CodeCanyon.net