cloosivjames avatar image
cloosivjames asked cloosivjames commented

Notifications on Clover and emulator question

I am trying to migrate my app to the Clover store and have a question about notifications. We want to send a push to our app when certain events happen. I have tried the notifications endpoint with no success; I've also seen the note that " Clover does not guarantee when or if a device will receive a notification through our service." I have 3 questions:
1) Does this Clover service work like FCM? IE - will notifications be sent to my application when it is backgrounded?
2) Can I send notifications to an emulator that has been set up properly per your documentation? FCM allows me to do this but I know FCM is not supported on Clover devices.
3) Does the V3 notification endpoint work with the example notification code (that points to V2) in your example notification documentation? It all points to AppNotificationReceiver

App MarketEmulator
10 |2000

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

1 Answer

Jeffrey Blattman avatar image
Jeffrey Blattman answered cloosivjames commented
1. Notifications are delivered to your app via a broadcast, so per Android your app is woken up to receive the broadcast. If you are going to perform some action beyond the handle intent method of the receiver you need to hold a wakelock as Android can kill your process after that otherwise.

2. Yes, notifications should work on emulators.

3. Yes, the v3 notification endpoint should work.
10 |2000

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

cloosivjames avatar image cloosivjames commented ·

Ok thanks. Is there any set up code I need to call to register for notifications? I was using the merchants/{mId}/notifications endpoint and using a rest client to send messages. I got a 200 back for sending the message but never received anything on my Clover emulator.

0 Likes 0 ·
Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ cloosivjames commented ·

You need to have a receiver in place to catch the resulting broadcast. First thing I'd do is try the app notification test in the SDK. It uses V2, but that'll tell you if the mechanism is working at all. And if that doesn't work it's pretty easy to report a bug on that. If that works, replace the v2 with a v3 call and try the same.

0 Likes 0 ·
cloosivjames avatar image cloosivjames Jeffrey Blattman ♦♦ commented ·

I'm getting the following 2 messages with the examples in the SDK. Do I have something set up incorrectly?

0 Likes 0 ·
Show more comments

Welcome to the
Clover Developer Community