salmon-plastic-31303
06/12/2023, 8:50 AMsalmon-plastic-31303
06/12/2023, 8:51 AMkind-carpenter-27609
06/12/2023, 8:58 AMsalmon-plastic-31303
06/12/2023, 8:59 AMkind-carpenter-27609
06/12/2023, 9:00 AMkind-carpenter-27609
06/12/2023, 9:00 AMsalmon-plastic-31303
06/12/2023, 9:02 AM{
"type": "screen",
"event": "UI",
"sentAt": "2023-06-12T08:37:10.853Z",
"userId": "79a82a70-ddd5-11ed-af54-4f419a486fc8",
"channel": "mobile",
"context": {
"os": {
"name": "iOS",
"version": "16.4"
},
"app": {
"name": "arnoldsDev",
"build": "1",
"version": "1.0.0",
"namespace": "com.arnolds.dev"
},
"device": {
"id": "619770c9-9d5e-47d3-b1c0-50cd123b2750",
"name": "iPhone 14",
"type": "iOS",
"model": "iPhone",
"manufacturer": "Apple",
"attTrackingStatus": 0
},
"locale": "fi-US",
"screen": {
"width": 390,
"height": 844,
"density": 3
},
"traits": {
"phone": "+3580440179929",
"userId": "79a82a70-ddd5-11ed-af54-4f419a486fc8",
"anonymousId": "619770c9-9d5e-47d3-b1c0-50cd123b2750"
},
"library": {
"name": "rudder-ios-library",
"version": "1.15.1"
},
"network": {
"wifi": true,
"cellular": false
},
"timezone": "Europe/Helsinki",
"sessionId": 1686555568
},
"rudderId": "341ac75d-f852-47ed-83a8-84ac94d0023e",
"messageId": "c8bc85e8-45c7-48d4-a444-1c377a1880f5",
"timestamp": "2023-06-12T08:37:10.923Z",
"properties": {
"name": "UI",
"automatic": true
},
"receivedAt": "2023-06-12T08:37:11.171Z",
"request_ip": "87.95.56.65",
"anonymousId": "619770c9-9d5e-47d3-b1c0-50cd123b2750",
"integrations": {
"All": true
},
"originalTimestamp": "2023-06-12T08:37:10.605Z"
}kind-carpenter-27609
06/12/2023, 9:06 AMsalmon-plastic-31303
06/12/2023, 10:02 AMsalmon-plastic-31303
06/12/2023, 10:04 AMkind-carpenter-27609
06/12/2023, 10:16 AMsalmon-plastic-31303
06/12/2023, 10:54 AMsalmon-plastic-31303
06/12/2023, 10:56 AMsalmon-plastic-31303
06/12/2023, 10:58 AMadventurous-petabyte-6019
06/12/2023, 11:35 AM{
"error": "Invalid app endpoint"
}adventurous-petabyte-6019
06/12/2023, 11:35 AMuseEffect(() => {
const rudderInitialise = async () => {
setOptions({
// dev key from the appsflyer dashboard
devKey: 'vegd7ZQCLsTv6SeR7X6erD',
// whether we want to run the appsflyer SDK in the debug mode
isDebug: true,
// whether we want to register for the listeners which would return the conversion data
onInstallConversionDataListener: true,
// ID assigned by the Apple app store for any app which is either published or in the process of getting published
appleAppId: '1667809195',
// whether we want to register for the listeners which would return the deeplink data
onDeepLinkListener: true,
// the number of seconds for which the appsflyer iOS SDK should wait to allow the app to retrieve the user consent.
timeToWaitForATTUserAuthorization: 60
});
await rudderClient.setup(Config.RUDDERSTACK_KEY, {
dataPlaneUrl: Config.RUDDERSTACK_DATA_PLANE_URL,
trackAppLifecycleEvents: true,
recordScreenViews: true,
withFactories: [appsflyer]
});
console.log('SDK is initalised');
};
rudderInitialise().catch(console.error);
}, []);kind-carpenter-27609
06/12/2023, 11:37 AMcalm-yak-10773
06/12/2023, 11:54 AM@rudderstack/rudder-integration-firebase-react-native package are you using?
2. Have you been able to observe any events in Firebase so far?
3. Have you been able to observe any events in AppsFlyer so far?salmon-plastic-31303
06/12/2023, 11:57 AMsalmon-plastic-31303
06/12/2023, 11:58 AMcalm-yak-10773
06/12/2023, 11:58 AMadventurous-petabyte-6019
06/12/2023, 12:12 PMcalm-yak-10773
06/12/2023, 12:13 PMadventurous-petabyte-6019
06/12/2023, 12:14 PMadventurous-petabyte-6019
06/12/2023, 12:14 PMcalm-yak-10773
06/12/2023, 12:29 PMAppsFlyer Staging destination
3. Select Configuration tab
4. Navigate to bottom and set Use device-mode to send events option to true.
Actually, for AppsFlyer you’ve connected the destination in Cloud mode, not in device mode. Hence you’re getting error.
PS: If you would have connected any destination in device mode, you wouldn’t be able to see the live events tab for that destination.
For other destination i.e., Firebase:
1. Actually, you’ve created a Google Analytics GA4 destination, instead of Firebase.
2. Google Analytics GA4 is a cloud mode destination hence this is also not working.
3. PS: Google Analytics GA4 and Firebase both are different destination in Rudderstack and Rudder React-Native only supports Firebase as a mobile device mode destination.
4. Kindly connect to Firebase and try again.
I assume you’re attempting to send events in device mode and not in cloud mode.adventurous-petabyte-6019
06/12/2023, 12:33 PMcalm-yak-10773
06/12/2023, 12:34 PMEdit Configuration on top right.adventurous-petabyte-6019
06/12/2023, 12:37 PMadventurous-petabyte-6019
06/12/2023, 12:38 PMcalm-yak-10773
06/12/2023, 12:38 PMcalm-yak-10773
06/12/2023, 12:39 PMPS: If you would have connected any destination in device mode, you wouldn’t be able to see the live events tab for that destination.
salmon-plastic-31303
06/12/2023, 2:53 PMcalm-yak-10773
06/13/2023, 1:45 AMsalmon-plastic-31303
06/13/2023, 7:56 AMadventurous-petabyte-6019
06/13/2023, 8:08 AMadventurous-petabyte-6019
06/19/2023, 10:01 AMuseEffect(() => {
const isProd = Config.ENV_MODE === 'Prod';
const rudderInitialise = async () => {
const appsFlyerId =
await RudderIntegrationAppsflyerReactNative.getAppsFlyerId();
console.log('appsFlyerId', appsFlyerId);
setOptions({
// dev key from the appsflyer dashboard
devKey: Config.APPSFLYER_DEV_KEY,
// whether we want to run the appsflyer SDK in the debug mode
isDebug: !isProd,
// whether we want to register for the listeners which would return the conversion data
onInstallConversionDataListener: true,
// ID assigned by the Apple app store for any app which is either published or in the process of getting published
appleAppId: Config.APPSFLYER_APP_ID,
// whether we want to register for the listeners which would return the deeplink data
onDeepLinkListener: true,
// the number of seconds for which the appsflyer iOS SDK should wait to allow the app to retrieve the user consent.
timeToWaitForATTUserAuthorization: 60
});
await rudderClient.setup(Config.RUDDERSTACK_KEY, {
dataPlaneUrl: Config.RUDDERSTACK_DATA_PLANE_URL,
trackAppLifecycleEvents: true,
recordScreenViews: true,
withFactories: [appsflyer, firebase]
});
};
rudderInitialise().catch(console.error);
}, []);calm-yak-10773
06/19/2023, 10:22 AMsetOptions. Also please remove appsflyer from the withFactories (this is only required in case AppsFlyer is connected in device mode). In short, to send events to AppsFlyer in Cloud mode, you’ll only require:
await rudderClient.setup(Config.RUDDERSTACK_KEY, {
dataPlaneUrl: Config.RUDDERSTACK_DATA_PLANE_URL,
trackAppLifecycleEvents: true,
recordScreenViews: true,
withFactories: [firebase] // Note: Firebase is still connected in device mode
});
To send events from React-Native -> AppsFlyer in cloud mode, refer to our doc: https://www.rudderstack.com/docs/destinations/streaming-destinations/appsflyer/#sending-events-via-rudderstack-cloud-mode
As per the Rudder-AppsFlyer doc to send events to AppsFlyer in cloud mode you need to do following thing:
To send events to AppsFlyer via cloud mode, you need the AppsFlyer ID generated by the AppsFlyer SDK that is integrated with your app. See Obtaining the AppsFlyer ID for reference.Which basically means you first need to directly install the AppsFlyer SDK on your app -> generate the
AppsFlyer ID -> pass that ID using Identify call. After that only event would be delivered to AppsFlyer destinations.adventurous-petabyte-6019
06/19/2023, 10:54 AMadventurous-petabyte-6019
06/19/2023, 10:54 AMadventurous-petabyte-6019
06/19/2023, 11:07 AMadventurous-petabyte-6019
06/19/2023, 11:08 AMimport AppsFlyerIntegrationFactory from "@rudderstack/rudder-integration-appsflyer-react-native/src/bridge"
const appsFlyerId = await AppsFlyerIntegrationFactory.getAppsFlyerId()calm-yak-10773
06/19/2023, 11:15 AMsetOptions and then pass the AppsFlyer inside withFactories, as you did previously:
await rudderClient.setup(Config.RUDDERSTACK_KEY, {
dataPlaneUrl: Config.RUDDERSTACK_DATA_PLANE_URL,
trackAppLifecycleEvents: true,
recordScreenViews: true,
withFactories: [appsflyer, firebase]
});
After that you actually need to call:
const appsFlyerId = await AppsFlyerIntegrationFactory.getAppsFlyerId()
also AppsFlyer ID I can get from appsflyer sdk right?Yes definitely, this is not dependent on our packages. We are internally using the AppsFlyer SDK to fetch this ID.
adventurous-petabyte-6019
06/19/2023, 11:29 AMwithFactories
and
setOptionsadventurous-petabyte-6019
06/19/2023, 11:34 AMawait rudderClient.setup(Config.RUDDERSTACK_KEY, {
dataPlaneUrl: Config.RUDDERSTACK_DATA_PLANE_URL,
trackAppLifecycleEvents: true,
recordScreenViews: true,
withFactories: [firebase] // Note: Firebase is still connected in device mode
});
2. add sdk react native appsflyer
3. pass appsflyer id from sdk
"externalId": [
{
"id": "AppsFlyer_ID",
"type": "appsflyerExternalId"
}
]
I need to pass it in method identify?
rudderClient.identify(
data.id,
{
phone: data.phone
},
null
);calm-yak-10773
06/19/2023, 11:52 AMwithFactories.
• Also to send events in device mode, you first need to enable it in your RudderStack dashboard. Unless you enable over there, no event can be sent to AppsFlyer in device mode, even if you use setOptions and withFactories.
• In Cloud mode, actually AppsFlyer require AppsFlyer ID which could only be generated by their SDKs.
◦ In order to generate that, you’ve to follow the steps we suggested.
◦ Internally, we are simply initialising the AppsFlyer SDK and then fetching the ID using the API they’ve provided.
◦ This could only be done when you use setOptions and withFactories.
(Please follow this steps)
In order to send events to AppsFlyer Cloud mode use:
• `setOptions`:
// Setting options for initializing the appsflyer sdk
setOptions({
// dev key from the appsflyer dashboard
"devKey": "<dev_key>",
// whether we want to run the appsflyer SDK in the debug mode
"isDebug": true,
// whether we want to register for the listeners which would return the conversion data
"onInstallConversionDataListener": true,
// ID assigned by the Apple app store for any app which is either published or in the process of getting published
"appleAppId": "<apple_app_id>",
// whether we want to register for the listeners which would return the deeplink data
"onDeepLinkListener": true,
// the number of seconds for which the appsflyer iOS SDK should wait to allow the app to retrieve the user consent.
"timeToWaitForATTUserAuthorization": 60
})
• Then, initialise the SDK:
await rudderClient.setup(Config.RUDDERSTACK_KEY, {
dataPlaneUrl: Config.RUDDERSTACK_DATA_PLANE_URL,
trackAppLifecycleEvents: true,
recordScreenViews: true,
withFactories: [appsflyer, firebase] // Note: AppsFlyer is present over here
});
• Pass AppsFlyer ID in identify call, for the correct steps, refer to our doc here: https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-react-native-sdk/#setting-a-custom-id
const options = {
"externalId": [
{
"id": "AppsFlyer_ID",
"type": "appsflyerExternalId"
}
]
}
rudderClient.identify(
"1hKOmRA4GRlm",
{
email: "<mailto:alex@example.com|alex@example.com>",
location: "UK",
},
options
)
Please Note:
1. Whenever you call our RESET API, it will clear the existing externalId, and then you again need to make an identify call with the externalId, otherwise event wouldn’t be sent.