Skip to content

open goal corresponding to goal of tapped notification #645

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

krugerk
Copy link
Contributor

@krugerk krugerk commented Apr 8, 2025

This is the app side. Rather than parsing the alert title for the slug as was done in the previous PR, this one works with the notification that provides the goalname (slug) directly as part of the user info.

On the server side, the code in #41 (comment) needs yet to be adjusted to something like the following:

-notification = Apnotic::Notification.new(token)
-notification.topic = "com.beeminder.beeminder"
-notification.alert = goal.alert_text(type)
-notification.badge = eep_count
-notification.sound = "default"
-notification.apns_collapse_id = goal.shortname
+
+notification = Apnotic::Notification.new(token)
+notification.topic = "com.beeminder.beeminder"
+notification.alert = goal.alert_text(type)
+notification.badge = eep_count
+notification.sound = "default"
+notification.apns_collapse_id = goal.shortname
+
+notification.custom_payload = {
+  "userInfo" => {
+    "goalname" => goal.shortname
+  }
+}

Fixes #41

Summary

Open the goal corresponding to the tapped notification.

Validation

Testing by dropping a .apns file into the simulator.

@krugerk krugerk requested a review from a team as a code owner April 8, 2025 09:36
@krugerk krugerk requested review from theospears and removed request for a team April 8, 2025 09:36
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.

Entering app from notification should take you to the goal not the gallery
1 participant