-
Notifications
You must be signed in to change notification settings - Fork 4
Feature/v2 sdk updates #51
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?
Feature/v2 sdk updates #51
Conversation
…ableSDK interface with async/await support
|
@vladislav-yermakov could you please check the comments above ^ and also write a short description for this PR, like a summary of changes to the APIs. roughly there are 4 categories of changes:
|
|
Here is how audience object is converted into GAM key-value pairs: function TargetingKeyValues(tdata: TargetingResponse | null): TargetingKeyValues {
const result: TargetingKeyValues = {};
if (!tdata) {
return result;
}
for (const identifiers of tdata.audience ?? []) {
if (identifiers.keyspace) {
if (!(identifiers.keyspace in result)) {
result[identifiers.keyspace] = [];
}
result[identifiers.keyspace].push(...identifiers.ids.map((el) => el.id));
}
}
return result;
}audience is an array of objects: "audience": [
{
"provider": "optable.co",
"ids": [
{
"id": "15f30409"
}
],
"keyspace": "optable",
"rtb_segtax": 5001
}
],each of these objects becomes a single key-value pair. |
|
Re: setting targetingData.ortb2 to Prebid - seems it is done correctly in Android: https://github.com/Optable/optable-android-sdk/pull/35/files#diff-c55c975d4a7bd768528a4687e2fbc25857690b9457d09282cb847d1532d06867R152 |
|
@justadreamer Please review recent changes. |
| // MARK: - Ad Loading | ||
| - (void)loadGADAdWithTargetingData:(NSDictionary* _Nullable)targetingData { | ||
| GAMRequest *adRequest = [GAMRequest request]; | ||
| adRequest.customTargeting = targetingData; |
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 incorrect, we need to extract and compose GAM targeting key(s) and value(s) from targetingData.audience. the key name is audience.keyspace the value is is coma separated ids. so for the below example:
"{\"audience\":[{\"provider\":\"optable.co\",\"keyspace\":\"optable-test\",\"rtb_segtax\":5001,\"ids\":[{\"id\":\"082793f9\"}]}],\"resolved_ids\":[\"v:0b5zRoKB03RnzAZJaneBN4\"],
it will be optable-test: 082793f9. but there may be more than one item under audience. so each item will have its keyspace and ids. we need a public method of the Optable SDK to produce this key values for GAM out of the targeting API response.
|
Almost there, there is an implementation flaw - where we don't properly extract keywords from |
|
Added OptableTargeting object to easily support extracting keywords and ortb2. |
This PR addresses the following issues:
Add Prebid SDK and passing optable IDs into the demo app #43
Prebid test case was merged to into this PR, the old PR can be closed.
Rework Optable Real-time APIs configuration and request forming #49
SDK was updated according to real time api integrations guide
Extend Optable Targeting API request forming with additional parameters #50
SDK Targeting API was updated to accept arbitrary IDs as defined in real time api integrations guide. Privacy parameters is controlled via
OptableConfig.Breaking changes:
OptableSDK.init(host:, app:, insecure:, useragent:)was replaced withOptableSDK.init(config:)tenantandoriginSlugparameters to initialise, instead ofhostandappOptableConfigwas introduced to contain all configuration parameters for the SDKOptableConfigsupports dynamic changes of all parameters, such ashost,path,apiKey,custopUserAgentand others.Other changes:
IABConsentfor automatically retrieving user consent according to the IAB Transparency & Consent FrameworkAppTrackingTransparencyto handle App Tracking IdentifiersOptableIdentifierType,OptableIdentifiers, andOptableIdentifierEncoderto support optable identifiers and normalisationasync/awaitSDK API for modern swift