WebView Integration
The Hum WebView integration provides a simplified way to embed the Hum widget experience into native mobile applications (iOS and Android) or any environment that supports WebViews. Instead of embedding JavaScript code, you simply load a URL with configuration parameters.This integration method is ideal for mobile apps built with native frameworks (Swift, Kotlin) or hybrid frameworks (React Native, Flutter) that need a quick, no-code integration path.
Base URL
All WebView integrations use the following base URL:Quick Start
The simplest WebView integration requires only your API key:1
Obtain Your API Key
Contact your Hum representative to receive your API key if you haven’t already.
2
Construct Your WebView URL
Build your URL by appending configuration parameters as query strings to the base URL.
3
Load URL in WebView
Load the constructed URL in your application’s WebView component.
- iOS (Swift)
- Android (Kotlin)
- React Native
- Flutter
URL Parameters
All configuration options are passed as URL query parameters. Parameters should be properly URL-encoded, especially for special characters.Required Parameters
Your Hum API key for authentication.Example: 
apiKey=your_api_key_hereDisplay & Layout Parameters
Controls the visual presentation of internet service results.Accepted Values:
- summary- Compact table format with affiliate links
- checkout- Full e-commerce shopping cart experience (default)
- plans- Card layout with affiliate links
checkoutExample: resultLayout=summaryCustomizes the primary color for buttons and UI elements. Must be a URL-encoded hex color code.Format: Hex color without the 
# symbol, or URL-encoded with %23Default: 1274f9 (Hum blue)Examples:- primaryColor=1274f9
- primaryColor=%23FF5733
Controls whether users can save and unsave internet plans for later comparison.Accepted Values: 
true or falseDefault: falseExample: showSavePlanButton=trueWhen enabled:- Save/unsave button appears on plan cards
- Triggers humPlanSavedandhumPlanUnsavedevents
- Allows users to bookmark plans for future reference
Address Parameters
Pre-populate the address to show results immediately when the WebView loads.Primary street address (street number and name).Example: 
street1=123%20Main%20StWhen providing an address, all four core address fields (
street1, city, state, zip) are required.Secondary address information (apartment, suite, unit number).Example: 
street2=Apt%20205City name.Example: 
city=DetroitTwo-letter state code.Example: 
state=MIZIP code (5 or 9 digits).Example: 
zip=48226Alternative to individual address fields - provide the complete address as a single string.Example: 
s=123%20Main%20St%2C%20Detroit%2C%20MI%2048226When using the 
s parameter, do not include street1, city, state, or zip parameters. Use either s OR the individual fields, not both.Latitude coordinate for the address (improves performance).Example: 
latitude=42.3317Both 
latitude and longitude must be provided together.Longitude coordinate for the address (improves performance).Example: 
longitude=-83.0479Tracking & Analytics Parameters
Identifier for tracking attribution and analytics. Use this to associate sessions with marketing campaigns, traffic sources, or user segments.Example: 
campaignId=mobile-app-Q4-2024Customer Data Parameters
Pre-populate customer information to streamline the checkout process.Customer’s first name.Example: 
firstName=JaneCustomer’s last name.Example: 
lastName=SmithCustomer’s email address (must be URL-encoded).Example: 
email=jane.smith%40example.comCustomer’s phone number.Example: 
phoneNumber=555-123-4567Filtering Parameters
Comma-separated list of FCC provider IDs to restrict results to specific providers.Example: 
limitProviders=130077,130317Use the Provider ID Lookup endpoint to retrieve provider IDs programmatically.
Comma-separated list of FCC provider IDs to feature prominently at the top of results.Example: 
primaryProviders=130077,130317Comma-separated list of technology types to filter results.Accepted Values: 
Fiber, Cable, Wireless, Satellite, DSL, OtherExample: limitTechnologies=Fiber,CableComplete URL Examples
Example 1: Basic Integration
Minimal configuration with just the API key:Example 2: With Pre-populated Address
Show results for a specific address immediately:Example 3: Full Address String
Using the single address parameter:Example 4: Customized Layout and Branding
Change the layout and primary color:Example 5: Pre-populated Customer Data
Streamline checkout with known customer information:Example 6: Filtered Providers and Technologies
Show only fiber and cable from specific providers:Example 7: Complete Configuration
All parameters combined:URL Encoding Reference
When constructing URLs, ensure special characters are properly encoded:| Character | Encoded Value | Example | 
|---|---|---|
| Space | %20 | Main St→Main%20St | 
| # | %23 | #FF5733→%23FF5733 | 
| @ | %40 | user@example.com→user%40example.com | 
| & | %26 | AT&T→AT%26T | 
| , | %2C | MI, 48226→MI%2C%2048226 | 
Most programming languages provide built-in URL encoding functions. Use these instead of manually encoding characters to avoid errors.
Platform-Specific Implementation
iOS Implementation
1
Configure WKWebView
2
Build and Load URL
URLComponents automatically handles URL encoding for you.Android Implementation
1
Setup WebView in Layout
res/layout/activity_main.xml
2
Configure and Load WebView
React Native Implementation
Listening to Widget Events
The WebView integration supports the same hook notifications as the standard widget integration. See the Widget Hook Notifications page for detailed information on handling order completion, plan save, and plan unsave events.Configure your WebView to handle postMessage events to receive notifications from the Hum widget.
Best Practices
Enable JavaScript and DOM Storage
Enable JavaScript and DOM Storage
The Hum widget requires JavaScript and DOM storage to function properly. Ensure these are enabled in your WebView configuration.
Handle Navigation Events
Handle Navigation Events
Implement Error Handling
Implement Error Handling
Handle WebView errors gracefully to improve user experience.
Pre-populate Data When Available
Pre-populate Data When Available
If your app already has user information or location data, pass it as URL parameters to reduce friction and improve conversion rates.
Troubleshooting
Widget doesn't load or appears blank
Widget doesn't load or appears blank
Possible causes:
- JavaScript is disabled in WebView settings
- DOM storage is disabled
- Network connectivity issues
- Invalid API key
- Verify JavaScript is enabled
- Enable DOM storage
- Check network connection
- Validate your API key with Hum support
Address parameters not working
Address parameters not working
Possible causes:
- Missing required address fields
- Incorrect URL encoding
- Using both sparameter and individual fields
- Ensure all four required fields are present: street1,city,state,zip
- Use proper URL encoding functions
- Use either sOR individual fields, not both
Custom colors not applying
Custom colors not applying
Possible causes:
- Hex color not URL-encoded
- Invalid hex color format
- Use %23for the#symbol:primaryColor=%23FF5733
- Or omit the #entirely:primaryColor=FF5733
- Verify the hex color is valid
