Pigeon
iOS push notifications for Elixir
Usage
- Create a notification packet with
n = Pigeon.Notification.new(message, device_token) - Send the packet with
Pigeon.push(n, uri, "your_push_cert.pem", "your_push_key.pem")urican be one of the following:- Pigeon.apple_development_gateway_uri
- Pigeon.apple_production_gateway_uri
Generating Your Certificate and Key .pem
- In Keychain Access, right-click your push certificate and select "Export..."
- Export the certificate as
cert.p12 - Click the dropdown arrow next to the certificate, right-click the private key and select "Export..."
- Export the private key as
key.p12 - From a shell, convert the cert with
openssl pkcs12 -clcerts -nokeys -out cert.pem -in cert.p12 - Conver the key with
pkcs12 -nocerts -out key.pem -in key.p12 - To remove the password from the key,
openssl rsa -in key.pem -out key_unencrypted.pem cert.pemandkey_unencrypted.pemcan be used as the cert and key inPigeon.push, respectively.