#aws #rusoto #sns

sns-push-notifications

Library for sending iOS and Android push notifications with AWS SNS

2 releases

✓ Uses Rust 2018 edition

0.1.1 Feb 9, 2019
0.1.0 Feb 9, 2019

#6 in #rusoto

Download history

1 downloads per month

MIT license

10KB
165 lines

A library for sending iOS and Android push notifications with Amazon Simple Notification Servce (SNS).

Example usage

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


lib.rs:

A library for sending iOS and Android push notifications with Amazon Simple Notification Servce (SNS).

Example usage

use sns_push_notifications::{Push, Region, SnsClient};

# fn main() -> Result<(), Box<std::error::Error>> {
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,
)?;

# Ok(())
# }

Dependencies

~11MB
~200K SLoC