Pulls notifications from a remote JSON file and shows them in your app.

Overview

Android Arsenal

android-remote-notifications

A Google GCM/Amazon SNS alternative using pull instead of push.

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, bi-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.

Download

Gradle:

implementation ('com.github.kaiwinter:android-remote-notifications:1.1.5@aar') {
    transitive = true
}

Demo:

How to integrate

You can find the source code of the example app here: MainActivity

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

For more control

RemoteNotifications rn = new RemoteNotifications(context, url);
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);

How to build a JSON notification file

First: You don´t have to write the JSON file by hand. Just use the API to initialize a Notification object and then create JSON from it: NotificationCreatorUtil

Example of a Toast Notification

[
  {
    "type": "ToastNotification",
    "notificationConfiguration": {
      "startShowingDate": null,
      "executionPolicy": "ALWAYS",
      "numberOfTotalViews": null,
      "versionCodePolicy": null
    },
    "message": "This is a Toast Notification",
    "duration": 1
  }
]

Example of an AlertDialog Notification

[
  {
    "type": "AlertDialogNotification",
    "notificationConfiguration": {
      "startShowingDate": null,
      "executionPolicy": "ALWAYS",
      "numberOfTotalViews": null,
      "versionCodePolicy": null
    },
    "title": "Title",
    "message": "This is an AlertDialog notification",
    "negativeButtonText": "Exit App",
    "neutralButtonText": "Open web page",
    "positiveButtonText": "Open Play Store",
    "positiveButtonAction": {
      "type": "OpenStoreButtonAction",
      "packageName": "de.vorlesungsfrei.taekwondo.ads"
    },
    "negativeButtonAction": {
      "type": "ExitAppButtonAction"
    },
    "neutralButtonAction": {
      "type": "OpenUrlButtonAction",
      "link": "https://github.com/kaiwinter/android-remote-notifications"
    },
    "modal": false
  }
]

Screenshots

Preview

License

 Copyright 2018 Kai Winter
 
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at
 
     http://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
You might also like...
Find your ideal fitness partners according to your preferences and interact with them whenever you want! All this with no hassle, because there's FitMate! Take timed challenges updated daily, read blogs related to health, and be a part of numerous communities too! During covid times, partner with your FitMate to achieve your fitness goals at home. Custom-view-animated-file-downloader - Custom Views, Animations, Broadcast Receivers, Notifications
Custom-view-animated-file-downloader - Custom Views, Animations, Broadcast Receivers, Notifications

