Crearemos una ventana con la siguiente estructura:
- TextInput_email_push
- TextInput_mensaje_push
- Button_enviar_push
Crearemos un flujo en Power Automate, con 3 opciones:
- Mensaje. Contendrá el mensaje que se teclea en TextInput_mensaje_push.
- Notifica. Contendrá el email donde se enviará el push en TextInput_email_push.
- Parametro. Podremos enviar un dato de un variable.
Selecionamos Send push notification V2.
Seleccionaremos:
- Mobile app: Power Apps.
- Your app: Deberás seleccionar el nombre de tu app donde se ejecutará el flujo.
- Recipients Item - 1. Contendra el email.
- Message. El mensaje que se visualizara en el push.
- Open app: Yes = abre la app al presionar sobre el push.
- Parameters. Contendrá la variable con el dato a mostrar.
En el evento OnSelect de botón tecleamos:
Set(vFolio, 123);
enviar_push.Run(TextInput_mensaje_push.Text, TextInput_email_push.Text, "Black")
Para poder ver las notificaciones en el móvil, debemos habilitar las notificaciones del Power Apps.
Ejecutamos la app y presionamos en botón "Enviar push"
Se visualizará en el móvil el push, al presionar sobre él se abrira la app.
ClearCollect(
ListaCorreos,
["hugo@email.com", "paco@email.com", "luis@email.com"]
);
ForAll(
ListaCorreos,
enviar_push.Run(TextInput_mensaje_push.Text,ThisRecord.Value, "Black")
)