React
React Native
GRAVITY_RN_SPEC_OPTIONS in your ad request, then render the returned ad:
iOS
UseSpecAdView with the ad returned by getAds():
Android
UseSpecAd with the ad returned by getAds():
Handled automatically
The official SDKs handle:- compatible server-managed placement designs
- built-in fallback when no valid design is available
- impression and click tracking
- required ad disclosure
- light and dark themes
- server-requested feedback controls
Image ads
When an ad has a product image, Gravity sends an image card layout with it: the image on one side, the copy on the other. The official SDKs render it with no code change, starting at@gravity-ai/react 1.3.0, @gravity-ai/ui 0.3.0 and @gravity-ai/react-native 0.2.0. Older versions keep showing the text card. Ads without an image always use the text card.
To preview an image ad, send a test request with testAdFormat: "image" — see Image ads.

