Skip to main content

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.

URL Parameters

All configuration options are passed as URL query parameters. Parameters should be properly URL-encoded, especially for special characters.

Required Parameters

string
required
Your Hum API key for authentication.Example: apiKey=your_api_key_here

Display & Layout Parameters

string
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
Default: checkoutExample: resultLayout=summary
string
Customizes 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
boolean
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 humPlanSaved and humPlanUnsaved events
  • Allows users to bookmark plans for future reference
boolean
Controls whether the widget renders its own address entry form above the results.Accepted Values: true or falseDefault: falseExample: showAddressCompletionForm=trueWhen enabled:
  • An address field with autocomplete appears above the results
  • Selecting a suggestion starts a new session and reloads results for that address
  • The visitor can look up a different address without the host app reloading the WebView
Leave this off when your app already passes the address through the URL parameters below. Turn it on when you want the visitor to be able to enter or change the address inside the WebView.

Address Parameters

Pre-populate the address to show results immediately when the WebView loads.
string
Primary street address (street number and name).Example: street1=123%20Main%20St
When providing an address, street1 and zip are required. city and state are optional but recommended for improved address match quality.
string
Secondary address information (apartment, suite, unit number).Example: street2=Apt%20205
string
City name.Example: city=Detroit
string
Two-letter state code.Example: state=MI
string
ZIP code (5 or 9 digits).Example: zip=48226
string
Alternative to individual address fields - provide the complete address as a single string.Example: s=123%20Main%20St%20Apt%204B%2C%20Detroit%2C%20MI%2048226
Unit or apartment designators included in the single address string are parsed into street2 automatically.
When using the s parameter, do not include street1, city, state, or zip parameters. Use either s OR the individual fields, not both.
number
Latitude coordinate for the address (improves performance).Example: latitude=42.3317
Both latitude and longitude must be provided together.
number
Longitude coordinate for the address (improves performance).Example: longitude=-83.0479

Tracking & Analytics Parameters

string
Identifier for tracking attribution and analytics. Use this to associate sessions with marketing campaigns, traffic sources, or user segments.Example: campaignId=mobile-app-Q4-2024

Customer Data Parameters

Pre-populate customer information to streamline the checkout process.
string
Customer’s first name.Example: firstName=Jane
string
Customer’s last name.Example: lastName=Smith
string
Customer’s email address (must be URL-encoded).Example: email=jane.smith%40example.com
string
Customer’s phone number.Example: phoneNumber=555-123-4567

Filtering Parameters

string
Comma-separated list of FCC provider IDs to restrict results to specific providers.Example: limitProviders=130077,130317
Use Get FCC Service Providers to retrieve provider IDs programmatically.
string
Comma-separated list of FCC provider IDs to feature prominently at the top of results.Example: primaryProviders=130077,130317
string
Comma-separated list of technology types to filter results.Accepted Values: Fiber, Cable, Wireless, Satellite, DSL, OtherExample: limitTechnologies=Fiber,Cable

Complete 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:
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

The Hum widget requires JavaScript and DOM storage to function properly. Ensure these are enabled in your WebView configuration.
Consider restricting navigation to keep users within the Hum experience or handle external links appropriately.
Handle WebView errors gracefully to improve user experience.
If your app already has user information or location data, pass it as URL parameters to reduce friction and improve conversion rates.

Troubleshooting

Possible causes:
  • JavaScript is disabled in WebView settings
  • DOM storage is disabled
  • Network connectivity issues
  • Invalid API key
Solutions:
  • Verify JavaScript is enabled
  • Enable DOM storage
  • Check network connection
  • Validate your API key with Hum support
Possible causes:
  • Missing required address fields
  • Incorrect URL encoding
  • Using both s parameter and individual fields
Solutions:
  • Ensure the required fields (street1 and zip) are present
  • Include city and state when available to improve address match quality
  • Use proper URL encoding functions
  • Use either s OR individual fields, not both
Possible causes:
  • Hex color not URL-encoded
  • Invalid hex color format
Solutions:
  • Use %23 for the # symbol: primaryColor=%23FF5733
  • Or omit the # entirely: primaryColor=FF5733
  • Verify the hex color is valid

Next Steps

Widget Hook Notifications

Learn how to listen for and handle events from the Hum widget

JavaScript Widget Integration

Explore the full JavaScript widget integration for web applications

API Integration

Build custom integrations using the Hum API

Get Support

Contact our team for integration assistance