Conversation
|
Ha I was actually planning on doing something similar today. You can use the pre-flight delegate's However I'd like to make these variables so that people can pass in their own values here - this could be helpful for people who want to specifically identify a beta client or A/B test variant or whatever else in a way that can't really be identified through the bundle identifier alone. Would you mind if I took a stab at it on my end? |
|
Yeah saw the delegate, but since I need it on all GQL request anyway I just set it on the session config. Feel free to stab away at it if you got a plan, I certainly don’t :) |
|
🔪away shortly! |
| bundleValue(forKey: String(kCFBundleVersionKey)) ?? "" | ||
| return [ | ||
| "apollographql-client-name": identifier, | ||
| "apollographql-client-version": version, |
There was a problem hiding this comment.
Is this suppose to be apollo-ios and 0.18.0 or com.example.app and <app-version>?
There was a problem hiding this comment.
It should probably be com.example.app and <app-version> to distinguish between different apps hitting the same graph - that's what I went with in #858
|
Closing in favour of #858 |
If you're using Apollo Engine, there's an option to identify clients and their versions.
To be perfectly frank I'm not quite sure how such an API should actually look in the iOS SDK, since the URLSession is passed in and there's really no existing API (?) for mutating the request outside of that. So not quite sure where this belongs, if at all, or how the API should look. So here's a getter with the headers and some default values that users can merge into their url session or whatever.
is this even worth doing? 🤷♂ 😄