Add missing Android messaging file for local notifications; Document local notification setup

This commit is contained in:
Chris Bianca
2017-03-27 13:48:50 +01:00
parent e25dd05576
commit 10656ce698
2 changed files with 40 additions and 0 deletions
@@ -0,0 +1,27 @@
package io.invertase.firebase.messaging;
import android.app.Application;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import java.util.ArrayList;
import android.os.Bundle;
import android.util.Log;
/**
* Set alarms for scheduled notification after system reboot.
*/
public class RNFirebaseSystemBootEventReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Log.i("FCMSystemBootReceiver", "Received reboot event");
RNFirebaseLocalMessagingHelper helper = new RNFirebaseLocalMessagingHelper((Application) context.getApplicationContext());
ArrayList<Bundle> bundles = helper.getScheduledLocalNotifications();
for(Bundle bundle: bundles){
helper.sendNotificationScheduled(bundle);
}
}
}