| Crates.io | sns-push-notifications |
| lib.rs | sns-push-notifications |
| version | 0.1.1 |
| created_at | 2019-02-09 21:38:44.872207+00 |
| updated_at | 2019-02-09 21:42:03.699614+00 |
| description | Library for sending iOS and Android push notifications with AWS SNS |
| homepage | https://github.com/davidpdrsn/sns-push-notifications |
| repository | https://github.com/davidpdrsn/sns-push-notifications.git |
| max_upload_size | |
| id | 113809 |
| size | 9,911 |
A library for sending iOS and Android push notifications with Amazon Simple Notification Servce (SNS).
use sns_push_notifications::{Push, Region, SnsClient};
let client = SnsClient::new_checked(Region::EuWest1)?;
let endpoint_arn = client.register_device(
// not an actual token
"123coi12j3vi12u3o1k23pb12e0jqpfw79g7w6fyi2o4jg293urf9q7ct9x1oi2h",
// not an actual platform arn
"arn:aws:sns:eu-west-1:000000000000:app/APNS/my-rusty-app",
)?;
client.send_push(
&Push::Alert {
text: "Hello, World!".to_string(),
badge: Some(1),
},
&endpoint_arn,
)?;
License: MIT