The delivery mechanism of Assistive Cards is the personal assistant that Horntell creates for your Android app. Horntell Zed listens for all the real-time Assistive Cards that are pushed from your backend servers and delivers them to your users. Besides this, it also does a lot of non-onvious things like maintaining read/unread status of Cards, buffering unread Cards if your user is currently acting on any previous sent Card, etc.
Tip: It’s best to get your technology team do this integration for you. It will take a couple of minutes for them to do this.
When you first log in you account, you will see a switch in top-right corner of your account which lets you switch between Live and Test environments. Use test environment when working locally and live environment in production.
Once the environment is set, you need to find the integration code by clicking on your app’s name in top-right corner and then clicking on Settings. Under the Integrate tab, you will find the API keys and integration code.
You will need to paste the code in the
build.gradlefile of the Android app. The latest version of Zed will be found in your account that will replace X.Y.Z in the code below.
- As the Cards are pushed to the logged-in user in your app, you will need to initialize the SDK dynamically at the point where you authenticate your user. Make sure you calculate the “UID_HASH” at your server and send it in response to the user authentication call. Upon receiving this hash from the server, pass it to Horntell. DO NOT REVEAL the App’s secret in your shipped app anywhere. (More about hashing is available here).
Tip: In the code snippet, the variable
APP_IDwill already be initialized with correct value for your account. You do NOT need to alter this variable.
- Last step involves, generating a Google OAuth Web Client ID and adding it to your
AndroidManifest.xmlfile. This is required because some of the actions in the Cards, like Payments, must be authenticated with the information present on the device (that is, the user’s logged in Google account). You can follow the steps to generate Google OAuth Web Client ID and then add the following line with the correct value to your
Now, we’ve got the Horntell Zed integrated, we can begin pushing Assistive Cards to our users.