-
Notifications
You must be signed in to change notification settings - Fork 216
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
Include concrete device model in user agent (PSG-754) #1576
Conversation
@@ -649,6 +651,27 @@ - (void)setRequestParametersInJSON:(BOOL)requestParametersInJSON | |||
{ | |||
httpManager.requestSerializer = [AFHTTPRequestSerializer serializer]; | |||
} | |||
|
|||
// Overwrite user agent to include concrete device model (code copied from AlamoFire) |
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.
The code below is copied from AFHTTPRequestSerializer
. I decided to keep this in the ObjC part because this way it's an exact copy and possibly easier to maintain than a Swift port.
@@ -14,6 +14,7 @@ PODS: | |||
- AFNetworking/Serialization (4.0.1) | |||
- AFNetworking/UIKit (4.0.1): | |||
- AFNetworking/NSURLSession | |||
- DeviceKit (4.7.0) |
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.
This is the best option I found for converting Apple's device identifiers into human readable strings. It's MIT, relatively small, well-maintained and somewhat popular so I hope this is an ok choice.
c928c60
to
9695758
Compare
Codecov ReportBase: 12.49% // Head: 36.98% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## develop #1576 +/- ##
============================================
+ Coverage 12.49% 36.98% +24.48%
============================================
Files 521 522 +1
Lines 85000 85019 +19
Branches 36193 37544 +1351
============================================
+ Hits 10624 31441 +20817
+ Misses 73990 52614 -21376
- Partials 386 964 +578
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Rolling the reviewer assignment dice again because I think Andy is busy with the releases. |
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.
Changes LGTM but I'd like to check with @manuroe that should this change be at the sdk or at the app side (can be done via MXSDKOptions.additionalHTTPHeaders
)?
Good point. If possible, we would prefer this customisation only at the app level for apps that require it. |
Sounds good. Closing this in favor of element-hq/element-ios#6761. |
Fixes element-hq/element-ios#6742
Pull Request Checklist