-
-
Notifications
You must be signed in to change notification settings - Fork 28
Broadcast Events API
For applications which are utilizing CommCare's internal API's, CommCare signals certain events through Broadcast Notifications on the device. Any application can receive these events regardless of their permissions status re:CommCare permissions, etc.
In order to use this API, you'll need
- An application installed in CommCare
CommCare will broadcast certain Intents when events occur on the device that may be of note to external applications. For instance, an application could use the update event to refresh its (in memory) cache of API data.
**Action: ** org.commcare.dalvik.api.action.data.update
Fired when CommCare has finished a write to its database. Applications receiving this event may want to refresh any caches they are holding in memory of app data.
**Action: ** org.commcare.dalvik.api.action.session.login
Fired when a user has logged into CommCare, and the content provider for that user's sandbox is available to applications with the appropriate permissions.
**Action: ** org.commcare.dalvik.api.action.session.logout
Fired when a user session has ended. After this event the app content providers will no longer provide any data. Note - Since data is decrypted by the current user's session this is not the only way in which that session can end. If the app crashes or other wayward behavior occurs that causes the user's keys to be dropped from working memory, this event may not be fired if outside of the application's control.