question

demskigroup avatar image
demskigroup asked demskigroup commented

Customer Facing Activity How To Trigger onMessage

I have the customer facing activity showing up on the attached mini, which is great, but when I send a message to that device using

executor.execute(()->{
            remoteDeviceConnector.sendMessageToActivity(new MessageToActivity(CUSTOM_ACTIVITY_NAME, String.valueOf(amount))
        });

and I send to

@Override
    public void onMessage(String s) {
        ((TextView)this.findViewById(R.id.donateText)).setText("String " + s);
    }

it never get's triggered. How do we get this to receive?

Clover Mini
7 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Blake Williams avatar image Blake Williams ♦ commented ·

Where is onMessage defined? Is it in a CloverCFPCommsHelper within your custom activity? https://docs.clover.com/docs/using-customer-facing-platform

0 Likes 0 ·
demskigroup avatar image demskigroup Blake Williams ♦ commented ·

I import CloverCFPCommsHelper from

import com.clover.cfp.activity.helper.CloverCFPCommsHelper;

should it be defined somewhere else?


Then in my class I implement CloverCFPCommsHelper.MessageListener

public class SaleDialogActivityCF extends Activity implements View.OnClickListener, CustomPriceEnteredListener, CloverCFPCommsHelper.MessageListener
0 Likes 0 ·
Blake Williams avatar image Blake Williams ♦ demskigroup commented ·

See the example here: https://docs.clover.com/docs/using-customer-facing-platform. You'll need to create a CloverCFPCommsHelper instance, passing in the intent, context and listener.

0 Likes 0 ·
Show more comments

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community