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

Actionable Notifications #916

Merged

Conversation

RCGV1
Copy link
Member

@RCGV1 RCGV1 commented Sep 4, 2024

What changed?

Creates Actionable notifications for DMs and channel messages. Includes thumbs down/up tapbacks and reply.

Why did it change?

Useful for quite responses and watch OS.

How is this tested?

on my iPhone

Screenshots/Videos (when applicable)

IMG_D3D0EDA4C83E-1

Checklist

  • My code adheres to the project's coding and style guidelines.
  • I have conducted a self-review of my code.
  • I have commented my code, particularly in complex areas.
  • I have made corresponding changes to the documentation.
  • I have tested the change to ensure that it works as intended.

@RCGV1 RCGV1 requested a review from garthvh September 4, 2024 16:50
@RCGV1
Copy link
Member Author

RCGV1 commented Sep 4, 2024

The new PR

Meshtastic/Helpers/BLEManager.swift Show resolved Hide resolved
let replyInputAction = UNTextInputNotificationAction(
identifier: "messageNotification.replyInputAction",
title: "reply".localized,
options: [])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation in this diff off. Can we fix this by running the linter?

identifier: "messageNotificationCategory",
actions: [thumbsUpAction, thumbsDownAction,replyInputAction],
intentIdentifiers: [],
options: .customDismissAction
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

if let userInput = (response as? UNTextInputNotificationResponse)?.userText,
let channel = userInfo["channel"] as? Int32,
let replyID = userInfo["messageId"] as? Int64 {
let tapbackResponse = !BLEManager.shared.sendMessage(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two questions here:

  • It looks like for each of these the variable tapbackResponse is never used. Can they be removed?
  • Do we need to consider any edge-cases that could cause this to crash? (ie: BLE is disconnected)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sendMessage returns a boolean if it fails or goes through. For logging purposes we could use it.

@garthvh garthvh changed the base branch from main to actionable-notifications September 11, 2024 18:20
@garthvh
Copy link
Member

garthvh commented Sep 11, 2024

Merging into a branch in the repo for testing

@garthvh garthvh merged commit 8726f41 into meshtastic:actionable-notifications Sep 11, 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.

3 participants