@@ -159,58 +159,49 @@ Sensitive data as email and phone number encrypted using SHA256.
159159#### Kotlin
160160
161161``` kotlin
162- val ids = OptableIdentifiers (
163- email = " john.doe+test@example.com" ,
164- phoneNumber = " +1(555)1234567" ,
165- postalCode = " 12345" ,
166- ipv4Address = " 192.168.0.1" ,
167- ipv6Address = " 2001:db8::1" ,
168- appleIdfa = " a1b2c3d4-e5f6-7890-abcd-ef0123456789" ,
169- googleGaid = " 38400000-8cf0-11bd-b23e-10b96e40000d" ,
170- rokuRida = " roku-rida-123" ,
171- samsungTifa = " tifaabc" ,
172- amazonFireAfai = " afaixyz" ,
173- netId = " netid123" ,
174- id5 = " id5token" ,
175- utiq = " utiqvalue" ,
176- custom = mapOf (
177- " v" to " vidvalue" ,
178- " c1" to " custom one"
179- ),
180- raw = listOf (" raw:alreadyEncoded" , " ultra:someRawValue" )
162+ val ids = listOf (
163+ OptableIdentifier .Email (" john.doe+test@example.com" ),
164+ OptableIdentifier .PhoneNumber (" +1(555)1234567" ),
165+ OptableIdentifier .PostalCode (" 12345" ),
166+ OptableIdentifier .IPv4 (" 192.168.0.1" ),
167+ OptableIdentifier .IPv6 (" 2001:db8::1" ),
168+ OptableIdentifier .AppleIdfa (" a1b2c3d4-e5f6-7890-abcd-ef0123456789" ),
169+ OptableIdentifier .GoogleGaid (" 38400000-8cf0-11bd-b23e-10b96e40000d" ),
170+ OptableIdentifier .RokuRida (" roku-rida-123" ),
171+ OptableIdentifier .SamsungTifa (" tifaabc" ),
172+ OptableIdentifier .AmazonFireAfai (" afaixyz" ),
173+ OptableIdentifier .NetId (" netid123" ),
174+ OptableIdentifier .ID5 (" id5token" ),
175+ OptableIdentifier .Utiq (" utiqvalue" ),
176+ OptableIdentifier .Custom (" v" , " vidvalue" ),
177+ OptableIdentifier .Custom (" c1" , " custom one" ),
178+ OptableIdentifier .Raw (" raw:alreadyEncoded" ),
179+ OptableIdentifier .Raw (" ultra:someRawValue" )
181180)
182181```
183182
184183#### Java
185184
186- You can use the Builder pattern for Java implementation.
187-
188185``` java
189- OptableIdentifiers ids = new OptableIdentifiers .Builder ()
190- .email(" john.doe+test@example.com" )
191- .phoneNumber(" +1(555)1234567" )
192- .postalCode(" 12345" )
193- .ipv4Address(" 192.168.0.1" )
194- .ipv6Address(" 2001:db8::1" )
195- .appleIdfa(" a1b2c3d4-e5f6-7890-abcd-ef0123456789" )
196- .googleGaid(" 38400000-8cf0-11bd-b23e-10b96e40000d" )
197- .rokuRida(" roku-rida-123" )
198- .samsungTifa(" tifaabc" )
199- .amazonFireAfai(" afaixyz" )
200- .netId(" netid123" )
201- .id5(" id5token" )
202- .utiq(" utiqvalue" )
203- .custom(Map . of(" v" , " vidvalue" , " c1" , " custom one" ))
204- .raw(List . of(" raw:alreadyEncoded" , " ultra:someRawValue" ))
205- .build();
206- ```
207-
208- Additionally, you can set automatic fetching GAID if it is available. It will be ignored if ` googleGaid ` is set.
209-
210- ``` kotlin
211- val ids = OptableIdentifiers (
212- receiveGaidAutomatically = true
213- )
186+ ArrayList<OptableIdentifier > ids = Lists . newArrayList(
187+ new OptableIdentifier .Email (" john.doe+test@example.com" ),
188+ new OptableIdentifier .PhoneNumber (" +1(555)1234567" ),
189+ new OptableIdentifier .PostalCode (" 12345" ),
190+ new OptableIdentifier .IPv4 (" 192.168.0.1" ),
191+ new OptableIdentifier .IPv6 (" 2001:db8::1" ),
192+ new OptableIdentifier .AppleIdfa (" a1b2c3d4-e5f6-7890-abcd-ef0123456789" ),
193+ new OptableIdentifier .GoogleGaid (" 38400000-8cf0-11bd-b23e-10b96e40000d" ),
194+ new OptableIdentifier .RokuRida (" roku-rida-123" ),
195+ new OptableIdentifier .SamsungTifa (" tifaabc" ),
196+ new OptableIdentifier .AmazonFireAfai (" afaixyz" ),
197+ new OptableIdentifier .NetId (" netid123" ),
198+ new OptableIdentifier .ID5 (" id5token" ),
199+ new OptableIdentifier .Utiq (" utiqvalue" ),
200+ new OptableIdentifier .Custom (" v" , " vidvalue" ),
201+ new OptableIdentifier .Custom (" c1" , " custom one" ),
202+ new OptableIdentifier .Raw (" raw:alreadyEncoded" ),
203+ new OptableIdentifier .Raw (" ultra:someRawValue" )
204+ );
214205```
215206
216207### Identify API
@@ -221,9 +212,9 @@ the Google Advertising ID, or even your own vendor or app level `PPID`, you can
221212#### Kotlin
222213
223214``` kotlin
224- val ids = OptableIdentifiers (
225- email = " some.email@address .com" ,
226- raw = listOf ( " c:my-id-123 " )
215+ val ids = listOf (
216+ OptableIdentifier . Email ( " john.doe+test@example .com" ) ,
217+ OptableIdentifier . PhoneNumber ( " +1(555)1234567 " )
227218)
228219optable.identify(ids) { result ->
229220 val msg = when (result) {
@@ -237,10 +228,10 @@ optable.identify(ids) { result ->
237228#### Java
238229
239230``` java
240- OptableIdentifiers ids = new OptableIdentifiers . Builder ()
241- .email( " some.email@address .com" )
242- .raw( Lists . newArrayList( " c:my-id-123 " ) )
243- .build( );
231+ ArrayList< OptableIdentifier > ids = Lists . newArrayList(
232+ new OptableIdentifier . Email ( " john.doe+test@example .com" ),
233+ new OptableIdentifier . PhoneNumber ( " +1(555)1234567 " )
234+ );
244235optable. identify(ids, result - > {
245236 if (result instanceof OptableResult . Success ) {
246237 Log . d(TAG , " Identify success" );
@@ -258,18 +249,6 @@ the `identify()` method on your SDK instance every time you authenticate a user,
258249example once every 15 to 60 minutes while the application is being actively used and an internet connection is
259250available.
260251
261- Alternatively, you can use simplified identify:
262-
263- ``` kotlin
264- optable.identify(email, true , " ppid" ) { result ->
265- .. .
266- }
267- ```
268-
269- The second (` sendGoogleAdIDBoolean ` ) and third (` ppid ` ) arguments to ` identify() ` are optional. Since the ` gaid ` value provided to ` identify() ` is ` true ` , the SDK will fetch and send the Google
270- Advertising ID in the call to ` identify ` too, unless the user has turned on "Limit ad tracking" in their Google device
271- advertising settings.
272-
273252
274253### Profile API
275254
@@ -314,6 +293,12 @@ The specified traits are associated with the user's device and can be used for m
314293traits are of type ` HashMap<String, Any> ` , and should consist only of key-value pairs where the key is a string and the value is either a string, number, or
315294boolean.
316295
296+ Additionally you can provide ` id ` and ` neighbors ` to associate the profile with other identifiers. The ` id ` parameter takes precedence over the passport if provided.
297+
298+ ``` kotlin
299+ optable.profile(traits, " c:12" , setOf (" c:id1" , " c:id2" )) { .. . }
300+ ```
301+
317302### Targeting API
318303
319304To get the targeting key values associated by the configured DCN with the device in real-time, you can call the
@@ -322,7 +307,9 @@ To get the targeting key values associated by the configured DCN with the device
322307#### Kotlin
323308
324309``` kotlin
325- val ids = OptableIdentifiers (email = " test@test.com" )
310+ val ids = listOf (
311+ OptableIdentifier .Email (" test@test.com" ),
312+ )
326313optable.targeting(ids) { result ->
327314 val requestBuilder = AdManagerAdRequest .Builder ()
328315
@@ -344,7 +331,9 @@ optable.targeting(ids) { result ->
344331#### Java
345332
346333``` java
347- OptableIdentifiers ids = new OptableIdentifiers .Builder (). email(" test@test.com" ). build();
334+ ArrayList<OptableIdentifier > ids = Lists . newArrayList(
335+ new OptableIdentifier .Email (" test@test.com" )
336+ )
348337optable. targeting(ids, result - > {
349338 if (result instanceof OptableResult . Success<OptableTargeting > success) {
350339 Map<String , List<String > > audiences = success. getData(). getAudiences();
@@ -469,7 +458,7 @@ private fun onClickLoadAd() {
469458private fun applyOptableToGam (builder : AdManagerAdRequest .Builder , targeting : OptableTargeting ? ) {
470459 if (targeting == null ) return
471460
472- val audiences = targeting.audiences
461+ val audiences = targeting.gamTargetingKeywords
473462 if (audiences != null ) {
474463 for (entry in audiences.entries) {
475464 builder.addCustomTargeting(entry.key, entry.value)
@@ -500,7 +489,7 @@ private fun applyOptableToGam(builder: AdManagerAdRequest.Builder, targeting: Op
500489 private void applyOptableToGam(AdManagerAdRequest . Builder builder, @Nullable OptableTargeting targeting) {
501490 if (targeting == null ) return ;
502491
503- Map<String , List<String > > audiences = targeting. getAudiences ();
492+ Map<String , List<String > > audiences = targeting. getGamTargetingKeywords ();
504493 if (audiences != null ) {
505494 for (Map . Entry<String , List<String > > entry : audiences. entrySet()) {
506495 builder. addCustomTargeting(entry. getKey(), entry. getValue());
0 commit comments