WebView Integration for iOS
A WebView is a component used in mobile applications that allows apps to display web content directly inside the app without redirecting users to an external web browser. It acts like a mini browser window embedded within the app, allowing seamless integration of web pages, web-based UI components, or remote content.
What Content Gets Collected and Translated
The WOVN SDK can gather and translate WebView content through the enable_web_view_translation
setting. This feature is enabled (YES
) by default but can be disabled (NO
) in the property file.
All content that is normally collected by WOVN will also be captured through WebView. This content will be reported as web content and can be found amongst the Pages rather than as a screen under App in the WOVN dashboard.
Two scenarios for WebView content:
-
Web content already served by WOVN.io:
- The content will be translated through the app as well
- The language will be determined by the one set in the SDK
- The web content will still be translated even if
enable_web_view_translation
is disabled, as it works independently from the app SDK
-
Web content not yet translated by WOVN:
- The SDK will inject the project token into the WebView
- This allows it to collect and translate the web content
- The web content won't be translated if
enable_web_view_translation
is disabled
Prerequisites
To get WebView content translated, follow these steps:
-
Add the domain hosting the WebView content as an allowed domain:
- Log into WOVN.io and go to the desired project
- Navigate to Settings → General → Domains
- Click the +Domain button to add the URL
-
Enable automatic reporting and translation settings:
- Ensure End User Reporting is enabled
- Enable Auto Page Add and Auto Publish/Translate
- These settings can be found under Settings → General → Advanced
How to Enable/Disable WebView Translation
Before proceeding with these steps, ensure Xcode is installed
- Open the app project in Xcode
- Locate the property file named
WOVNswift.plist
- Set the
enable_web_view_translation
value to:YES
to enable WebView translationNO
to disable it
- Rebuild the app to ensure the new configuration is loaded