Example Android app
- If you don't already have Android Studio (free app from Google to build Android apps), download it here.
- Download the Sample App Folder: Sample Android App - Google Drive link
- Open the Sample App Folder in Android Studio.
- Run the app.
- Click Tools --> Device Manager --> Create Virtual Device. Try Pixel 9 or similar.
- Click the green arrow "Run app" button on the top toolbar.
- You will see the Acme Inc widget in the App Preview, as seen in the preview video above.
- Embed your widget in the app.
- In the MainActivity file, locate the EmbeddedLinkConfig setup on line 29.
- Replace publicAlias with your link's public alias. Find your link's public alias from the Links page. If you know your Canopy Connect link URL, it's the fragment after /c/. For example, the publicAlias of https://app.usecanopy.com/c/demo is demo.
- Optionally use consentToken if you're using your own custom consent screen & collecting consent in your app. It allows you to bypass our default consent screen, and end users can proceed directly to carrier selection.
- Optionally use pullMetaData to associate Pulls with your app's end users. pullMetadata is returned in the GET /pulls/:pullId API endpoint
Part to edit:
... lines 1 - 28 in MainActivity ...
val config = EmbeddedLinkConfig(
publicAlias = "demo", // replace with your widget's public alias
// Optional, use if you're collecting consent in your app and skipping our consent
// screen. Replace with a consent token retrieved from our Consent API.
consentToken = "xxx",
// optional, custom metadata to associate Pulls with your app's end users. pullMetadata is returned in the Pulls API.
pullMetaData = mapOf("custom-data-id" to "123-456"),
hideCloseButton = true
),
... rest of MainActivity ...