-
Notifications
You must be signed in to change notification settings - Fork 1
Rework Optable API configuration and request forming #35
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
base: master
Are you sure you want to change the base?
Conversation
Remove `app` path parameter. Add `tenant` and `originSlug` parameters. Make host dynamic and apply path `v2`. Move all configuration parameters in Config class and reuse it everywhere. Separate `GoogleAdIdManager` and `LocalStorage` logic from the network client. Rename `Client` to `NetworkClient`. Move hash logic to separate `TypeHasher` class. Separate network interceptors. Refactor SDK code.
Support secret api keys. Fetch user agent only once. Write unit tests with the mock web server.
android_sdk/src/main/java/co/optable/android_sdk/core/UserAgentHolder.kt
Show resolved
Hide resolved
Remove custom network Adapter. Use native Retrofit adapter. Add Kotlin suspension.
Migrate from TypeHasher to IdentifiersEncoder. Add all identifier types. Cover with unit tests.
Use callbacks API. Rewrite demo apps to make the examples more readable. Use shorter logs. Create Optable SDK instance once during application creation and reuse everywhere. Move fragments to one folder.
Add missed "reg" query param. Make Consents mutable. Provide `receiveGaidAutomatically` property. Refactor main methods javadoc.
DemoApp/DemoAppJava/app/src/main/java/co/optable/demoappjava/TheApplication.java
Outdated
Show resolved
Hide resolved
DemoApp/DemoAppJava/app/src/main/java/co/optable/demoappjava/ui/GamBannerFragment.java
Show resolved
Hide resolved
| private void applyOptableToGam(AdManagerAdRequest.Builder builder, @Nullable OptableTargeting targeting) { | ||
| if (targeting == null) return; | ||
|
|
||
| Map<String, List<String>> audiences = targeting.getAudiences(); |
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 (incorrect) code of generating a GAM kv pair is repeated - perhaps it should become part of the Optable SDK library gamTargeting() function?
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.
After renaming audiences to gamTargeting, maybe should I introduce some OptableSDK.applyGamTargeting(gamAdRequestBuilder, optableResult)?
DemoApp/DemoAppKotlin/app/src/main/java/co/optable/androidsdkdemo/ui/GamBannerFragment.kt
Show resolved
Hide resolved
| result.addIfNotNull(IPV4, ids.ipv4Address, ::removeWhitespaces) | ||
| result.addIfNotNull(IPV6, ids.ipv6Address, ::normalize) | ||
| result.addIfNotNull(IDFA, ids.appleIdfa, ::normalize) | ||
| result.addIfNotNull(GAID, ids.googleGaid, ::normalize) |
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.
do we need to normalize GAID - maybe it is worth passing it as is, as system returns it?
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.
It can be received from OptableSDK.tryIdentifyFromUrl(), so it can be uppercased or with some wrong characters. And that's how the legacy logic worked.
android_sdk/src/main/java/co/optable/android_sdk/core/IdentifiersEncoder.kt
Show resolved
Hide resolved
| * We first convert the Uri to a lowercase string then re-parse it so that we are | ||
| * not dependent on case-sensitivity of the "oeid" query parameter | ||
| */ | ||
| fun eidFromUrl(urlString: String): String? { |
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 name is a bit confusing, as eid is an extended id in OpenRTB, here we talk rather about a prefixed ID param
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.
Renamed to prefixedIdFromUrl.
Closes #33.
Breaking changes:
apppath parameter.tenantandoriginSlugquery parameters.v2.Other features:
apiKey.Configclass and reuse it everywhere.GoogleAdIdManagerandLocalStoragelogic from the network client.ClienttoNetworkClient.TypeHasherclass.