Expand description
A simple library for sending push notifications
to iOS devices which install the bark app using the APNS protocol.
§Example
use bark::{bark::Bark, msg::Msg};
let mut bark: Bark = Bark::new();
let msg = Msg::new("notify".to_string(), "hello world".to_string());
let devices: Vec<String> = vec!["the_device_token_get_from_bark_app"];
let send_reult: Option<Vec<String>> = None;//bark.send(&msg, &devices);
// send result is None if success
assert!(send_reult.is_none());
// send result is a vector of failed devices if failed
if let Some(failed_devices) = send_reult {
// do something
println!("send failed: {:?}", failed_devices);
};§Note
request apns need a token
The token is cached in memory by default and refreshed automatically
If your app frequently run in oneshot mode, or you want share the token with other app
you can call bark.token() to get the token and presist it
and call bark.born(time_stamp, token) to new a bark instance with the token
§Features
- send push notifications to iOS devices which install the #bark# app using the APNS protocol.
- async send push notificationsto iOS devices which install the #bark# app using the APNS protocol