@Override
    public void onReceive(Context context, Intent intent) {
        Log.d(TAG, "Received action: " + intent.getAction());

        // The device was booted and is unlocked
        if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED) ||
            // The app was updated
            intent.getAction().equals(Intent.ACTION_MY_PACKAGE_REPLACED) ||
            // The app is granted the SCHEDULE_EXACT_ALARM permission
            intent.getAction().equals(AlarmManager.ACTION_SCHEDULE_EXACT_ALARM_PERMISSION_STATE_CHANGED)) {

            List<Notification> notifications = new Manager(context).getNotificationsFromSharedPreferences();
            Log.d(TAG, "Restoring notifications, count: " + notifications.size());

            for (Notification notification : notifications) {
                notification.schedule();
            }
        }
    }
Called when alarms and notifications need to be restored.
@param context Application context
@param intent Received intent with content data
src/android/receiver/RestoreReceiver.java