<commit_before># apns2
HTTP/2 Apple Push Notification Service for Rust

# DOES NOT WORK YET

This is aiming to be a complete refactoring of an apple push notification
client. This is here to test different ways of building an api for the new
client. This will work when the http2 support lands to hyper. You can monitor
the progress in the [h2 crate](https://github.com/carllerche/h2/) and [hyper
crate](https://github.com/hyperium/hyper).

If you want to help here, please comment about the ergonomy and possible bugs in
the API.<commit_msg>Update README, add some links and examples<commit_after># apns2
HTTP/2 Apple Push Notification Service for Rust using Tokio and async sending.

## Status

The library is based on an experimental version of
[Hyper](https://github.com/hyperium/hyper) that includes support for Http2
protocol. The [h2 crate](https://github.com/carllerche/h2) underneath is already
quite stable and passes h2spec 100%. Regarding the status of Hyper and its h2
integration not yet even merged to the master branch, consider this crate to be
alpha and breaking in every possible way.

## Usage

Add this to `Cargo.toml`:

```
[dependencies]
apns2 = { git = "https://github.com/pimeys/apns2" }
tokio-core = "0.1"
futures = "0.1"
```

then add to your crate root:

```rust
extern crate apns2;
extern crate tokio_core;
extern crate futures;
```

## Examples

The library supports connecting to Apple Push Notification service [either using
a
certificate](https://github.com/pimeys/apns2/blob/master/examples/certificate_client.rs)
with a password [or a private
key](https://github.com/pimeys/apns2/blob/master/examples/token_client.rs) with
a team id and key id. Both are available from your Apple account and with both
it is possible to send push notifications to one application.

## Tests

`cargo test`
{'fraction_non_alphanumeric': 0.08232711306256861, 'fraction_numerical': 0.013172338090010977, 'mean_word_length': 4.541033434650456, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 7, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '271070', 'n_tokens_mistral': 559, 'n_tokens_neox': 523, 'n_words': 238}