Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate Hotwire.config.userAgent from Hotwire.config.userAgentWithWebViewDefault #94

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

jayohms
Copy link
Contributor

@jayohms jayohms commented Jan 28, 2025

This helps align the API available in the iOS library here: hotwired/hotwire-native-ios#75

There are now two readable strings that applications can use:

  • Hotwire.config.userAgent
  • Hotwire.config.userAgentWithWebViewDefault(context)

Since the WebView's default user agent string API is different (and accessible) on Android, it is also provided for an application to read/use.

…thWebViewDefault, so either can be used by an application, depending on the need
Copy link
Contributor

@jpsphaxer jpsphaxer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @jayohms for this!

*/
fun userAgent(context: Context): String {
val userAgent: String get() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just for parity with iOS - should we rename this property as userAgentComponent ?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jpsphaxer We've decided to use userAgent instead of userAgentComponent. I've updated the iOS PR accordingly.

@jayohms jayohms merged commit 7dccb2a into main Jan 29, 2025
1 check passed
@jayohms jayohms deleted the user-agent-separation branch January 29, 2025 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants