npmjs.org repository
Here, you will find the npmjs.org react-native-appstack-sdk documentation. Please use the latest available version of the SDK.Requirements
iOS
- iOS version: 13.0+ (14.3+ recommended for Apple Ads)
- Xcode: 14.0+
- React Native: 0.72.0+
Android
- Minimum SDK: Android 5.0 (API level 21)
- Target SDK: 34+
- Java Version: 17+
General
- Node.js: 16.0+
Initial setup
Installation
ios/YourApp/Info.plist:Configuration parameters
Initializes the SDK with your API key. Must be called before any other SDK methods.Parameters:
apiKey- Your platform-specific API key from the Appstack dashboard
true if configuration was successfulExample:Sending events
Track user actions and revenue in your activities:Available EventType valuesIt is recommended to use standard events for a smoother experience.To improve matching quality on Meta, send events including the following parameters if you can fulfill them:
INSTALL- App installation (tracked automatically)LOGIN,SIGN_UP,REGISTER- AuthenticationPURCHASE,ADD_TO_CART,ADD_TO_WISHLIST,INITIATE_CHECKOUT,START_TRIAL,SUBSCRIBE- MonetizationLEVEL_START,LEVEL_COMPLETE- Game progressionTUTORIAL_COMPLETE,SEARCH,VIEW_ITEM,VIEW_CONTENT,SHARE- EngagementCUSTOM- For application-specific eventsTracks custom events with optional parameters
eventType- Event type from EventType enum or string (e.g., ‘PURCHASE’, ‘LOGIN’)eventName- Event name for custom events (optional)parameters- Optional parameters object (e.g.,{ revenue: 29.99, currency: 'USD' })
true if event was sent successfullyEnhanced app campaignsFor any event that represents revenue, we recommend sending:revenueorprice(number)currency(string, e.g.EUR,USD)
emailname(first + last name in the same field).phone_numberdate_of_birth(recommended format:YYYY-MM-DD).
Advanced usage
Environment-based configuration
Set up different API keys for different environments:Platform-specific considerations
iOS
Apple Ads attribution:- Only works on iOS 14.3+
- Requires app installation from App Store or TestFlight
- Attribution data appears within 24-48 hours
- User consent may be required for detailed attribution (iOS 14.5+)
Android
Play Store attribution:- Install referrer data collected automatically
- Attribution available immediately for Play Store installs
- Works with Android 5.0+ (API level 21)
Cross-platform best practices
Security considerations
API key protection
- Never commit API keys to version control
- Use environment variables or secure configuration
- Use different keys for development and production
Data privacy
- Event names and revenue data are transmitted securely over HTTPS
- No personally identifiable information (PII) should be included in event names
- The SDK does not collect device identifiers beyond what’s required for attribution
Limitations
Attribution timing
- iOS: Apple Ads attribution data appears within 24-48 hours after install
- Android: Install referrer data available immediately for Play Store installs
- Attribution only available for apps installed from official stores
Platform constraints
- iOS: Requires iOS 13.0+, Apple Ads attribution needs iOS 14.3+
- Android: Minimum API level 21 (Android 5.0)
- React Native: 0.72.0+
- Some Apple Ads features may not work in development/simulator environments
Event tracking
- Event types are case-sensitive (use uppercase like ‘PURCHASE’, ‘LOGIN’)
- Parameters are passed as an object and can include any key-value pairs
- For revenue events, always pass a
revenue(orprice) and acurrencyparameter - The SDK must be initialized before any tracking calls
- Network connectivis ity required for event transmission (events are queued offline)
Technical limitations
enableAppleAdsAttribution()only works on iOS and will do nothing on Android- For now, iOS endpoint configuration cannot be customized (will be patched in future release)
- Event name standardization is done for Android, but not for iOS yet
Troubleshooting
Common Issues
Configuration fails:- Check network connectivity
- Verify the API key is correct for the platform
- Events may take a few minutes to appear in the dashboard
- Ensure iOS version is 14.3+
- Verify the app is installed from the App Store or TestFlight
- Check that
NSAdvertisingAttributionReportEndpointit is configured in Info.plist - Allow 24-48 hours for attribution data to appear
Support
For questions or issues:- Check the GitHub Repository
- Contact our support team at support@appstack.tech
- Open an issue in the repository