Skip to content

Fix NDS example URL #105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/breez-nodeless-llms/breez-nodeless-python-llms.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=<PUSH_TOKEN>")
sdk.register_webhook("https://your-nds-service.com/api/v1/notify?platform=ios&token=<PUSH_TOKEN>")
except Exception as error:
logging.error(error)
raise
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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=<PUSH_TOKEN>')
await registerWebhook('https://your-nds-service.com/api/v1/notify?platform=ios&token=<PUSH_TOKEN>')
} catch (err) {
console.error(err)
}
Expand Down
2 changes: 1 addition & 1 deletion examples/breez-nodeless-llms/breez-nodeless-rust-llms.md
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ async fn list_payments_details_destination(sdk: Arc<LiquidSdk>) -> Result<Vec<Pa
```rust
async fn register_webhook(sdk: Arc<LiquidSdk>) -> Result<()> {
sdk.register_webhook(
"https://your-nds-service.com/notify?platform=ios&token=<PUSH_TOKEN>".to_string(),
"https://your-nds-service.com/api/v1/notify?platform=ios&token=<PUSH_TOKEN>".to_string(),
)
.await?;

Expand Down
2 changes: 1 addition & 1 deletion examples/breez-nodeless-llms/breez-nodeless-wasm-llms.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=<PUSH_TOKEN>');
await sdk.registerWebhook('https://your-nds-service.com/api/v1/notify?platform=web&token=<PUSH_TOKEN>');
} catch (err) {
console.error(err);
}
Expand Down
2 changes: 1 addition & 1 deletion snippets/csharp/Webhook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public void RegisterWebhook(BindingLiquidSdk sdk)
// ANCHOR: register-webook
try
{
sdk.RegisterWebhook("https://your-nds-service.com/notify?platform=ios&token=<PUSH_TOKEN>");
sdk.RegisterWebhook("https://your-nds-service.com/api/v1/notify?platform=ios&token=<PUSH_TOKEN>");
}
catch (Exception)
{
Expand Down
2 changes: 1 addition & 1 deletion snippets/dart_snippets/lib/webhook.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:dart_snippets/sdk_instance.dart';
Future<void> registerWebhook() async {
// ANCHOR: register-webook
await breezSDKLiquid.instance!
.registerWebhook(webhookUrl: "https://your-nds-service.com/notify?platform=ios&token=<PUSH_TOKEN>");
.registerWebhook(webhookUrl: "https://your-nds-service.com/api/v1/notify?platform=ios&token=<PUSH_TOKEN>");
// ANCHOR_END: register-webook
}

Expand Down
2 changes: 1 addition & 1 deletion snippets/go/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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=<PUSH_TOKEN>"); err != nil {
if err := sdk.RegisterWebhook("https://your-nds-service.com/api/v1/notify?platform=ios&token=<PUSH_TOKEN>"); err != nil {
log.Printf("Webhook register failed: %v", err)
}
// ANCHOR_END: register-webook
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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=<PUSH_TOKEN>")
sdk.registerWebhook("https://your-nds-service.com/api/v1/notify?platform=ios&token=<PUSH_TOKEN>")
} catch (e: Exception) {
// Handle error
}
Expand Down
2 changes: 1 addition & 1 deletion snippets/python/src/webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=<PUSH_TOKEN>")
sdk.register_webhook("https://your-nds-service.com/api/v1/notify?platform=ios&token=<PUSH_TOKEN>")
except Exception as error:
logging.error(error)
raise
Expand Down
2 changes: 1 addition & 1 deletion snippets/react-native/webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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=<PUSH_TOKEN>')
await registerWebhook('https://your-nds-service.com/api/v1/notify?platform=ios&token=<PUSH_TOKEN>')
} catch (err) {
console.error(err)
}
Expand Down
2 changes: 1 addition & 1 deletion snippets/rust/src/webhook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use breez_sdk_liquid::prelude::*;
async fn register_webhook(sdk: Arc<LiquidSdk>) -> Result<()> {
// ANCHOR: register-webook
sdk.register_webhook(
"https://your-nds-service.com/notify?platform=ios&token=<PUSH_TOKEN>".to_string(),
"https://your-nds-service.com/api/v1/notify?platform=ios&token=<PUSH_TOKEN>".to_string(),
)
.await?;
// ANCHOR_END: register-webook
Expand Down
2 changes: 1 addition & 1 deletion snippets/swift/BreezSDKExamples/Sources/Webhook.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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=<PUSH_TOKEN>")
try sdk.registerWebhook(webhookUrl: "https://your-nds-service.com/api/v1/notify?platform=ios&token=<PUSH_TOKEN>")
// ANCHOR_END: register-webook
}

Expand Down
2 changes: 1 addition & 1 deletion snippets/wasm/webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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=<PUSH_TOKEN>')
await sdk.registerWebhook('https://your-nds-service.com/api/v1/notify?platform=ios&token=<PUSH_TOKEN>')
} catch (err) {
console.error(err)
}
Expand Down
8 changes: 2 additions & 6 deletions src/notifications/setup_nds.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=<ios|android>&token=[PUSH_TOKEN]
https://your-nds-service.com/api/v1/notify?platform=<ios|android>&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`.
Loading