diff --git a/_source/android/05_configuration.md b/_source/android/05_configuration.md index 26eac5a..df8a83e 100644 --- a/_source/android/05_configuration.md +++ b/_source/android/05_configuration.md @@ -68,8 +68,11 @@ Set the JSON converter used for bridge components: Hotwire.config.jsonConverter = KotlinXJsonConverter() ``` -Customize the user agent: +Set a custom user agent application prefix for every `WebView` instance. The library will automatically append a substring to your prefix which includes: +* - `"Hotwire Native Android; Turbo Native Android;"` - for `hotwire_native_app?` on your [Rails server](https://github.com/hotwired/turbo-rails/blob/1aa7ba9d38dee1e1b4078a74404131122b907176/app/controllers/turbo/native/navigation.rb#L14) +* - `"bridge-components: [your bridge components];"` +* - The `WebView`'s default Chromium user agent string ```kotlin -Hotwire.config.userAgent = "My Application; ${Hotwire.config.userAgentSubstring()}" +Hotwire.config.applicationUserAgentPrefix = "My Application;" ``` diff --git a/_source/ios/05_configuration.md b/_source/ios/05_configuration.md index 75d53f9..1f04621 100644 --- a/_source/ios/05_configuration.md +++ b/_source/ios/05_configuration.md @@ -12,7 +12,10 @@ Hotwire Native provides a few options to customize your iOS app. We recommend ma ## General * `Hotwire.config.debugLoggingEnabled` - Enable or disable debug logging for Turbo visits and bridge elements connecting, disconnecting, receiving/sending messages, and more. -* `Hotwire.config.userAgent` - Override to set a custom user agent for your app's requests. Make sure to include "Hotwire Native" or "Turbo Native" to use `turbo_native_app?` on your [Rails server](https://github.com/hotwired/turbo-rails/blob/1aa7ba9d38dee1e1b4078a74404131122b907176/app/controllers/turbo/native/navigation.rb#L14). +* `Hotwire.config.applicationUserAgentPrefix` - Set a custom user agent application prefix for every `WKWebView` instance. The library will automatically append a substring to your prefix which includes: + * `"Hotwire Native iOS; Turbo Native iOS;"` - for `hotwire_native_app?` on your [Rails server](https://github.com/hotwired/turbo-rails/blob/1aa7ba9d38dee1e1b4078a74404131122b907176/app/controllers/turbo/native/navigation.rb#L14) + * `"bridge-components: [your bridge components];"` + * `WKWebView`'s default user agent string (at the beginning of the user agent) * `Hotwire.config.showDoneButtonOnModals` - When enabled, adds a `UIBarButtonItem` of type `.done` to the left navigation bar button item on screens presented modally. * `Hotwire.config.backButtonDisplayMode` - Sets the back button display mode of `HotwireWebViewController`.