App events help you understand the makeup of your users. They allow you to measure, and then target specific sets of your users with Facebook mobile app ads. You do this by logging events from your app via the Facebook SDK for React Native. An event can be a predefined event, or a custom event that you define. To learn more about app events, see
App Events - Facebook Analytics.
To use the app events API, import the AppEventLogger
component into your React Native app.
import {AppEventsLogger} from 'react-native-fbsdk';
To log a custom event, call the logEvent
method and pass it a string specifying the name of your custom event.
AppEventsLogger.logEvent('battledAnOrc');
For logging in-app purchases, a custom logging method is provided. To log a purchase event, call the logPurchase
function and pass in the amount of the purchase and the currency code. Only log a purchase event after the purchase has been completed.
AppEventsLogger.logPurchase(1.99, 'USD');
Visit
Wikipedia: ISO 4217for information on Currency Codes.