Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class AppsFlyerUtils implements AppsFlyerConversionListener {
- private static AppsFlyerLib sTracker;
- private static AppsFlyerUtils sInstance;
- private static WeakReference<Context> mContextReference;
- private AppsFlyerUtils(Application application, boolean debug) {
- mContextReference = new WeakReference<>(application.getApplicationContext());
- if (sTracker == null) {
- sTracker = AppsFlyerLib.getInstance();
- }
- sTracker.setGCMProjectNumber(mContextReference.get(), App.getResString(R.string.appsflyer_server_api_key));
- sTracker.startTracking(application, App.getResString(R.string.appsflyer_dev_key));
- sTracker.registerConversionListener(mContextReference.get(), this);
- . . .
- }
- public static void initialize(Application application, boolean debug) {
- if (sInstance == null) {
- sInstance = new AppsFlyerUtils(application, debug);
- }
- }
- @Override
- public void onInstallConversionDataLoaded(Map<String, String> map) {
- // This gets called every time.
- }
- @Override
- public void onAppOpenAttribution(Map<String, String> map) {
- // Never gets called.
- }
- . . .
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement