@akxks_/react-native-apple-ads-attribution
v1.0.4
Published
React Native Apple Ads attribution package using AdServices only, without deprecated iAd/ADClient dependencies.
Downloads
180
Maintainers
Readme
@akxks_/react-native-apple-ads-attribution
React Native Apple Ads attribution for iOS using Apple's supported AdServices flow only.
This package exists because older Apple Ads attribution libraries still reference the deprecated iAd / ADClient API. That can fail modern iOS builds with linker errors such as:
Undefined symbols for architecture arm64
Symbol: _OBJC_CLASS_$_ADClientThis package keeps the familiar React Native API shape, but removes the unsupported legacy fallback and uses the supported AdServices token + attribution request path instead.
Why this package is needed
- Modern Xcode / EAS builds can fail when a package still links against
ADClient - Apple’s supported attribution path is
AdServices, notiAd - Some apps only need a safe way to determine attribution and pass the token or result to their backend
- Existing apps may want a drop-in replacement with minimal JS changes
What changed from the older package
- Removed
iAd/ADClient - Kept
AdServices - Kept the same exported method names for easier migration
getiAdAttributionData()now rejects with a clear unsupported error instead of attempting deprecated behavior
Installation
npm install @akxks_/react-native-apple-ads-attributionIf you use Expo with prebuild:
npx expo prebuild --clean --platform iosUsage
import AppleAdsAttribution from "@akxks_/react-native-apple-ads-attribution";
const attributionData = await AppleAdsAttribution.getAttributionData();
const adServicesAttributionToken =
await AppleAdsAttribution.getAdServicesAttributionToken();
const adServicesAttributionData =
await AppleAdsAttribution.getAdServicesAttributionData();API
getAttributionData()
Fetches attribution data using AdServices.
getAdServicesAttributionToken()
Returns an Apple Ads attribution token generated on-device. The token is typically valid for 24 hours.
getAdServicesAttributionData()
Generates a token and requests attribution data from Apple’s attribution API.
getiAdAttributionData()
Rejected intentionally because the deprecated iAd / ADClient path is not supported in this package.
iOS support
- iOS 14.3+
- Real device required for token generation
- Simulator is not supported for attribution token generation
Migration from older packages
Replace:
npm uninstall react-native-apple-ads-attribution @hexigames/react-native-apple-ads-attributionWith:
npm install @akxks_/react-native-apple-ads-attributionThen update imports:
import AppleAdsAttribution from "@akxks_/react-native-apple-ads-attribution";Notes
- On non-iOS platforms, methods return
nulljust like the original package behavior - If attribution is unavailable, handle errors with
try/catch - If your backend only needs the attribution token or a boolean attribution flag, this package works well as a minimal bridge
License
MIT
