diff --git a/examples/breez-nodeless-llms/breez-nodeless-python-llms.md b/examples/breez-nodeless-llms/breez-nodeless-python-llms.md index 33f4b83f..1c82858c 100644 --- a/examples/breez-nodeless-llms/breez-nodeless-python-llms.md +++ b/examples/breez-nodeless-llms/breez-nodeless-python-llms.md @@ -857,7 +857,7 @@ def list_payments_details_destination(sdk: BindingLiquidSdk): ```python def register_webhook(sdk: BindingLiquidSdk): try: - sdk.register_webhook("https://your-nds-service.com/notify?platform=ios&token=") + sdk.register_webhook("https://your-nds-service.com/api/v1/notify?platform=ios&token=") except Exception as error: logging.error(error) raise diff --git a/examples/breez-nodeless-llms/breez-nodeless-reactnative-llms.md b/examples/breez-nodeless-llms/breez-nodeless-reactnative-llms.md index e043b82c..ae26caa6 100644 --- a/examples/breez-nodeless-llms/breez-nodeless-reactnative-llms.md +++ b/examples/breez-nodeless-llms/breez-nodeless-reactnative-llms.md @@ -238,7 +238,7 @@ import { registerWebhook, unregisterWebhook } from '@breeztech/react-native-bree const registerWebhookExample = async () => { try { - await registerWebhook('https://your-nds-service.com/notify?platform=ios&token=') + await registerWebhook('https://your-nds-service.com/api/v1/notify?platform=ios&token=') } catch (err) { console.error(err) } diff --git a/examples/breez-nodeless-llms/breez-nodeless-rust-llms.md b/examples/breez-nodeless-llms/breez-nodeless-rust-llms.md index c4ee5bf3..b50b2d16 100644 --- a/examples/breez-nodeless-llms/breez-nodeless-rust-llms.md +++ b/examples/breez-nodeless-llms/breez-nodeless-rust-llms.md @@ -885,7 +885,7 @@ async fn list_payments_details_destination(sdk: Arc) -> Result) -> Result<()> { sdk.register_webhook( - "https://your-nds-service.com/notify?platform=ios&token=".to_string(), + "https://your-nds-service.com/api/v1/notify?platform=ios&token=".to_string(), ) .await?; diff --git a/examples/breez-nodeless-llms/breez-nodeless-wasm-llms.md b/examples/breez-nodeless-llms/breez-nodeless-wasm-llms.md index 1496f6fe..843aa8c4 100644 --- a/examples/breez-nodeless-llms/breez-nodeless-wasm-llms.md +++ b/examples/breez-nodeless-llms/breez-nodeless-wasm-llms.md @@ -863,7 +863,7 @@ const listPaymentsDetailsDestination = async (sdk) => { ```typescript const registerWebhook = async (sdk) => { try { - await sdk.registerWebhook('https://your-nds-service.com/notify?platform=web&token='); + await sdk.registerWebhook('https://your-nds-service.com/api/v1/notify?platform=web&token='); } catch (err) { console.error(err); } diff --git a/snippets/csharp/Webhook.cs b/snippets/csharp/Webhook.cs index 80ec0dd4..28beed28 100644 --- a/snippets/csharp/Webhook.cs +++ b/snippets/csharp/Webhook.cs @@ -7,7 +7,7 @@ public void RegisterWebhook(BindingLiquidSdk sdk) // ANCHOR: register-webook try { - sdk.RegisterWebhook("https://your-nds-service.com/notify?platform=ios&token="); + sdk.RegisterWebhook("https://your-nds-service.com/api/v1/notify?platform=ios&token="); } catch (Exception) { diff --git a/snippets/dart_snippets/lib/webhook.dart b/snippets/dart_snippets/lib/webhook.dart index 50050e43..9c1401b8 100644 --- a/snippets/dart_snippets/lib/webhook.dart +++ b/snippets/dart_snippets/lib/webhook.dart @@ -3,7 +3,7 @@ import 'package:dart_snippets/sdk_instance.dart'; Future registerWebhook() async { // ANCHOR: register-webook await breezSDKLiquid.instance! - .registerWebhook(webhookUrl: "https://your-nds-service.com/notify?platform=ios&token="); + .registerWebhook(webhookUrl: "https://your-nds-service.com/api/v1/notify?platform=ios&token="); // ANCHOR_END: register-webook } diff --git a/snippets/go/webhook.go b/snippets/go/webhook.go index 6dd92e65..67f4061b 100644 --- a/snippets/go/webhook.go +++ b/snippets/go/webhook.go @@ -8,7 +8,7 @@ import ( func RegisterWebhook(sdk *breez_sdk_liquid.BindingLiquidSdk) { // ANCHOR: register-webook - if err := sdk.RegisterWebhook("https://your-nds-service.com/notify?platform=ios&token="); err != nil { + if err := sdk.RegisterWebhook("https://your-nds-service.com/api/v1/notify?platform=ios&token="); err != nil { log.Printf("Webhook register failed: %v", err) } // ANCHOR_END: register-webook diff --git a/snippets/kotlin_mpp_lib/shared/src/commonMain/kotlin/com/example/kotlinmpplib/Webhook.kt b/snippets/kotlin_mpp_lib/shared/src/commonMain/kotlin/com/example/kotlinmpplib/Webhook.kt index 606e7bda..53f33840 100644 --- a/snippets/kotlin_mpp_lib/shared/src/commonMain/kotlin/com/example/kotlinmpplib/Webhook.kt +++ b/snippets/kotlin_mpp_lib/shared/src/commonMain/kotlin/com/example/kotlinmpplib/Webhook.kt @@ -5,7 +5,7 @@ class Webhooks { fun registerWebhook(sdk: BindingLiquidSdk) { // ANCHOR: register-webook try { - sdk.registerWebhook("https://your-nds-service.com/notify?platform=ios&token=") + sdk.registerWebhook("https://your-nds-service.com/api/v1/notify?platform=ios&token=") } catch (e: Exception) { // Handle error } diff --git a/snippets/python/src/webhook.py b/snippets/python/src/webhook.py index fd9bf73b..4e81a0c3 100644 --- a/snippets/python/src/webhook.py +++ b/snippets/python/src/webhook.py @@ -5,7 +5,7 @@ def register_webhook(sdk: BindingLiquidSdk): # ANCHOR: register-webook try: - sdk.register_webhook("https://your-nds-service.com/notify?platform=ios&token=") + sdk.register_webhook("https://your-nds-service.com/api/v1/notify?platform=ios&token=") except Exception as error: logging.error(error) raise diff --git a/snippets/react-native/webhook.ts b/snippets/react-native/webhook.ts index 976920c0..bb791d3a 100644 --- a/snippets/react-native/webhook.ts +++ b/snippets/react-native/webhook.ts @@ -3,7 +3,7 @@ import { registerWebhook, unregisterWebhook } from '@breeztech/react-native-bree const _registerWebhook = async () => { // ANCHOR: register-webook try { - await registerWebhook('https://your-nds-service.com/notify?platform=ios&token=') + await registerWebhook('https://your-nds-service.com/api/v1/notify?platform=ios&token=') } catch (err) { console.error(err) } diff --git a/snippets/rust/src/webhook.rs b/snippets/rust/src/webhook.rs index 5dca6466..9b71ddfe 100644 --- a/snippets/rust/src/webhook.rs +++ b/snippets/rust/src/webhook.rs @@ -6,7 +6,7 @@ use breez_sdk_liquid::prelude::*; async fn register_webhook(sdk: Arc) -> Result<()> { // ANCHOR: register-webook sdk.register_webhook( - "https://your-nds-service.com/notify?platform=ios&token=".to_string(), + "https://your-nds-service.com/api/v1/notify?platform=ios&token=".to_string(), ) .await?; // ANCHOR_END: register-webook diff --git a/snippets/swift/BreezSDKExamples/Sources/Webhook.swift b/snippets/swift/BreezSDKExamples/Sources/Webhook.swift index b2d8afd1..73a5ee1b 100644 --- a/snippets/swift/BreezSDKExamples/Sources/Webhook.swift +++ b/snippets/swift/BreezSDKExamples/Sources/Webhook.swift @@ -9,7 +9,7 @@ import BreezSDKLiquid func registerWebhook(sdk: BindingLiquidSdk) throws { // ANCHOR: register-webook - try sdk.registerWebhook(webhookUrl: "https://your-nds-service.com/notify?platform=ios&token=") + try sdk.registerWebhook(webhookUrl: "https://your-nds-service.com/api/v1/notify?platform=ios&token=") // ANCHOR_END: register-webook } diff --git a/snippets/wasm/webhook.ts b/snippets/wasm/webhook.ts index 610fc026..c9273c5e 100644 --- a/snippets/wasm/webhook.ts +++ b/snippets/wasm/webhook.ts @@ -3,7 +3,7 @@ import { type BindingLiquidSdk } from '@breeztech/breez-sdk-liquid' const _registerWebhook = async (sdk: BindingLiquidSdk) => { // ANCHOR: register-webook try { - await sdk.registerWebhook('https://your-nds-service.com/notify?platform=ios&token=') + await sdk.registerWebhook('https://your-nds-service.com/api/v1/notify?platform=ios&token=') } catch (err) { console.error(err) } diff --git a/src/notifications/setup_nds.md b/src/notifications/setup_nds.md index cbd60a3f..31ce0f8a 100644 --- a/src/notifications/setup_nds.md +++ b/src/notifications/setup_nds.md @@ -14,14 +14,10 @@ Receiving push notifications involves using an Notification Delivery Service (ND The need to run your own NDS is because it's configured to send push notifications to your application users and therefore should be configured with the required keys and certificates. You can use our [reference NDS implementation](https://github.com/breez/notify) as a starting point or as is. Our implementation of the NDS expects URLs in the following format: ``` -https://your-nds-service.com/notify?platform=&token=[PUSH_TOKEN] +https://your-nds-service.com/api/v1/notify?platform=&token=[PUSH_TOKEN] ``` - - This is the same format used when [using webhooks](using_webhooks.md) in the SDK, replacing the `PUSH_TOKEN` with the mobile push token. Once the NDS receives such a request it will send a push notification to the corresponding device. ## Mobile push token -Ensure that your mobile application is set up to receive push notifications and can generate a push token, which uniquely identifies the device for push notifications. -* For iOS, use [Apple Push Notification Service (APNs)](https://developer.apple.com/documentation/usernotifications/registering_your_app_with_apns) to get the token. -* For Android, use [Firebase Cloud Messaging (FCM)](https://firebase.google.com/docs/cloud-messaging/manage-tokens) to obtain the token. +Ensure that your mobile application is set up to receive push notifications and can generate a push token, which uniquely identifies the device for push notifications. Our [reference NDS implementation](https://github.com/breez/notify) uses [Firebase Cloud Messaging (FCM)](https://firebase.google.com/docs/cloud-messaging/manage-tokens) to deliver push notifications, so your application should use Firebase to obtain the `PUSH_TOKEN`.