mirror of
https://github.com/nostrlabs-io/notepush.git
synced 2025-06-14 11:07:43 +00:00
f9885b01aa7a367e086b5c90668ef3a924ec07a8

Testing ------- Device: iPhone 15 simulator iOS: 17.5 Damus: 1.10 (8) 3902fe7b30f38ec104c13087948799e38e26fa91 (Local build) notepush: This commit Setup: 1. Open app in two separate simulator devices under the same nostr account 2. On both, setup the environment to be local, pointing to the same local notepush Steps: 1. Go to notification settings and try to set notification mode to "push" on both devices 2. Ensure both can be set to push without displaying an error 3. Ensure preferences can be changed without displaying an error 4. When changing one setting, on both devices go back and forth on the notification setting screen and ensure both are independent 5. Send some notifications to this account. Ensure both get the notification 6. Disable DM notifications on one device and send a DM. Ensure only one device gets the notification 7. Try step 6 again, but with likes (and disabling it on the other device) Results: PASS - Can register with both devices - Both devices get new push notifications - Settings are independent and get respected on each device. Signed-off-by: Daniel D’Aquino <daniel@daquino.me> Closes: https://github.com/damus-io/damus/issues/2434
Notepush
A high performance Nostr relay for sending out push notifications using the Apple Push Notification Service (APNS).
⚠️🔥WIP! Experimental!⚠️🔥
Installation
- Get a build or build it yourself using
cargo build --release
- On the working directory from which you start this relay, create an
.env
file with the following contents:
APNS_TOPIC="com.your_org.your_app" # Your app's bundle ID
APNS_AUTH_PRIVATE_KEY_FILE_PATH=./AuthKey_1234567890.p8 # Path to the private key file used to generate JWT tokens with the Apple APNS server. You can obtain this from https://developer.apple.com/account/resources/authkeys/list
APNS_AUTH_PRIVATE_KEY_ID=1234567890 # The ID of the private key used to generate JWT tokens with the Apple APNS server. You can obtain this from https://developer.apple.com/account/resources/authkeys/list
APNS_ENVIRONMENT="development" # The environment to use with the APNS server. Can be "development" or "production"
APPLE_TEAM_ID=1248163264 # The ID of the team. Can be found in AppStore Connect.
DB_PATH=./apns_notifications.db # Path to the SQLite database file that will be used to store data about sent notifications, relative to the working directory
RELAY_URL=wss://relay.damus.io # URL to the relay server which will be consulted to get information such as mute lists.
HOST="0.0.0.0" # The host to bind the server to (Defaults to 0.0.0.0 to bind to all interfaces)
PORT=8000 # The port to bind the server to. Defaults to 8000
API_BASE_URL=http://localhost:8000 # Base URL from the API is allowed access (used by the server to perform NIP-98 authentication)
- Run this relay using the built binary or the
cargo run
command. If you want to change the log level, you can set theRUST_LOG
environment variable toDEBUG
orINFO
before running the relay.
Example:
$ RUST_LOG=DEBUG cargo run
Contributions
For contribution guidelines, please check this document.
Development setup
- Install the Rust toolchain
- Clone this repository
- Run
cargo build
to build the project - Run
cargo test
to run the tests - Run
cargo run
to run the project
Testing utilities
You can use test/test-inputs
with a websockets test tool such as websocat
to play around with the relay. If you have Nix installed, you can run:
$ nix-shell
[nix-shell] $ websocat ws://localhost:8000
<ENTER_FULL_JSON_PAYLOAD_HERE_AND_PRESS_ENTER>
Description
Languages
Rust
99.8%
Nix
0.2%