react-native-analytics-segment-io
react-native-analytics-segment-io copied to clipboard
Setting up Appboy and Appsflyer integration
This is not an issue with this library, I'm just looking for some help with using what this library sets up automatically to essentially shim in another integration. Since Java is not my forte I need a hand!
Long story short (you can read more here), in order to get attribution data from Appsflyer to Braze, an integration needs to be set up between the two libraries directly. Segment makes it such that Braze gets the top level event for attribution, but it loses out on the sub-properties (like the source of the attribution; essentially all of the important data). The direct integration de-normalizes the Appsflyer data in a custom format fit for Braze.
To achieve the integration on Android, I need to add this code to my Activity/Application
HashMap<String, Object> customData = new HashMap<String,Object>();
String deviceId =(Appboy.getInstance(MyActivity.this).getInstallTrackingId());
customData.put("customData", deviceId);
AppsFlyerLib.setAdditionalData(customData);
I know that I need to import the requisite libraries-- HashMap and AppsFlyerLib -- but with AppsFlyerLib, I believe I need to be working with an already created instances of the module, if that makes sense. And I don't want to instantiate a new one with my AppsFlyer key because, if I'm not mistaken, this library has already done that for me under the hood.
The question is: how do I access the already-activated AppsFlyerLib instance that (I'm assuming) this library instantiated in order to run the above code successfully?