You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This guide provides steps to troubleshoot issues with push notifications using the `hemlock-sendmsg` daemon. Follow these steps to identify and resolve problems with notifications on both iOS and Android devices.
4
7
5
-
## Common Issues
6
-
1.**Notifications not received on iOS or Android.**
7
-
2.**Notifications received, but they do not open the correct screen.**
8
-
3.**Push notifications work on one platform but not the other.**
9
-
4.**Receiving errors when sending push notifications manually.**
10
-
11
8
## General Debugging Steps
12
9
13
-
### 1. Verify Build and Device Registration
14
-
- Ensure that the device has the correct build version of the app:
15
-
-**Android:** Version should be at least 3.1.0.x. Check via `Play Store >> Profile Icon >> Manage apps & device >> Acorn >> About this app`.
16
-
-**iOS:** Version should be at least 3.1.0 (x). Check via TestFlight or App Store.
17
-
- Confirm the device is registered to receive push notifications:
18
-
- Only one device can be registered for push notifications per patron account. The last device to log in will be the active one.
10
+
### Verify App Version
11
+
<details>
12
+
Ensure that the device has the correct build version of the app:
13
+
-**Android:** Version should be at least 3.1.0.x. Check via `Play Store >> Profile Icon >> Manage apps & device >> Acorn >> About this app`.
14
+
-**iOS:** Version should be at least 3.1.0 (x). Check via TestFlight or App Store.
15
+
</details>
16
+
17
+
### Only One Device per Account
18
+
<details>
19
+
Only **one device per patron account** can be registered for push notifications. The last device to log in will be the active one.
20
+
</details>
19
21
20
-
### 2. Check Notification Permissions
21
-
- Ensure that notifications are enabled for the app:
22
-
-**iOS:** Go to `Settings >> Notifications >> Acorn Catalog` and allow notifications.
23
-
-**Android:** Ensure notification permissions are granted in `Settings >> Apps >> Acorn >> Notifications`.
22
+
### Check Notification Permissions
23
+
<details>
24
+
Ensure that notifications are enabled for the app:
25
+
-**iOS:** Go to `Settings >> Notifications >> Acorn Catalog` and allow notifications.
26
+
-**Android:** Ensure notification permissions are granted in `Settings >> Apps >> Acorn >> Notifications`.
27
+
</details>
24
28
25
29
### 3. Test Push Notifications Manually
30
+
<details>
26
31
- Use `curl` to manually send a push notification to the device:
27
32
- Obtain the push notification token by querying the database.
28
33
@@ -37,10 +42,14 @@ This guide provides steps to troubleshoot issues with push notifications using t
- If you see "Auth error from APNS or Web Push Service," ensure the APNs Authentication Key is correctly configured in the Firebase project.
45
+
- Watch for errors in the `hemlock-sendmsg` output:
46
+
```bash
47
+
sudo journalctl -fu hemlock-sendmsg
48
+
```
49
+
</details>
42
50
43
-
### 4. Verify `hemlock-sendmsg` Daemon Status
51
+
### Verify Latest `hemlock-sendmsg` Daemon
52
+
<details>
44
53
- Ensure the `hemlock-sendmsg` daemon is updated to the latest version.
45
54
- Restart the daemon after pulling the latest code:
46
55
~~~bash
@@ -58,8 +67,10 @@ This guide provides steps to troubleshoot issues with push notifications using t
58
67
~~~
59
68
2024/09/0511:10:02 INFO GET /send result=ok code=200 username=xxx title="xxx" type="holds" body="xxx" token=xxx
60
69
~~~
70
+
</details>
61
71
62
-
### 5. Confirm Action Trigger Configuration
72
+
### Confirm Action Trigger Configuration
73
+
<details>
63
74
- Ensure that the action triggers are correctly configured in Evergreen:
64
75
- Example action trigger for hold notifications:
65
76
~~~xml
@@ -73,30 +84,46 @@ This guide provides steps to troubleshoot issues with push notifications using t
73
84
</Parameters>
74
85
~~~
75
86
- Confirm that the `type` parameter is correctly set to target specific screens (`holds`, `checkouts`, etc.).
87
+
</details>
76
88
77
-
### 6. Verify Firebase and APNs Configuration
78
-
- Ensure that the Firebase project has the correct APNs key and Team ID set up.
79
-
- If notifications work for some types but not others, ensure that all notification types are registered correctly in the app's source code.
89
+
## Specific Troubleshooting Steps
80
90
81
-
## Specific Troubleshooting Steps for Common Scenarios
91
+
### General Scenarios
82
92
83
-
### A. iOS Notifications Not Working
84
-
1. Ensure the device is the last one to sign in.
85
-
2. Verify the APNs configuration in Firebase.
86
-
3. Test manually with `curl` and check for errors related to authentication.
93
+
#### iOS Notifications Not Working
94
+
<details>
95
+
1. Ensure the device is the last one to sign in (force quit the app and sign in again).
96
+
2. Test manually with `curl`andcheck for errors in the `hemlock-sendmsg` output.
97
+
</details>
87
98
88
-
### B. Android Notifications Not Working
99
+
#### Android Notifications Not Working
100
+
<details>
101
+
1. Ensure the device is the last one to sign in (force quit the app and sign in again).
89
102
1. Verify that the app build is up-to-date.
90
-
2. Check notification channels registered in the app's settings.
91
-
3. Ensure the daemon sets the `type` correctly for selective disabling by channel.
103
+
1. Check notification channels registered in the app's settings.
104
+
1. Ensure the daemon sets the `type` correctly for selective disabling by channel.
105
+
</details>
92
106
93
-
### C. Notifications Open Incorrect Screens
107
+
#### Notification Opens the Wrong Screen in the App
108
+
<details>
94
109
1. Ensure the `type` parameter in the action trigger is correct.
95
110
2. Verify that the app's code correctly handles the `type` parameter and routes to the appropriate screen.
111
+
3. (Android only) Verify the app is registering the channel (search for "notification_channel_register_checkouts_channel").
112
+
</details>
113
+
114
+
### Errors in the `hemlock-sendmsg` output
115
+
116
+
#### "Auth error from APNS or Web Push Service"
117
+
<details>
118
+
1. Ensure the APNs Authentication Key is correctly configured in the Firebase project.
119
+
</details>
120
+
121
+
### Errors in the app
96
122
97
-
### D. Errors When Sending Notifications Manually
98
-
1. Check for missing or incorrect parameters in the `curl` command.
99
-
2. Ensure that the `hemlock-sendmsg` daemon is updated and configured properly.
123
+
#### "500 Error" after signing in
124
+
<details>
125
+
1. Ensure the User Setting Type is created. After signing in, the app tries to store the push notification token in the database, and it gets this error if the User Setting Type is missing. See [Push Notification Setup Guide](../pn-setup-guide/create-an-action-trigger).
126
+
</details>
100
127
101
128
## Additional Notes
102
129
- The `hemlock-sendmsg` daemon filters out requests with an empty `token` parameter, so it does not attempt to send a push notification to a patron that does not use the app. The `EmptyToken` metric tracks the number of such requests. Refer to the [README](https://github.com/kenstir/hemlock-sendmsg/blob/main/README.md#collecting-metrics) for more details.
0 commit comments