You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My frontend is configured properly and it gets notifications from the expo push notifications tool. When I use my backend, I get a 400 server error. I get a ServerErr("Request failed: 400 Bad Request"). Here is my code to send push notifications on backend:
use expo_push_notification_client::{Expo, ExpoClientOptions, ExpoPushMessage};
async fn send_push_notifications(push_tokens: Vec<String>) -> Result<(), Box<dyn std::error::Error>> {
// Initialize the Expo client
let expo = Expo::new(ExpoClientOptions { access_token: None });
println!("PUSH NOTIFICATIONS TO {:?}", push_tokens);
// Build Expo Push Message with detailed configurations
let expo_push_message = ExpoPushMessage::builder(push_tokens)
.body("body")
.data(&[("data".to_string())])?
.ttl(100)
.priority("high")
.subtitle("subtitle")
.sound("default")
.badge(1)
.channel_id("channel_id")
.category_id("category_id")
.mutable_content(true)
.title("title")
.build()?;
let tickets = expo.send_push_notifications(expo_push_message).await;
match tickets {
Ok(receipts) => println!("PUSH NOTIFICATIONS TICKETS {:?}", receipts),
Err(e) => eprintln!("Failed to send push notifications: {:?}", e),
}
Ok(())
}
Any help would be really appreciated.
The text was updated successfully, but these errors were encountered:
My frontend is configured properly and it gets notifications from the expo push notifications tool. When I use my backend, I get a 400 server error. I get a ServerErr("Request failed: 400 Bad Request"). Here is my code to send push notifications on backend:
Any help would be really appreciated.
The text was updated successfully, but these errors were encountered: