Skip to content

Repository files navigation

EasyNotify

An Android Library to send Firebase notifications to users easily.

Demo

With empty EditTextCompleted all EditTextFinal ResultDemo Video

Download

  • Step 1. Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url'https://jitpack.io' }
}
}
  • Step 2. Add the dependency
dependencies {
compile'com.github.iammannan:EasyNotifyLibProject:1.2'
}

EasyNotify

  • Initialize
EasyNotifyeasyNotify = newEasyNotify("YOUR_APP_API_KEY");
  • Send by TOPIC or TOKEN
easyNotify.setSendBy(EasyNotify.TOPIC);
oreasyNotify.setSendBy(EasyNotify.TOKEN);
  • IF Send by TOPIC
easyNotify.setTopic("YOUR_TOPIC");
  • IF Send by TOKEN
easyNotify.setToken("YOUR_FIREBASE_TOKEN");
  • Notification Optional Parameters
easyNotify.setTitle("YOUR_TITLE_STRING");
easyNotify.setBody("YOUR_BODY_STRING");
easyNotify.setClickAction("YOUR_CLICK_ACTION");
easyNotify.setSound("default");
  • Push your Notificaton to Firebase server
easyNotify.nPush();
  • Set EasyNotify Listener, Check your push request success or not.
easyNotify.setEasyNotifyListener(newEasyNotify.EasyNotifyListener() {
@OverridepublicvoidonNotifySuccess(Strings) {
Toast.makeText(MainActivity.this, s, Toast.LENGTH_SHORT).show();
}
@OverridepublicvoidonNotifyError(Strings) {
Toast.makeText(MainActivity.this, s, Toast.LENGTH_SHORT).show();
}
});
  • Full Code - Example
EasyNotifyeasyNotify = newEasyNotify(api_key.getText().toString());
easyNotify.setSendBy(EasyNotify.TOPIC);
easyNotify.setTopic(topic.getText().toString());
easyNotify.setTitle(title.getText().toString());
easyNotify.setBody(body.getText().toString());
easyNotify.setClickAction(click_action.getText().toString());
easyNotify.setSound(sound.getText().toString());
easyNotify.nPush();
easyNotify.setEasyNotifyListener(newEasyNotify.EasyNotifyListener() {
@OverridepublicvoidonNotifySuccess(Strings) {
Toast.makeText(MainActivity.this, s, Toast.LENGTH_SHORT).show();
}
@OverridepublicvoidonNotifyError(Strings) {
Toast.makeText(MainActivity.this, s, Toast.LENGTH_SHORT).show();
}
});

About

Send firebase notifications to your users very easily: A new Android Lib

Topics

Resources

Stars

32 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages