Skip to content
This repository has been archived by the owner on Apr 27, 2022. It is now read-only.

Ability to enable/disable personalized ads #5

Closed
andkom opened this issue Aug 12, 2021 · 6 comments
Closed

Ability to enable/disable personalized ads #5

andkom opened this issue Aug 12, 2021 · 6 comments

Comments

@andkom
Copy link

andkom commented Aug 12, 2021

Ability to enable/disable personalized ads, specify user geolocation like in original firebase package wanted.

@wjaykim
Copy link
Collaborator

wjaykim commented Aug 12, 2021

I'm preparing this and trying to make apis as same as previous firebase package.

@wjaykim
Copy link
Collaborator

wjaykim commented Aug 12, 2021

Working this on branch request-options and you can preview them.

@wjaykim
Copy link
Collaborator

wjaykim commented Aug 14, 2021

Working done and available in new version.

@wjaykim wjaykim closed this as completed Aug 14, 2021
@andkom
Copy link
Author

andkom commented Aug 14, 2021

thanks for your work! But after installing new version ad banner started to blink each re-render.

@wjaykim
Copy link
Collaborator

wjaykim commented Aug 14, 2021

Can you show your code?

@andkom
Copy link
Author

andkom commented Aug 14, 2021

Code:

<BannerAd
  unitId={unitId}
  size={size}
  requestOptions={{
    requestNonPersonalizedAdsOnly,
    location: [
      locationData.latitude,
      locationData.longitude,
    ],
    locationAccuracy: locationData.accuracy,
  }}
/>

I found the cause, it happened because locationData object was changing and banner re-rendered each time (in firebase package changing requestOptions didn't force banner to reload)

Solved the issue by caching location data. Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants