Platform Docs

Using Customer-Facing Platform

Customer-Facing Platform (CFP) Activities

Custom Activities are Android activities installed on the Clover device that your POS can start while tethered in customer-facing mode through USB Pay Display, Secure Network Pay Display, or Cloud Pay Display. Your POS can start and communicate with Custom Activities using CloverConnector’s startCustomActivity() and sendMessageToActivity() methods. The POS can receive messages or a result through the onMessageFromActivity() and onCustomActivityResult() methods.

Clover CFP SDK

The clover-cfp-sdk provides a base implementation of an Activity. You can extend it to facilitate setting result values, as well as sending and receiving string messages between the POS and Custom Activity.

The SDK is available from MVN Repository or The Central Repository.

Defining Custom Activities

Custom Activities must have the category com.clover.cfp.ACTIVITY:

<activity android:name="com.clover.cfp.examples.BasicExampleActivity"
         android:label="@string/title_activity_basic_example" >
       <action android:name="com.clover.cfp.examples.BasicExample"/>
       <category android:name="com.clover.cfp.ACTIVITY"/>
       <category android:name="android.intent.category.DEFAULT" />

Starting Custom Activities and getting Activity results

Applications can only start Custom Activities when the device is in an IDLE state (at the Welcome, Display Order, or Thank You screen, for example).

You can start Custom Activities as blocking (default) or non-blocking.

  • Blocking Activities will prevent other Activities from starting until the Custom Activity is finished, or until resetDevice() is called. This mode may be useful when a customer is entering or selecting information, and shouldn’t be interrupted by other POS activities.
  • Non-blocking Activities will finish and be replaced when the POS makes a new Activity request. For example, they can be useful if a Custom Activity is displaying a custom order screen that should be replaced when a payment is requested.

You can make Custom Activities return a payload to the POS by setting the string extra com.clover.remote.terminal.remotecontrol.extra.EXTRA_PAYLOAD on the result Intent. The Clover device will pass the string back as the payload attribute for the CustomActivityResponse object that is passed into the onCustomActivityResponse() callback.

cloverConnector.startCustomActivity("com.clover.cfp.examples.BasicExample", payload: "{'name':'John Smith'}")
class BasicExampleActivity extends CloverCFPActivity {
     @Override protected void onCreate(Bundle savedInstanceState) {
           String payload = getIntent().getStringExtra(EXTRA_PAYLOAD);


The CloverCFPActivity class has a convenience method setResultAndFinish(int resultCode, String payload).

Communicating with Custom Activities

Your POS can communicate with a running Custom Activity through string messages. For example, sendMessageToActivity() passes a string payload to the appropriate Activity, based on the Activity’s action name. The Custom Activity can receive the message by overriding the onMessage(String payload) method defined in the CloverCFPActivity class.

// in cloverConnector.sendMessageToActivity(msgRequest)

let msgRequest = MessageToActivity("com.clover.cfp.examples.BasicActivity",
payload:"{'title':'Specials', ‘message’:’Enjoy these items for half price!’") 

The Custom Activity can receive the message by overriding the onMessage(String payload) method defined in the CloverCFPActivity class.

class BasicExampleActivity extends CloverCFPActivity {
     protected abstract void onMessage(String payload) {
          // handle message

To send a message from a Custom Activity to the POS, the Custom Activity can call sendMessage(String payload), which is defined in CloverCFPActivity. The POS will receive the message in the onMessageFromActivity() callback defined in the ICloverConnectorListener class.

class BasicExampleActivity extends CloverCFPActivity {
     private void doSomething() {

Finishing Custom Activities

A Custom Activity that started as a blocking Activity must be finished either by the Activity, or through a resetDevice() call from the POS. The finish() or setResultAndFinish(int result, String payload) method can be triggered from the Activity (i.e., a button tap), or by sending a message to the Activity to trigger a finish() call.

A Custom Activity that starts as a non-blocking Activity can be finished by the Activity, by a resetDevice() call from the POS, or by starting another Activity. The other Activity can either be explicit (e.g., startCustomActivity()), or implicit to Clover Connector (e.g., sale()).

When the Custom Activity finishes, the Clover device returns to the IDLE state and the welcome screen is shown.

Custom Activity interaction

Updated about a month ago

Using Customer-Facing Platform

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.