【问题标题】:Open a custom Intent when click on notification for Firebase notification payload单击 Firebase 通知有效负载的通知时打开自定义 Intent
【发布时间】:2017-04-04 13:35:58
【问题描述】:

当点击通知时,它应该会打开一个自定义 Intent for Firebase 通知负载。

当设置任何 Intent 名称时,click_action 返回 null

那么,是否可以在点击通知时设置 Intent。

【问题讨论】:

    标签: firebase push-notification notifications payload firebase-notifications


    【解决方案1】:

    click_action:表示与用户点击相关的动作 通知。设置后,具有匹配意图的活动 过滤器在用户点击通知时启动。

    所以你必须在清单文件中为你的活动添加意图过滤器。

    <intent-filter>
        <action android:name="clikcActionNameHere"/>
        <category android:name="android.intent.category.DEFAULT"/>
    </intent-filter>
    

    【讨论】:

    • 在哪个属性上,需要添加一个匹配的intent filter?你举个例子吗?
    • @Newton 示例已添加。
    猜你喜欢
    • 1970-01-01
    • 2016-09-21
    • 1970-01-01
    • 2017-10-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多