0
In my app I need to send a notification via firebase and run a native android command.
For example, I’m testing this by turning on the flashlight.
When I send the notification with the app opened the flashlight turns on as planned.
However when the app is closed only receive notification.
Has some way to run the same way as if with the app open and turn on the flashlight?
Try to insert codes you have already tested and the problems you faced, so the question does not get too wide to answer.
– Wictor Chaves
@Wictor I did not test code to run with the closed application, the test I did with the open application worked well, I want to know if it is possible to do this with the closed application
– reemy
Qnd gets the open app notification, you treat it in your
FirebaseMessagingService
right? qnd it’s closed, you can do the same, but the notification information will come in yourActivity
input into the Intent Bundle. Something likegetIntent().getExtras();
.– André Ozawa
@Andréozawa yes, in the method onReceiveMessage. So I have to pass the information via extras to receive in Activity? The user will have to click on the notification to execute the command? in case to turn on the flashlight
– reemy
@reemy exactly. It’s the only way I see right now
– André Ozawa