Pull Notification 0.8 0.0 Java Notification TO GO

Overview

Full FCM Push/Pull Notification

Featured In :

Image

Index

Overview

FCM push/pull notification is a library that facilitate interaction with firebase could messaging either for pushing notification or receiving messages , and it also facilitate grouping people on topic or channel

Features

  • Push notification to group of peaple subscribed to some topic or them tokens
  • Receive Firebase push messages
  • Subscribe or unsubscribe user device to topic or list of topics
  • Ability to build and launch notification (foregournd)
  • Custom notifaction sound at foreground,background and killed status
  • Ability to send extra data with pushing notification

Prerequisites

Add the firebase dependency to your app-level build.gradle file

apply plugin: 'com.google.gms.google-services'

Add the library dependency in your app-level build.gradle file

dependencies {
              ...
    implementation 'com.github.MustafaGamalAbbas:Full_FCM_Push-Pull_Notification:1.05'
}

Add jitpack.io to your project-level build.gradle file :

allprojects {
  		repositories {
  			```
  			maven { url 'https://jitpack.io' }
  		}
  	}

Add google-services to your project-level build.gradle file :

dependencies {
       ``
       classpath 'com.google.gms:google-services:3.0.0'
  }

Usage

Subscription

        //1- Subscribe user device to topic
		FCMSubscriptionManager.getInstance(this).subscribeToTopic("TopicName");
	//2- Unsubscribe user device from topic 
	        FCMSubscriptionManager.getInstance(this).unsubscribeFromTopic("TopicName");
	//3- Unsubscribe user device to list of topics 
		FCMSubscriptionManager.getInstance(this).unsubscribeAll();
	//4- Subscribe user device from all subscribed topics
		FCMSubscriptionManager.getInstance(this).subscribeListOfTopics(listOfTopics) //listOfTopics ( list of string )

Pulling

  • Init
	// at Activity 
           FCMPullNotificationManager manager = FCMPullNotificationManager.getInstance(this);
	// at Fragment 
	   FCMPullNotificationManager manager = FCMPullNotificationManager.getInstance(getContext());
  • Register FCM Callback
	// make to activity or fragment implement IPullFCMCallback and use this line. 
		(Like YourActivity implement IPullFCMCallback) 
	 	manager.registerListener( this);
	// or make an anonymous class 
		 manager.registerListener(new IPullFCMCallback() {
		    @Override
		    public void onMessageReceived(RemoteMessage message) {
			// it will be called reveive notification for FCM 
		    }

		    @Override
		    public void onDeviceRegistered(String tokenId) {
			// it will be called when user device register for first time (first run application) 
		    }

		    @Override
		    public void onErrorHappened(String errorMessage) {
			// it will be called when something wrong happened 
		    }
        });
  • Auto launch notification (Optional)
	// just tell manager that you will handle notification
 	manager.autoLaunchNotification(builder);
	// builder!? 
	// build a Notificationbuilder that has all properties you need , that will affect on apprance and properties of notification 
 	 NotificationBuilder builder = new NotificationBuilder(this) // this--> Context, if you will use fragment ,use getContext()
	// should set intent that has the launched activity (
	 .setContentIntent(new Intent(getApplicationContext(), YourActivity.class))
	// icon notification that will be at foreground ONLY, 
	// at background the app icon will be in notification that's handle by firebase
	 .setNotificationIcon(id)
	// make your notification auto cancelled 
	 .setAutoCancel(true)
	// make sound of notification is defualt sound of device 
	.setDefaultSound()
	// set custom sound for notification (foreground and background)
	.setCustomSound(customSound)
	// customize notification title 
	.setNotificationTitle("Your custom title")
	// customize notification Message
	.setNotificationMessage("Your cutsom messages ")

Pushing

  • Init

Getting ServerKey

	// initiate and send your server key 
    	FCMPushNotificationManager manager = FCMPushNotificationManager.getInstance(serverKey);
  • Register FCM Callback
	// make to activity or fragment implement IPushFCMCallback and use this line. 
		(Like YourActivity implement IPushFCMCallback) 
	 	manager.registerListener( this);
	// or make an anonymous class 
		manager.setPushFCMCallback(new IPushFCMCallback() {
                    @Override
                    public void onPushNotificationSuccess() {
                       // on pushinh notification  
                    }

                    @Override
                    public void onError(String errorMessage) {
                       // on can't push notification  
                    }
                });
  • Send Notification
	// You can notify through 4 ways as following 
	
	//1- Notify group of people subscribed to some topic
	   manager.notifyByTopic("Title", "Message","TopicName")
	//2-Notify list of groups of people subscribed to some topics
	   manager.notifyByTopics("Title", "Message",ListOfTopics) //ListOfTopics --> List of String 
	//3-Notify just one person through his/her TokenID
	   manager.notifyByToken("Title", "Message",userToken)
	//4-Notify just some persons through their TokenID
	   manager.notifyByToken("Title", "Message",listOfTokensID) 
	 //(Optional) you can send extra data with notification    
         .addExtraData(data).send(); //data --> Map<Stirng,Stirng>
	 // To apply the action 
	 .send();

Notes

  • At background/killed status the icon of notification will be the app icon.
  • At background/killed if you use custom sound, the custom sound and default sound will being played so choose sound +1 second.
  • FCM Pull/Push callback will being call if the activity or fragment, so be aware.

License


Copyright 2018 MustafaGamalAbbas <[email protected]>.

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...
Phoenix Pull-to-Refresh

Phoenix Pull-to-Refresh This project aims to provide a simple and customizable pull to refresh implementation. Made in [Yalantis] (https://yalantis.co

 This project aims to provide a reusable pull to refresh widget for Android.
This project aims to provide a reusable pull to refresh widget for Android.

Pull To Refresh for Android Note This library is deprecated, a swipe refresh layout is available in the v4 support library. This project aims to provi

An Android custom ListView and ScrollView with pull to zoom-in.
An Android custom ListView and ScrollView with pull to zoom-in.

PullZoomView An Android custom ListView and ScrollView with pull to zoom-in. Features Set ZoomView enable Add HeaderView Custom ZoomView Parallax or N

Android widget with pull to refresh for all the views,and support loadMore for ListView , RecyclerView, GridView and SwipeRefreshLayout.
Android widget with pull to refresh for all the views,and support loadMore for ListView , RecyclerView, GridView and SwipeRefreshLayout.

CommonPullToRefresh Android widget with pull to refresh for all the views,and support loadMore for ListView,RecyclerView,GridView and SwipeRefreshLayo

A generic, customizable, open source Android ListView implementation that has 'Pull to Refresh' functionality.
A generic, customizable, open source Android ListView implementation that has 'Pull to Refresh' functionality.

Android 'Pull to Refresh' ListView library Demo video: http://www.youtube.com/watch?v=VjmdELnm3GI Project A generic, customizable, open source Android

 android custom listview,with interaction pattern load more and pull to refresh to load data  dinamically
android custom listview,with interaction pattern load more and pull to refresh to load data dinamically

The first thing that i have to say is render thanks to johannilsson because all the part of pull to refresh listview is based in the code of his repos

An Android Library that allows users to pull down a menu and select different actions. It can be implemented inside ScrollView, GridView, ListView.
An Android Library that allows users to pull down a menu and select different actions. It can be implemented inside ScrollView, GridView, ListView.

AndroidPullMenu AndroidPullMenu is an Open Source Android library that allows developers to easily create applications with pull menu. The aim of this

A pull to zoom-in RecyclerView for android
A pull to zoom-in RecyclerView for android

PullZoomRecyclerView Using RecyclerView requires three steps: Step one: use the PullZoomRecyclerView in XML Step two: call the function setAdapter and

A pull to refresh layout for android, the RecyclerRefreshLayout is based on the SwipeRefreshLayout. support all the views, highly customizable, code simplicity, etc.  really a practical RefreshLayout!
A pull to refresh layout for android, the RecyclerRefreshLayout is based on the SwipeRefreshLayout. support all the views, highly customizable, code simplicity, etc. really a practical RefreshLayout!

RecyclerRefreshLayout English | 中文版 RecyclerRefreshLayout based on the {@link android.support.v4.widget.SwipeRefreshLayout} The RecyclerRefreshLayout

A pull-down-to-refresh layout inspired by Lollipop overscrolled effects
A pull-down-to-refresh layout inspired by Lollipop overscrolled effects

JellyRefreshLayout A pull-down-to-refresh layout inspired by Lollipop overscrolled effects Preview Download Gradle: repositories { maven {

A custom SwipeRefreshLayout to support the pull-to-refresh featrue.RecyclerView,ListView,GridView,NestedScrollView,ScrollView are supported.
A custom SwipeRefreshLayout to support the pull-to-refresh featrue.RecyclerView,ListView,GridView,NestedScrollView,ScrollView are supported.

SuperSwipeRefreshLayout A custom SwipeRefreshLayout to support the pull-to-refresh featrue.You can custom your header view and footer view. RecyclerVi

Pull/Drawer/Layer View
Pull/Drawer/Layer View

CurtainView Like DrawerLayout , but can layer both horizontally and vertically . Download Add the library to your module's build.gradle: dependencies

SSPullToRefresh makes PullRefresh easy to use, you can provide your own custom animations or set simple gifs on refresh view. The best feature is Lottie animations in refresh view, it uses lottie animations to render high quality animations on pull refresh. 🎉💥 Gradle Plugin to automatically upgrade your gradle project dependencies and send a GitHub pull request with the changes
Gradle Plugin to automatically upgrade your gradle project dependencies and send a GitHub pull request with the changes

Gradle Plugin to automatically upgrade your gradle project dependencies and send a GitHub pull request with the changes

Android app to fetch closed pull request of any public repo

Pullr Android app to fetch closed pull request of any public repo 🌟 Features Co

Android app to fetch closed pull request of any public repo

Pullr Android app to fetch closed pull request of any public repo 🌟 Features Co

Manage pull requests and conduct code reviews in your IDE with full source-tree context.
Manage pull requests and conduct code reviews in your IDE with full source-tree context.

String Manipulation IntelliJ plugin - https://plugins.jetbrains.com/plugin/2162 Sponsored by Manage pull requests and conduct code reviews in your IDE

Android app based on clean architecture and using the github API to show open pull requests

This app is based on clean architecture and using the github API to show open pull requests. The code is made considering all design principles and guidelines.

Releases(1.05)
Owner
null
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
PPNS(public-push-notification-service) for android SDK

Public Push Notification Service - PPNS What is PPNS? It's a cross-platform messaging solution that lets you reliably send messages for free. Inspired

A-big-fish-in-a-small-pond 3 Jul 21, 2022
Floating Notification for Android app - Facebook ChatHeads Notification system

FloatingView (Application Demo on Play Store) DEPRECATED SEE FloatingView Floating View for Android app - Facebook ChatHeads Notification system This

Fernandez Anthony 530 Nov 17, 2022
Floating Notification for Android app - Facebook ChatHeads Notification system

FloatingView (Application Demo on Play Store) DEPRECATED SEE FloatingView Floating View for Android app - Facebook ChatHeads Notification system This

Fernandez Anthony 530 Nov 17, 2022
Optimize notification icons for ColorOS and adapt to native notification icon specifications

Optimize notification icons for ColorOS and adapt to native notification icon specifications

Fankesyooni 23 Jan 4, 2023
Ultra Pull to Refresh for Android. Support all the views.

Welcome to follow me on GitHub or Twitter GitHub: https://github.com/liaohuqiu Twitter: https://twitter.com/liaohuqiu 中文版文档 Wanna auto-load-more? This

Huqiu Liao 9.6k Jan 5, 2023
Phoenix Pull-to-Refresh

Phoenix Pull-to-Refresh This project aims to provide a simple and customizable pull to refresh implementation. Made in [Yalantis] (https://yalantis.co

Yalantis 4k Dec 30, 2022
A little more fun for the pull-to-refresh interaction.

Pull-to-Refresh.Tours This project aims to provide a simple and customizable pull to refresh implementation. Check this [project on Behance] (https://

Yalantis 1.7k Dec 24, 2022
a custom pull-to-refresh layout which contains a interesting animation

This is a project with custom pull-to-refresh layout which contains a interesting animation. And the animation is inspired by https://dribbble.com/sho

ZhangLei 1.8k Dec 27, 2022
An Android custom ListView and ScrollView with pull to zoom-in.

PullZoomView An Android custom ListView and ScrollView with pull to zoom-in. Features Set ZoomView enable Add HeaderView Custom ZoomView Parallax or N

Frank-Zhu 2.3k Dec 26, 2022