-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/kaiwinter/android-remote-…
- Loading branch information
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# android-remote-notifications | ||
An Google GCM/Amazon SNS alternative | ||
## Main features | ||
- Independent user notifications (no Google GCM or Amazon SNS), just put a JSON file in the cloud | ||
- Framework will update available notifications automatically in defined time intervals (`now`, `daily`, `weekly`, `monthly`) | ||
- Flexible parameters: | ||
- start date for notification (distribute early, show later) | ||
- amount of times the notification should be shown | ||
- interval between showing notifications (`always`, `every day`, `every week`, `every month`) | ||
- specify on which app version (`versionCode`) the notification should be shown | ||
- Show notifications as `AlertDialog` or `Toast` message (defined by the remote JSON file) | ||
- `AlertDialog`: Specify button captions and actions: `Open Store`-Action, `Open URL`-Action, `Exit App`-Action, all defined by a JSON file on your server | ||
- perfect to inform your users about discounts on one of your other apps or premium version | ||
- pro tip: as some users don't always update to the latest app versions you should integrate this framework in an early phase if you plan to use it at a later time. | ||
|
||
## How to integrate | ||
### The easy way | ||
- Call `RemoteNotifications.start(context, url, UpdatePolicy.NOW);` in your `onCreate()` or `onResume()` method | ||
|
||
this will | ||
- start an update of the notifications (use `UpdatePolicy.WEEKLY` in production environment to update once a week) | ||
- show due notifications to the user | ||
|
||
### If you want more control | ||
```java | ||
RemoteNotifications rn = new RemoteNotifications(context); | ||
rn.updateNotifications(UpdatePolicy.NOW); | ||
rn.showNotifications(); // if update still runs, event will be queued and carried out later | ||
|
||
// -or, register a listener on update completion- | ||
rn.updateNotifications(UpdatePolicy.NOW, finishListener); | ||
``` | ||
|
||
## Demo | ||
### App | ||
[Download](https://drive.google.com/uc?export=download&id=0B0qVR-zttDRCeXo0SF9RMVhZZHM) | ||
### Source | ||
[MainActivity](https://github.com/kaiwinter/android-remote-notifications/blob/master/example/src/main/java/com/github/kaiwinter/androidremotenotifications/example/MainActivity.java) | ||
|
||
## Screenshots | ||
![Preview](http://i.imgur.com/Hp1aowm.png) |