question

davisre avatar image
davisre asked davisre commented

Is there any way to receive a broadcast without launching the app?

Our app registers a receiver for the PAYMENT_PROCESSED broadcast in the android manifest. If the merchant installs the app but doesn't launch it, we never get the broadcast. Once the app has been launched, we start seeing them.

In our case, merchants sometimes install the app on the web and launch it there -- the web version -- to set it up. This installs the app on the merchant's devices, as well, but the android app doesn't wake up until the merchant launches it.

Is there a way to start getting broadcasts like PAYMENT_PROCESSED as soon as the android app is installed?

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 davisre commented

No, your app must be launched by the merchant. This is a standard Android security feature that prevents a malicious app that somehow gets installed without the user's knowledge from running.

It would behoove you to add some sort of user-facing activity that is launchable. This way the user will see a "Open" button in the app market after it's installed. The UI can of course be something trivial to let the user know the app is installed and working.

That all being said, you aren't the first person that's requested this. I created an internal issue to understand if this is something we could offer 3rd party apps. I do not have an ETA for a fix or decision one way or the other though so you'll need to do something like the workaround I mentioned above.

1 comment
10 |2000

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

davisre avatar image davisre commented ·

Got it. That's what I figured. We do have user-facing UI, but since the initial install is (in many cases) happening on the web, there's no "Open" button. Sounds like we'll need to ask the merchant to tap the app icon on the device, at least for now. Thanks.

0 Likes 0 ·

Welcome to the
Clover Developer Community