<commit_before>APNS binding for Go
====================

This is a basic wrapper around the Apple Push Notification Service. It is built on the client-server module that is inspired by [pynaps](https://github.com/samuraisam/pyapns).


Pushing notifications
------------------
The client needs to be initialized, configured, and provisioned before sending notifications to APNS.
```go  
c := &apns.Client{}
c.Configure(8080) // set the port
c.Provision("Foo", "path_to_cert", "sandbox") // set the individual appId, path to .pem certificate, and environment
```    
Once this setup is complete, the server will need to be running in another process. This allows for the use of multiple clients pushing to the server for the application while maintaining an open SSL connection to the APNS servers.
```go
apns.StartServer("sandbox", "path_to_cert", 8080)
```    
Now that the client and server are ready to talk, we can build a notification client side with the hexlified device token, an APNS payload, and notification identifier. After that is initialized, send it off!

```go
notification := &apns.Notification{
  Token:      "hexlified token",
  Payload:    []byte(`{"aps":{"alert": "FLATBUSH"}}`),
  Identifier: "0",
}
c.Notify("Foo", notification)
```
<commit_msg>StartServer to reflect new parameters in README<commit_after>APNS binding for Go
====================

This is a basic wrapper around the Apple Push Notification Service. It is built on the client-server module that is inspired by [pynaps](https://github.com/samuraisam/pyapns).


Pushing notifications
------------------
The client needs to be initialized, configured, and provisioned before sending notifications to APNS.
```go  
c := &apns.Client{}
c.Configure(8080) // set the port
c.Provision("Foo", "path_to_cert", "sandbox") // set the individual appId, path to .pem certificate, and environment
```    
Once this setup is complete, the server will need to be running in another process. This allows for the use of multiple clients pushing to the server for the application while maintaining an open SSL connection to the APNS servers.
```go
apns.StartServer("sandbox", 8080)
```    
Now that the client and server are ready to talk, we can build a notification client side with the hexlified device token, an APNS payload, and notification identifier. After that is initialized, send it off!

```go
notification := &apns.Notification{
  Token:      "<PASSWORD>",
  Payload:    []byte(`{"aps":{"alert": "FLATBUSH"}}`),
  Identifier: "0",
}
c.Notify("Foo", notification)
```

{'fraction_non_alphanumeric': 0.12514711651628088, 'fraction_numerical': 0.007061592781482934, 'mean_word_length': 4.391120507399577, 'pattern_counts': {'":': 4, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 2, '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': '845007', 'n_tokens_mistral': 720, 'n_tokens_neox': 670, 'n_words': 314}