When we see a Farcaster message about unseen count, we're sending notifications so that clients can update their badges. We're using the same storage mechanism as for the keyservers - this is a small shortcut.
Details
Currently tested only on iOS, but will test on other platforms as well:
When the app is opened, or in the background, or killed: open a thread in the Farcaster app and see if the badge count displayed on the app icon is updated consistently with the in-app badge count.
Diff Detail
- Repository
- rCOMM Comm
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
| native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp | ||
|---|---|---|
| 1339 ↗ | (On Diff #50582) | I guess it will be KEYSERVER.FARCASTER.UNREAD_COUNT? Kind of weird, I wonder if we should move the KEYSERVER. concatenation to the JS side |
| services/tunnelbroker/src/notifs/generic_client.rs | ||
| 222–267 ↗ | (On Diff #50582) | Will this change break existing clients in some way? |
| services/tunnelbroker/src/token_distributor/token_connection.rs | ||
|---|---|---|
| 746–747 ↗ | (On Diff #50582) | We should use proper booleans here |
| native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp | ||
|---|---|---|
| 1339 ↗ | (On Diff #50582) | Using this approach allowed us to minimize the effort required - all the mechanisms, including computing the badge count and setting the value, weren't required to change. I'll try to improve this after the whole solution is stable. |
| services/tunnelbroker/src/notifs/generic_client.rs | ||
| 222–267 ↗ | (On Diff #50582) | I don't expect this, but I'll test |
| native/push/push-handler.react.js | ||
|---|---|---|
| 390–401 ↗ | (On Diff #50582) | This one is needed. We're fecthing the data for keyserver by iterating over the connected keyservers, so for Farcaster we also need to do it separately. |
| services/tunnelbroker/src/notifs/generic_client.rs | ||
|---|---|---|
| 222–267 ↗ | (On Diff #50582) | Tested on web and iOS and it works |
We tested this solution on iOS and web. We tried and failed to test it on Android - the only devices that we had access to didn't allow turning on the notifs. We plan to land this diff regardless and test more thoroughly tomorrow.