Hi,
I am new in firebase.
I have a requirement where users will need to receive realtime notifications even if they havent launch the app by clicking it on the android drawer.
I am creating an android app with a background service which need to be started as soon as the android system finish to start (on BOOT_COMPLETED) and STICK alive. The service seem to work fine for earlier version of android (below android 3 ) but fails to work for version 4 higher.
Here is how i initiate firebase in the service:
@Override
public void onCreate() {
super.onCreate();
Firebase.setAndroidContext(this);
initFireBase();
}
private void initFireBase() {
notifications = new LinkedList<Notification>();
Toast.makeText(this, "Firebase initiated", Toast.LENGTH_LONG).show();
firebase = new Firebase("https://incandescent-inferno-2910.firebaseio.com/company-id/notifications/user-id/2015-03-02");
firebase.addChildEventListener(this);
Log.d("NotificationFirebase", "firebase initiated");
}
UNFORTUNATELY THE SERVICE IS NEVER INITIATED.
Can someone kindly help, I need users to start receive any available notification as long as their mobile phone are on.
Thanks in advance