Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] FCM enhancements #462

Merged
merged 8 commits into from
Jun 26, 2024
Merged

Conversation

digitaldan
Copy link
Contributor

@digitaldan digitaldan commented Jun 23, 2024

** Edited with updated JSON **

This will support allowing openHAB to send much more complex data types to FCM. This also helps support actions, specifically with IOS and dynamically creating actionable categories.

see openhab/openhab-android#3193

sample push payload from openHAB might look like

{
  "media-attachment-url": "https://upload.wikimedia.org/wikipedia/commons/thumb/0/07/OpenHAB_logo_2.svg/541px-OpenHAB_logo_2.svg.png",
  "message": "Someone is at the Gate 2",
  "on-click": "navigate:mainui:popup:widget:gate_control",
  "actions": [
    {
      "title": "Turn Office ON",
      "action": "command:F1_DansOffice_Light:ON"
    },
    {
      "title": "Turn Office OFF",
      "action": "command:F1_DansOffice_Light:OFF"
    },
    {
      "title": "Go To Office",
      "action": "ui:navigate:/page/roomDanOffice"
    }
  ]
}

@mueller-ma
Copy link
Member

Maybe on-click instead of navigate as using pops here doesn't sound as "navigation" to me.

Signed-off-by: Dan Cunningham <[email protected]>
Signed-off-by: Dan Cunningham <[email protected]>
Signed-off-by: Dan Cunningham <[email protected]>
@digitaldan
Copy link
Contributor Author

@mueller-ma how about click-action ?

@digitaldan
Copy link
Contributor Author

digitaldan commented Jun 25, 2024

Actually i guess on-click makes it more clear when describing in the cloud binding for rules. So i'll go with that for now.

My original thought was that the only action that makes sense when clicking on the notification is a navigate command. So i was not planning on supporting a command action. Playing devils advocate, i guess supporting the same "action" we have in action buttons here would give the user more power, and might be easier to explain, and i guess i could see sending a command to an item when clicking to do something like an acknowledgment instead of bringing the app to the foreground.

@mueller-ma let me know if you have an opinion.

@digitaldan
Copy link
Contributor Author

After sleeping on it, i kinda like making the "action" format consistent, and that format can be used both in the on-click, and in the dynamic actions buttons.

@digitaldan digitaldan merged commit 48e37d7 into openhab:main Jun 26, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants