You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support useragent override in the constructor (#26)
When initializing the `OptableSDK` constructor, it's now possible to
override the otherwise internally assigned user-agent string, with one
specified by the caller. The caller-specified useragent is of course
optional and, if one is not assigned (or nil is passed as the useragent
at initialization time) then the default is to continue to create an
invisible WebView and extract the user-agent string from it. If a caller
specifies a non-nil useragent string, then we use it instead.
Closes#23
Documented in README
However, since production sandboxes only listen to TLS traffic, the above is really only useful for developers of `optable-sandbox` running the sandbox locally for testing.
93
93
94
+
By default, the SDK detects the application user agent by sniffing `navigator.userAgent` from a `WKWebView`. The resulting user agent string is sent to your sandbox for analytics purposes. To disable this behavior, you can provide an optional fourth string parameter, `useragent`, which allows you to set whatever user agent string you would like to send instead. For example:
The default value of `nil` for the `useragent` parameter enables the `WKWebView` auto-detection behavior.
101
+
94
102
### Identify API
95
103
96
104
To associate a user device with an authenticated identifier such as an Email address, or with other known IDs such as the Apple ID for Advertising (IDFA), or even your own vendor or app level `PPID`, you can call the `identify` API as follows:
You can call various SDK APIs on the instance as shown in the examples below. It's also possible to configure multiple instances of `OptableSDK` in order to connect to other (e.g., partner) sandboxes and/or reference other configured application slug IDs. Note that the `insecure` flag should always be set to `NO` unless you are testing a local instance of the `optable-sandbox` yourself.
324
333
334
+
You can disable user agent `WKWebView` based auto-detection and provide your own value by setting the `useragent` parameter to a string value, similar to the Swift example.
335
+
325
336
### Identify API
326
337
327
338
To associate a user device with an authenticated identifier such as an Email address, or with other known IDs such as the Apple ID for Advertising (IDFA), or even your own vendor or app level `PPID`, you can call the `identify` API as follows:
0 commit comments