Firebase
Events
Associate your users
if let firebaseAppInstanceId = Analytics.appInstanceID() {
Purchasely.setAttribute(.firebaseAppInstanceId, value: firebaseAppInstanceId)
}FirebaseAnalytics.getInstance(applicationContext).appInstanceId.addOnSuccessListener {
Purchasely.setAttribute(Attribute.FIREBASE_APP_INSTANCE_ID, it)
}FirebaseAnalytics.getInstance(getApplicationContext()).getAppInstanceId().addOnSuccessListener(id -> Purchasely.setAttribute(Attribute.FIREBASE_APP_INSTANCE_ID, id));/*
Reference : https://rnfirebase.io/analytics/usage#app-instance-id
*/
import analytics from '@react-native-firebase/analytics';
async function getInstanceId() {
const id = await analytics().getAppInstanceId();
id && Purchasely.setAttribute(Attributes.FIREBASE_APP_INSTANCE_ID, id);
}// Add plugin firebase-x to your project
// https://ionicframework.com/docs/native/firebase-x
//Retrieve the Firebase App Instance Id and forward it to Purchasely
FirebasePlugin.getId(function(appInstanceId) {
Purchasely.setAttribute(Purchasely.Attribute.FIREBASE_APP_INSTANCE_ID, appInstanceId);
}, function(error) {
console.error(error);
});Configure the integration in the Purchasely Console



Retrieving API secrets







Customising Server Event Names

Last updated