本文 介绍:json
使用Send push notification 想移动端Power Apps 推送消息。canvas
实现功能:微信
1.当有文件上传到Storage Account 的Container中时,自动向Power Apps 发送推送通知,在手机上能够看到消息通知弹窗。app
2.消息带有参数,点击弹窗能够打开Power Apps 并将参数传递给页面。post
如上图,能够显示具体那个 app 收到的通知,也能够显示通知的自定义内容。测试
能够设置点击通知,打开指定的Power Apps并将通知中的参数传递到指定的页面中。ui
如上图中的文本框里的内容即为通知传递的参数。云计算
本文参考文档:spa
https://docs.microsoft.com/zh-cn/connectors/powerappsnotificationv2/设计
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/add-notifications
视频演示:
https://www.51azure.cloud/post/2021/1/25/power-apps-send-push-notification
图文步骤:
在Power Apps中点击 Power Automate,Create New Flow,进入Power Automate 设计页面。
在Power Automate页面点击Create,Automated Cloud Flow,在弹窗的trigger触发器中输入blob,以下图所示,选中Azure Blob Storage触发器,输入一个Flow Name,点击建立。
在Azure Portal上找到你的Storage Account的帐号和key,填写到Power Automte页面:
选择一个要监控的Container,而后点击new step:
在搜索框中输入 send push notification,并在下方列表中找到 Power Apps Notification V2-Send push notification V2
在页面中Mobile App下拉列表中选择Power Apps,在Your Apps 中选择要显示通知的App
在Recipients Item-1中输入 哪一个帐号要收到通知,这里咱们便于测试,填写了你登陆Power Apps的邮箱(实际的项目中,大部分状况该邮箱可能从上一步中传递过来或者触发给指定的一组邮箱)
在Message中输入推送消息的内容,其中支持参数传递,以下图,将显示“new file uploaded, file path:” 其中后边的路径来自于上一个步骤中提供的数据。
Parameters中支持json格式的定义,以下图,咱们将文件路径放到“filepath”这个变量中,App 打开时,能够从这个变量中取到数据。
在Power Apps中取通知传递的参数:
在Power Apps中选中某个控件,例以下图选中了一个文本框,将其公式设置为 Param("filepath"),其中“filepath”为通知中设定的Parameters中的Key。
测试:在Storage Account中指定的container上传文件,Power Apps 手机端收到通知:
同时在Power Automate中的flow的历史记录中,能够看到执行成功的记录:
点击可查阅本站文章目录 《文章分类目录》
本站全部内容仅表明我的观点,如与官文档冲突,请以官方文档为准。
可在本页面下方留言或经过下方联系方式联系我:
微信:wxyusz;邮箱:shuzhen.yu@foxmail.com
欢迎关注公众号“云计算实战”,接收最新文章推送。
本做品由Sean Yu 采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议进行许可。
欢迎转载、使用、从新发布,但务必保留文章连接:https://www.51azure.cloud,且不得用于商业目的。