GoogleChromeLabs / bubblewrap

Bubblewrap is a Command Line Interface (CLI) that helps developers to create a Project for an Android application that launches an existing Progressive Web App (PWAs) using a Trusted Web Activity.
Apache License 2.0
2.38k stars 162 forks source link

AppsFlyer Integration Documentation #484

Closed braydonburn closed 2 years ago

braydonburn commented 3 years ago

I'm currently trying to implement AppsFlyer into our bubblewrap TWA. I've noticed that @andreban added a commit to support the AppsFlyer SDK https://github.com/GoogleChromeLabs/bubblewrap/pull/278/files#diff-4db0ae3cf5a497bda3407532f94f2c474cb553f8e4d6161add886361991a25a9R24 but I can't find any documentation on how to use it

Following the documentation on Appsflyer https://support.appsflyer.com/hc/en-us/articles/360002330178-Using-AppsFlyer-with-TWA-and-PWA#inapp-events-with-twa-getting-the-appsflyer-id hasn't gotten me far

Steps I've completed:

}

- Attempted to add `customtabs` imports to `app/build.gradle` - can no longer build, import fails

// AppsFlyer imports https://support.appsflyer.com/hc/en-us/articles/360002330178-Using-AppsFlyer-with-TWA-and-PWA#inapp-events-with-twa-getting-the-appsflyer-id import android.support.customtabs.CustomTabsClient; import android.support.customtabs.CustomTabsIntent; import android.support.customtabs.CustomTabsServiceConnection; import android.support.customtabs.CustomTabsSession; import android.support.customtabs.trusted.TrustedWebActivityIntentBuilder; import static android.support.customtabs.TrustedWebUtils.EXTRA_LAUNCH_AS_TRUSTED_WEB_ACTIVITY



I'm unsure where i should be looking next. I assume i need to `bubblewrap build` again but doing so fails with invalid imports. What steps am i missing? How do I use the SDK integration? 

If someone could help me out i'd be happy to write up a doc compiling my findings

Thanks in advance
andreban commented 3 years ago

With Bubblewrap, you only need the first step to enable AppsFlyer feature and set the appsFlyerId:

"features": {
    "appsFlyer": {
      "enabled": true,
      "appsFlyerId": "xxx"
    }
  },

The steps in the AppsFlyer docs are for creating the integration manually - and the TWA used in their docs are outdated.

On a side note, we are not heavily promoting this and other features, as they are incompatible with Chrome OS - in that OS, when starting from the home screen, it will not trigger the Android code.

CC @ibrahimkarahan

braydonburn commented 3 years ago

Thanks @andreban. Do you know of any alternatives that will work with Chrome OS?

andreban commented 3 years ago

Any web analytics will work as expected for the web part of the application. Are you looking for something specific in terms of Android analytics SDKs? (eg: install referrer was the use-case I heard for AppsFlyer)

braydonburn commented 3 years ago

Yeah that's right - we're looking for something to fill in the missing gap of install referrer

andreban commented 2 years ago

This has been documented at https://github.com/GoogleChromeLabs/bubblewrap/tree/main/packages/cli#appsflyerconfig.

LupusX5 commented 2 years ago

Yeah that's right - we're looking for something to fill in the missing gap of install referrer

HI! Did you find a tool for getting install referrer for TWA?