Downloader App Custom views , Drawing with Canvas, Animations (with motionlayout

Dynamic-UI-From-JSON - A Sample Android app to show dynamic UI generation from Json
Dynamic-UI-From-JSON - A Sample Android app to show dynamic UI generation from Json

Dynamic UI from JSON Functionality The app's functionality includes: The app gen

🚀Plugin for Android Studio And IntelliJ Idea to generate Kotlin data class code from JSON text ( Json to Kotlin )
🚀Plugin for Android Studio And IntelliJ Idea to generate Kotlin data class code from JSON text ( Json to Kotlin )

JsonToKotlinClass Hi, Welcome! This is a plugin to generate Kotlin data class from JSON string, in another word, a plugin that converts JSON string to

Quote-App-Kotlin - Quote App Based on MVVM clean architecture getting quote from json file stored in assets

Quotify - Simple Quotes App This app shows the use of ViewModel and ViewModelFac

ICSx⁵ is an Android app to subscribe to remote or local iCalendar files (like time tables of your school/university or event files of your sports team).

ICSx⁵ ICSx⁵ is an Android app to subscribe to remote Webcal feeds / iCalendar files (like time tables of your school/university or event files of your

 Images grid JSON | Сетка изображений JSON
Images grid JSON | Сетка изображений JSON

Images grid JSON | Сетка изображений JSON Задача Разработать приложение: Приложение должно получать JSON-список ссылок на изображения с сервера по адр

xls2json - Read in Excel file (.xls, .xlsx, .xlsm) and output JSON

xls2json Read in Excel file (.xls, .xlsx, .xlsm) and output JSON. Evaluates formulas where possible. Preserve type information from Excel via JSON typ

Gradle-i18n-plugin is meant for generating a JSON file with internationalized texts, based on a Google Sheet.
Gradle-i18n-plugin is meant for generating a JSON file with internationalized texts, based on a Google Sheet.

Gradle-i18n-plugin Gradle-i18n-plugin is meant for generating a JSON file with internationalized texts, based on a Google Sheet. The plugin assumes th

A specific format represent file directory in Json

CascadeJson.kt A specific format represent file directory in Json Provide a function for convert to map or json string in Kotlin Usage Download zip fi

A tool translate a apk file to stantard android project include so hook api and il2cpp c++ scaffolding when apk is a unity il2cpp game. Write code on a apk file elegantly.

FakerAndroid (FakerAndroid.jar or FakerAndroid-AS) A tool translate a apk file to stantard android project include so hook api and il2cpp c++ scaffold

Notification - Notifications provide short, timely information about events in your app while it's not in use

Notification ⭐ Notifications provide short, timely information about events in y

Unicorn File Picker is a library designed to package a powerful file selector for android.
Unicorn File Picker is a library designed to package a powerful file selector for android.

A simple, documented, and contribution-friendly File Picker for Android.

Audio notifications for your Gradle build status
Audio notifications for your Gradle build status

Let me serenade you 🎶 View Releases and Changelogs 🚨 Currently only functional on Mac OSX 🚨 Serenador is a Gradle plugin that utilizes text-to-spee

MinutesAliveApp - Basic Android App that ask for your date of birth and shows your age in minutes
MinutesAliveApp - Basic Android App that ask for your date of birth and shows your age in minutes

MinutesAliveApp Basic Android App that ask for your date of birth and shows your

Social media app but with new features like translate messages and posts , support video & images as posts  , chat and  notifications , etc...
Social media app but with new features like translate messages and posts , support video & images as posts , chat and notifications , etc...

social-media-app Social media app but with new features like translate messages and posts , support video & images as posts , chat and notifications ,

Demo app demonstrating how to create and manage notifications locally using a combination of Jetpacks Worker Manager and Broadcast Receiver.
Demo app demonstrating how to create and manage notifications locally using a combination of Jetpacks Worker Manager and Broadcast Receiver.

Worker Notification Demo app demonstrating how to create and manage notifications locally using a combination of Jetpacks Worker Manager and Broadcast

Environmental-Monitoring-Android-App - This Android App is used to monitor environmental parameters data from remote sensors
Environmental-Monitoring-Android-App - This Android App is used to monitor environmental parameters data from remote sensors

Environmental-Monitoring-Android-App - This Android App is used to monitor environmental parameters data from remote sensors. Parameters includes but not limited to temperature, humidity, air quality, level of Ionizing radiation, ...

Money Manager app that helps you to add your daily small incomes and expenses and track them easily.
Money Manager app that helps you to add your daily small incomes and expenses and track them easily.

Simple Money Manager This app is a simple money manager app which helps you to add your daily small incomes and expenses and track them easily. Screen

Comments
  • showing notification msg

    showing notification msg

    hi thanks for your great work but if i want to show the notification in my way for example suppose i want to show it in a notification msg how can i do that?

    enhancement hacktoberfest 
    opened by persiansushiant 1
Releases(v1.1.5)
Owner
Kai Winter
Kai Winter
Remote Notification Manager for Kotlin Multiplatform Mobile iOS and android

Remote Notification Manager for Kotlin Multiplatform Mobile Features Super easy to use APNs and FCM in one interface Dramatically reduce code to write

LINE 24 Dec 10, 2022
FCM : FirePush is a lightweight Kotlin/Android library to send FCM push notifications to Android, iOS & Web like a pro.

FirePush - A Lightweight Kotlin Library for sending FCM push notification Hi, I made this Library for a Chat based project I was working on. So I deci

Karandeep Atwal 45 Nov 26, 2022
An android app to display meaning for selected word as notification

Notification Dictionary An Android application to display meaning of selected word as a notification. Features Easy access from all apps that have tex

Karthikeyan Singaravelan 25 Nov 22, 2022
Way to set heartbeat interval and the User receive PushNotifications from GCM. Based on related post in Google Forums about HeartBeat problem.

AndroidHeartBeatFixer Way to set heartbeat interval and the User receive PushNotifications from GCM. Based on a Google Forums post about HeartBeat pro

João Pedro Nardari dos Santos 58 Jun 15, 2021
In-layout notifications. Based on Toast notifications and article by Cyril Mottier (http://android.cyrilmottier.com/?p=773).

Android AppMsg (Crouton) Library Implementation of in-layout notifications. Based on Toast notifications and article The making of Prixing #4: in-layo

Evgeny Shishkin 1.4k Nov 25, 2022
An Android app that pulls the credit score information from a given endpoint and displays the records as a donut view

ClearScoreTest This is an Android app that pulls the credit score information fr

Abayomi Akanji 1 Jan 13, 2022
An easy-to-use, cross-platform measurement tool that pulls data out of CD pipelines and analysis the four key metrics for you.

Maintained by SEA team, ThoughtWorks Inc. Read this in other languages: English, 简体中文 Table of Contents About the Project Usage How to Compute Contrib

Thoughtworks 277 Jan 7, 2023
Bundel is a digital wellbeing Android app, helping you to focus by grouping up notifications and only releasing them in batches

Bundel is a digital wellbeing Android app, helping you to focus by grouping up notifications and only releasing them in batches, at set times. This minimises context switching and improves productivity, while decreasing the impulse to continuously check your phone.

Sebastiano Poggi 238 Dec 27, 2022
Utility logger library for storing logs into database and push them to remote server for debugging

HyperLog Android Overview Log format Download Initialize Usage Get Logs in a File Push Logs Files to Remote Server Sample Testing Endpoint using Reque

HyperTrack 675 Nov 14, 2022
Android Material Json Form Wizard is a library for creating beautiful form based wizards within your app just by defining json in a particular format.

Android Json Wizard Android Json Wizard is a library for creating beautiful form based wizards within your app just by defining json in a particular f

Vijay Rawat 355 Nov 11, 2022