#push-notifications #sns #aws #rusoto

sns-push-notifications

使用AWS SNS发送iOS和Android推送通知的库

2个版本

0.1.1 2019年2月9日
0.1.0 2019年2月9日

#7 in #sns

MIT许可证

10KB
168

用于发送iOS和Android推送通知的Amazon Simple Notification Service (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,
)?;


许可证:MIT


lib.rs:

用于发送iOS和Android推送通知的Amazon Simple Notification Service (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,
)?;

依赖项

~17MB
~329K SLoC