UniWebView
UniWebView is a modern web view component for mobile Unity3D games. Integrating web content into your games was never easier.
UniWebView
UniWebView is a Unity plugin for iOS and Android, enabling web view integration with features like OAuth 2.0, JavaScript support, and cross-platform compatibility.
Guide
- Introduction: UniWebView is a Unity plugin for iOS and Android, enabling web view integration with features like OAuth 2.0, JavaScript support, and cross-platform compatibility.
- Adapting to AAR File: Upgrade to UniWebView 3.7.0+ by replacing UniWebView.jar with UniWebView.aar and updating the manifest.
- Built-in Toolbar: The deprecated built-in toolbar in UniWebView has been replaced by the Embedded Toolbar; use the migration guide to switch.
- Certificate Pinning: UniWebView 6.2 replaces the legacy SSL exception list with explicit SHA-256 certificate pinning. Pinning lets you trust self-signed or private CA certificates without disabling TLS checks globally.
- Channel Message Security
- Channel Messaging System:
<UniWebView>Error in channel message handler: get_isActiveAndEnabled can only be called from the main thread. - Debugging: Use UniWebView's debugging tools, including the logger, web log forwarding, and web page inspection on iOS, Android, and macOS.
- Downloading Files: UniWebView manages file downloads with platform-specific behaviors, offering iOS customization for URLs and MIME types, and supports download events and data/blob links.
- Embedded Toolbar: UniWebView's embedded toolbar provides a customizable navigation bar with built-in and custom buttons, title interactions, and flexible layout — all configured through a simple config object.
- FAQ: UniWebView FAQ addresses common issues and queries about usage, platform support, performance, privacy, licensing, and source code access, providing solutions and explanations for developers.
- HTTP Authentication: UniWebView supports HTTP Basic and Digest authentication, prompting users for credentials and storing them permanently, with options to clear stored credentials on iOS and Android.
- Installation: UniWebView installation involves importing the package from Unity Asset Store or UniWebView Store, configuring necessary permissions in Unity Preferences, and optionally accessing the source code via a GitHub repository.
- Loading Local Files: UniWebView supports loading local HTML files from the StreamingAssets folder or persistent data path, with specific considerations for Android builds using "Split Application Binary."
- Memory Management: To manage memory effectively with UniWebView, destroy unused web views promptly, reset references when closed, and clear caches when not needed.
- URL Messaging System: This traditional messaging system enables one-way communication from web views to Unity using custom URL schemes, with a safe data transfer limit of about 16KB per message.
- Migration Guide (v4 to v5): To migrate from UniWebView 4 to 5, remove old files, install the new version, replace deprecated methods, and explore new features like the embedded toolbar and OAuth 2.0 support.
- Migration Guide (v5 to v6): To migrate from UniWebView 5 to 6, remove old files, install the new version, and explore the new Channel Messaging System for enhanced bidirectional communication.
- Migration Guide (v3 to v4): To migrate from UniWebView 3 to 4, remove old files, install the new version, replace deprecated methods like SetImmersiveModeEnabled and OnKeyCodeReceived, and consider using new features like Safe Browsing Mode.
- OAuth 2.0 with GitHub: Use UniWebView to implement GitHub OAuth 2.0 authentication by setting up the component, handling callbacks, and managing token storage and refresh.
- OAuth 2.0 with Google: Use UniWebView to implement Google OAuth 2.0 authentication by setting up the component, handling callbacks, and managing token storage.
- OAuth 2.0 General: UniWebView supports OAuth 2.0 for multiple providers, offering customizable flows and secure authentication methods.
- Overview: UniWebView offers two options for displaying web content: a customizable general-purpose web view and a simple, secure full-screen safe browsing mode.
- Playing Videos: UniWebView supports HTML5 video playback with options for auto play and inline play, but does not support Flash-based videos.
- Position and Size: UniWebView allows setting web view position and size either directly with a frame or by referencing a UI element's RectTransform for adaptive layouts.
- Privacy Policy: UniWebView prioritizes privacy, collecting minimal data, using it only for order processing, and ensuring secure transmission with encryption.
- Render as Texture: UniWebView allows rendering web content as a non-interactive texture in Unity, suitable for 3D integration but with performance and feature limitations.
- Rotation and Scale: UniWebView supports transforming web views with rotation and scaling, enhancing display flexibility in Unity games.
- Safe Browsing Mode: UniWebView's Safe Browsing Mode offers a full-screen, browser-like web experience with customizable UI and requires device support checks.
- Supporting New Window: UniWebView supports new windows in web views through configuration, allowing links and JavaScript to open new tabs or windows.
- Submit a Ticket: Use the AI-driven chat bot for quick help or submit a private ticket for direct support if needed.
- Term of Service (Terms): UniWebView's Terms of Service, aligned with Unity Asset Store'sToS, govern use, content ownership, and allow for service modifications and termination.
- Transition: UniWebView offers customizable show/hide transitions and position/size animations for web views.
- Clicking Through: UniWebView enables clicking through transparent web pages to interact with Unity scenes behind.
- Trouble Shooting: UniWebView build errors and runtime crashes can be resolved by adjusting settings in Unity Preferences and performing a clean build.
- Uploading: UniWebView supports file uploads from device or cloud, with specific iOS setup required for camera access.
- Using JavaScript: UniWebView allows adding and executing JavaScript functions on web pages, with options to disable JavaScript for performance or security.
- Web View - Prefab: UniWebView prefab simplifies adding a web view to Unity scenes, with options for URL loading and toolbar customization.
- Version Highlight: UniWebView 6 introduces the Channel Messaging System for high-performance bidirectional communication, enhanced error handling, and improved messaging reliability between web pages and Unity.
- WebRTC Support: UniWebView supports WebRTC on iOS 14.3+ and Android, requiring specific configurations for safe browsing or regular web view use.
- Web View - Code: Learn to create and interact with UniWebView in Unity, including loading pages, handling events, and using JavaScript for web view communication.
API Reference
- IUniWebViewAuthenticationFlow
- UniWebViewAuthenticationCommonFlow
- UniWebViewAuthenticationFlowCustomize
- UniWebViewAuthenticationFlowDiscord
- UniWebViewAuthenticationFlowFacebook
- UniWebViewAuthenticationFlowGitHub
- UniWebViewAuthenticationFlowGoogle
- UniWebViewAuthenticationFlowLine
- UniWebViewAuthenticationFlowTwitter
- UniWebViewAuthenticationSession
- UniWebViewAuthenticationStandardToken
- UniWebViewAuthenticationUtils
- UniWebViewBackForwardItem
- UniWebViewBackForwardList
- UniWebViewCacheMode
- UniWebViewChannelMethodEmbeddedToolbarItemAction
- UniWebViewChannelMethodHandleRequest
- UniWebViewChannelMethodMediaCapturePermission
- UniWebViewEmbeddedToolbar
- UniWebViewEmbeddedToolbarConfig
- UniWebViewMediaCapturePermissionDecision
- UniWebViewPopup
- UniWebViewSafeBrowsingEventMetadata
- UniWebViewShadow
- UniWebViewTransform
- UniWebView
- UniWebViewChannelMessage
- UniWebViewChannelMessageResponse
- UniWebViewChannelMessageType
- UniWebViewContentInsetAdjustmentBehavior
- UniWebViewDownloadMatchingType
- UniWebViewHelper
- UniWebViewLogger
- UniWebViewMessage
- UniWebViewNativeListener
- UniWebViewNativeResultPayload
- UniWebViewSafeBrowsing
- UniWebViewToolbarPosition
- UniWebViewTransitionEdge
Meet the modern standard for public facing documentation. Beautiful out of the box, easy to maintain, and optimized for user engagement.
Search through billions of items for similar matches to any object, in milliseconds. It’s the next generation of search, an API call away.
Build and deploy reliable background jobs with no timeouts and no infrastructure to manage.
Get the simple developer experience of SQLite in production, and scale your multi-tenant backend with unlimited databases.
Upstash is a serverless data platform providing low latency and high scalability for real-time applications.
One-click deployments built for teams, tuned for Laravel, loaded with tools and goodies you're going to love.