AppLovin/AppLovin-MAX-React-Native

Passthrough of custom_targeting

ghostops opened this issue · 2 comments

MAX Module Version

5.5.0

React Native Version

0.71.7

Device/Platform Info

iOS/Android

Current Behavior

We wanted to implement custom targeting for Google Ad Manager: https://developers.google.com/ad-manager/mobile-ads-sdk/android/targeting#custom_targeting

We were instructed to use the setLocalExtraParameterForKey functionality in the native SDKs, problem being that it is not supported to pass through objects via localExtraParameters. Also functions like setMRecLocalExtraParameter only support string-values.

Expected Behavior

We would want to be able to pass through the values for custom_targeting to the react component like this:

localExtraParameters={{ custom_targeting: { key: 'value', anotherKey: ['list', 'of', 'values'] } }}

How to Reproduce

  1. Add the prop localExtraParameters={{ custom_targeting: { key: 'value', anotherKey: ['list', 'of', 'values'] } }} to any AppLovinMAXAdView or AppLovinMAXNativeAdView
  2. You will get the JS error AppLovinMAXNativeAdView only support string values... coming from sanitizeExtraParameters

Additional Info

No response

@ghostops - Support added in v5.5.3 of our plugin.

@thomasmso Thanks 🙌