question

praneets avatar image
praneets Suspended asked Jeffrey Blattman answered

Broadcast for app install/update

How can my app be notified when any app is installed/updated on my clover device. I have tried using the below code using broadcast provided by Android, but it does not work.

Below is the code-

<receiver android:name=".receiver.AppInstallReceiver">
    <intent-filter>
<action android:name="android.intent.action.PACKAGE_ADDED" />
</intent-filter>
</receiver>
Also, I have tried the below code using Clover's Intents class
<receiver android:name=".receiver.PS_AppInstallReceiver">
<intent-filter>
<action android:name="com.clover.intent.action.APP_INSTALL_DONE" />
</intent-filter>
</receiver>

This does not work either.

Any help would be appreciated.
IntentsBroadcasts
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
Your mistake is that it's not a broadcast, it's a service start. If you setup a service in your app to respond to that intent filter it'll work.

You didn't link the docs to which you are referring. If they are wrong or misleading please comment back here so we can get it fixed.
10 |2000

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