Skip to content

Commit

Permalink
deploy: 1e034a8
Browse files Browse the repository at this point in the history
  • Loading branch information
jayohms committed Dec 18, 2024
1 parent 48bc9e6 commit 62844d0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
21 changes: 19 additions & 2 deletions android/configuration.html
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,25 @@ <h2 id="options"><a class="anchor" href="#options">﹟</a> Options</h2>
<pre class="language-kotlin"><code class="language-kotlin">Hotwire<span class="token punctuation">.</span><span class="token function">registerBridgeComponents</span><span class="token punctuation">(</span><br> <span class="token function">BridgeComponentFactory</span><span class="token punctuation">(</span><span class="token string-literal singleline"><span class="token string">"my-custom"</span></span><span class="token punctuation">,</span> <span class="token operator">::</span>MyCustomComponent<span class="token punctuation">)</span><br><span class="token punctuation">)</span></code></pre>
<p>Set the JSON converter used for bridge components:</p>
<pre class="language-kotlin"><code class="language-kotlin">Hotwire<span class="token punctuation">.</span>config<span class="token punctuation">.</span>jsonConverter <span class="token operator">=</span> <span class="token function">KotlinXJsonConverter</span><span class="token punctuation">(</span><span class="token punctuation">)</span></code></pre>
<p>Customize the user agent:</p>
<pre class="language-kotlin"><code class="language-kotlin">Hotwire<span class="token punctuation">.</span>config<span class="token punctuation">.</span>userAgent <span class="token operator">=</span> <span class="token string-literal singleline"><span class="token string">"My Application; </span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span><span class="token expression">Hotwire<span class="token punctuation">.</span>config<span class="token punctuation">.</span><span class="token function">userAgentSubstring</span><span class="token punctuation">(</span><span class="token punctuation">)</span></span><span class="token interpolation-punctuation punctuation">}</span></span><span class="token string">"</span></span></code></pre>
<p>Set a custom user agent application prefix for every <code>WebView</code> instance. The library will automatically append a substring to your prefix which includes:</p>
<ul>
<li>
<ul>
<li><code>&quot;Hotwire Native Android; Turbo Native Android;&quot;</code> - for <code>hotwire_native_app?</code> on your <a href="https://github.com/hotwired/turbo-rails/blob/1aa7ba9d38dee1e1b4078a74404131122b907176/app/controllers/turbo/native/navigation.rb#L14">Rails server</a></li>
</ul>
</li>
<li>
<ul>
<li><code>&quot;bridge-components: [your bridge components];&quot;</code></li>
</ul>
</li>
<li>
<ul>
<li>The <code>WebView</code>’s default Chromium user agent string</li>
</ul>
</li>
</ul>
<pre class="language-kotlin"><code class="language-kotlin">Hotwire<span class="token punctuation">.</span>config<span class="token punctuation">.</span>applicationUserAgentPrefix <span class="token operator">=</span> <span class="token string-literal singleline"><span class="token string">"My Application;"</span></span></code></pre>
<p><a class="button" href="/android/reference">Next: Reference</a></p></section>

<footer class="docs__footer grid__item grid__item--start-4 grid__item--span-8">
Expand Down
8 changes: 7 additions & 1 deletion ios/configuration.html
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,13 @@ <h1>Configuration</h1>
<h2 id="general"><a class="anchor" href="#general"></a> General</h2>
<ul>
<li><code>Hotwire.config.debugLoggingEnabled</code> - Enable or disable debug logging for Turbo visits and bridge elements connecting, disconnecting, receiving/sending messages, and more.</li>
<li><code>Hotwire.config.userAgent</code> - Override to set a custom user agent for your app’s requests. Make sure to include “Hotwire Native” or “Turbo Native” to use <code>turbo_native_app?</code> on your <a href="https://github.com/hotwired/turbo-rails/blob/1aa7ba9d38dee1e1b4078a74404131122b907176/app/controllers/turbo/native/navigation.rb#L14">Rails server</a>.</li>
<li><code>Hotwire.config.applicationUserAgentPrefix</code> - Set a custom user agent application prefix for every <code>WKWebView</code> instance. The library will automatically append a substring to your prefix which includes:
<ul>
<li><code>&quot;Hotwire Native iOS; Turbo Native iOS;&quot;</code> - for <code>hotwire_native_app?</code> on your <a href="https://github.com/hotwired/turbo-rails/blob/1aa7ba9d38dee1e1b4078a74404131122b907176/app/controllers/turbo/native/navigation.rb#L14">Rails server</a></li>
<li><code>&quot;bridge-components: [your bridge components];&quot;</code></li>
<li><code>WKWebView</code>’s default user agent string (at the beginning of the user agent)</li>
</ul>
</li>
<li><code>Hotwire.config.showDoneButtonOnModals</code> - When enabled, adds a <code>UIBarButtonItem</code> of type <code>.done</code> to the left navigation bar button item on screens presented modally.</li>
<li><code>Hotwire.config.backButtonDisplayMode</code> - Sets the back button display mode of <code>HotwireWebViewController</code>.</li>
</ul>
Expand Down

0 comments on commit 62844d0

Please sign in to comment.