This repository contains an example application that showcases features of the new Clover CFP (Customer-Facing Platform) SDK.
A custom activity is an Android activity that you can install on semi-integrated Clover devices in the customer-facing mode through USB Pay Display, Secure Network Pay Display (SNPD), or Cloud Pay Display. Your POS can then communicate with this activity using the following CloverConnector methods:
| Method | Description |
|---|---|
CloverConnector.startCustomActivity() |
Trigger a custom activity on the customer-facing Clover device |
CloverConnector.sendMessageToActivity() |
Send information to the custom activity |
CloverConnectorListener.onMessageFromActivity() |
Receive information from the custom activity |
CloverConnectorListener.onCustomActivityResult() |
Receive a result from the custom activity |
The clover-cfp-sdk provides a base implementation of an activity. You can extend the implementation to:
- Set result values from a Custom Activity
- Send and receive string messages between your POS and the Custom Activity that is running on the Clover device
With this SDK, you can trigger custom activities from your POS to a Clover device and create tailor-made customer experiences, such as tip selection, ratings and feedback, benefits program enrollment, and more. You can find the maven repository of the SDK here.
See the Clover Developer Docs for documentation and code snippets.
This sample application requires an Android device that is connected to a Clover device using either USB Pay Display or SNPD. Note that this can be done with two Clover Mini devices as well since both devices natively run Android. To get started, clone the following repository:
git clone https://github.com/clover/CustomerFacingPlatformExamples.git
You can also simply download and extract the ZIP file.
You can start working with the application by performing the following tasks:
- Connect your computer to the Android device that will serve as your POS. Install the
CustomActivityAppproject on the Android device. There are 2 ways to do this:
- In the project directory, run the
gradle installDebugcommand, or - Run the project in Android Studio with the deployment target set as your attached device
-
Install the activities that will interface with the
CloverConnectormethods (mentioned above). Note that these methods require an activity name as a parameter, and are triggered when a matching activity is found on the Clover device. Clone the android examples repository and install the projectclover-cfp-examplesthroughgradle installDebug. -
On the Clover device, run USB Pay Display (when tethered) or Secure Network Pay Display (when connected to the same network).
-
Run
CustomActivityAppfrom your Android device and connect using your selected Pay Display application.
- In the basic example,
CloverConnector.startActivity()is used to send a JSON-like string payload to the Clover device. - When you select Finish within the activity, the
setResultAndFinish()method fromclover-cfp-sdkis invoked. This method sends a payload back to the POS withCloverConnector.onCustomActivityResult(). - The payload exchange between the Android device and Clover device represents a single Custom Activity session.
- When the Custom Activity session is started,
CloverConnector.sendMessageToActivity()is used to send a joke text to the Clover Device. - When you select Send within the activity, invokes the
sendMessage()method fromclover-cfp-sdkis invoked. This method sends a joke response payload back to the POS withCloverConnector.onMessageFromActivity(). - Data can be exchanged indefinitely until the session is completed. The session is complete when the activity invokes
setResultAndFinish()and the POS receives the signal withCloverConnector.onCustomActivityResult(). Note that in this example, only one response is exchanged. Select Send to end the Custom Activity session.
A Custom Activity is started to display a photo stream on the customer-facing Clover Device. To exit to the main menu, touch the 4 corners of the device.
A Custom Activity that contains a web view is launched on the Clover device. With this web view, you can communicate with and send a message back to the POS.
- A Custom Activity is launched on the Clover device for a customer to sign in and rate their dining experience.
- The activity sends back an authenticated customer's information to the POS. As the customer progresses through each question, the rating is sent to the POS until the activity is completed.
- To test this example, use the code
1111on the screen requesting for a phone number.
A Custom Activity is launched on the Clover device. This enables the device to listen for an NFC tap, and then to send the tagged card serial number back to the POS (Note that this example currently works only on Bypass Fortress Cards).









