use notification center and background task to flush queue on app backgrounding