-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add support for setting a custom User-Agent #6270
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great. Looking at the example provided it seems that all the relevent info is there, e.g.
- which platform (Android and version)
- which sync version, and binding.
Appreciated.
# Conflicts: # CHANGELOG.md # realm/realm-library/src/syncIntegrationTest/java/io/realm/objectserver/EncryptedSynchronizedRealmTests.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have one concern regarding appDefinedUserAgent
it should be optional as explained in the feedback
realm/realm-library/src/objectServer/java/io/realm/ObjectServer.java
Outdated
Show resolved
Hide resolved
realm/realm-library/src/objectServer/java/io/realm/SyncManager.java
Outdated
Show resolved
Hide resolved
# Conflicts: # realm/realm-library/src/main/cpp/io_realm_SyncManager.cpp
Closes #6267
This PR adds an optional parameter when calling
Realm.init()
. This will set the user part of the User-Agent string.I'm using
Realm.init()
as people are only calling this once and we also initialize the SyncManager as part of calling it. The extra constructor is only visible when using a build supporting the Object Server.The String constructed by RealmJava will look like this for e.g. OnePlus:
The server will output something like this:
Specifically, we are sending
RealmJava
.Build.PRODUCT sees to contain the same information as DEVICE/MODEL so doesn't look relevant.
@roberhofer Is this sufficient?