Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/deveshrx/dev-push-notification
Push Notification for Android
https://github.com/deveshrx/dev-push-notification
Last synced: about 4 hours ago
JSON representation
Push Notification for Android
- Host: GitHub
- URL: https://github.com/deveshrx/dev-push-notification
- Owner: DeveshRx
- License: mit
- Created: 2021-09-23T12:26:05.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2021-09-29T13:44:23.000Z (about 3 years ago)
- Last Synced: 2023-03-01T10:52:06.401Z (over 1 year ago)
- Language: Java
- Size: 275 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dev Push Notification
[![Release](https://jitpack.io/v/DeveshRx/Dev-Push-Notification.svg)](https://jitpack.io/#DeveshRx/Dev-Push-Notification)
A Front UI & Backend base for push notification feature in Android App.
## Features
- Simple UI for Notification Stack
- Fully Customizable
- Supports FCM (Firebase Cloud Messaging)## How to Use ?
- Setup Firebase Cloud Messaging (FCM) according to these instructions
[https://firebase.google.com/docs/cloud-messaging/android/client](https://firebase.google.com/docs/cloud-messaging/android/client)- Add the JitPack repository to your project build file
```
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}- Add the dependency
```
dependencies {
implementation 'com.github.DeveshRx:Dev-Push-Notification:1.0.2'
}- Create a `Service` named `MyFirebaseMessagingService.java` and extend it with `FirebaseMessagingService`.
- Create `onMessageReceived` function and insert following code in it:
```
DevNotificationTool devNotificationTool=new DevNotificationTool(this);
devNotificationTool.NotificationCapture(remoteMessage);- Subscribe to Topic in FCM with following code:
```
void SubscribeToTopic(){
DevNotificationTool devNotificationTool=new DevNotificationTool(this);
devNotificationTool.NotificationSubscribe("general");
// For Unsubscribe
// notiDataManager.NotificationUnSubscribe("general");
}- Start `NotificationActivity` whenever user want to view notifications
```
Intent intent=new Intent(this, NotificationActivity.class);
startActivity(intent);