The simplest integration:
Manifest:
Change the receiver class by your own, extending AnnouncementReceiver.java, if you want to track or make other things when announcements events occurs.
<receiver android:name="com.androidsx.announcement.service.SimpleAnnouncementReceiver">
<intent-filter>
<action android:name="com.androidsx.announcement.event" />
</intent-filter>
</receiver>Note: Take care to call super into the methods onPushOpen and onDialogOpen of your own Receiver class.
See the basic receiver implementation:
SimpleAnnouncementReceiver.java
Application:
AnnouncementManager.init(this, iconResId, appNumUses, JSON URL);Activity:
Where you want to show a dialog.
AnnouncementManager.with(this).fetch().launchDialogAnnouncementIfApply(this, getFragmentManager());Note: The pushes will be launched by the internal service called by the scheduled alarm at the hour inidicated in the push parameter.
Licensed under the MIT License. See the LICENSE.md file for more details.