Skip to content

Commit 561c773

Browse files
committed
Move details inside collapsible sections
and add specific 500 error section
1 parent 84d66e0 commit 561c773

File tree

1 file changed

+62
-35
lines changed

1 file changed

+62
-35
lines changed
+62-35
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,33 @@
1+
---
2+
sidebar_position: 3
3+
---
14
# Push Notifications Troubleshooting Guide
25

36
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.
47

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-
118
## General Debugging Steps
129

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>
1921

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>
2428

2529
### 3. Test Push Notifications Manually
30+
<details>
2631
- Use `curl` to manually send a push notification to the device:
2732
- Obtain the push notification token by querying the database.
2833

@@ -37,10 +42,14 @@ This guide provides steps to troubleshoot issues with push notifications using t
3742
curl -F token="$token" -F title="New Message" -F body="Test Notification" -F type=holds -F debug=1 http://localhost:8842/send
3843
```
3944

40-
- Check for errors:
41-
- 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>
4250

43-
### 4. Verify `hemlock-sendmsg` Daemon Status
51+
### Verify Latest `hemlock-sendmsg` Daemon
52+
<details>
4453
- Ensure the `hemlock-sendmsg` daemon is updated to the latest version.
4554
- Restart the daemon after pulling the latest code:
4655
~~~bash
@@ -58,8 +67,10 @@ This guide provides steps to troubleshoot issues with push notifications using t
5867
~~~
5968
2024/09/05 11:10:02 INFO GET /send result=ok code=200 username=xxx title="xxx" type="holds" body="xxx" token=xxx
6069
~~~
70+
</details>
6171

62-
### 5. Confirm Action Trigger Configuration
72+
### Confirm Action Trigger Configuration
73+
<details>
6374
- Ensure that the action triggers are correctly configured in Evergreen:
6475
- Example action trigger for hold notifications:
6576
~~~xml
@@ -73,30 +84,46 @@ This guide provides steps to troubleshoot issues with push notifications using t
7384
</Parameters>
7485
~~~
7586
- Confirm that the `type` parameter is correctly set to target specific screens (`holds`, `checkouts`, etc.).
87+
</details>
7688

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
8090

81-
## Specific Troubleshooting Steps for Common Scenarios
91+
### General Scenarios
8292

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` and check for errors in the `hemlock-sendmsg` output.
97+
</details>
8798

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).
89102
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>
92106
93-
### C. Notifications Open Incorrect Screens
107+
#### Notification Opens the Wrong Screen in the App
108+
<details>
94109
1. Ensure the `type` parameter in the action trigger is correct.
95110
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
96122

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>
100127

101128
## Additional Notes
102129
- 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

Comments
 (0)