Project

apns-s3

0.0
No commit activity in last 3 years
No release in over 3 years
APNs with pemfile on AWS S3
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.10
~> 0.8.1
~> 10.0
~> 3.1.2

Runtime

~> 1.0
~> 2.2
 Project Readme

APNs with pemfile on AWS S3

Gem Version Dependency Status Build Status Coverage Status Code Climate

Download PEM file from AWS S3 and set it to APNS module.

This feature is useful on Heroku.

Installation

Add this line to your application's Gemfile:

gem 'apns-s3'

And then execute:

$ bundle

Or install it yourself as:

$ gem install apns-s3

Usage

require 'apns-s3'

ApnsS3.set_pemfile(
  region: 'us-east-1',
  aws_access_key_id: 'your-access-key-id',
  aws_secret_access_key: 'your-secret-access-key',
  bucketname: 'the-name-of-bucket-including-PEM-file',
  filename: 'PEM-filename'
)

All region names are listed here.

After that, you can send notifications normally.

APNS.host = 'gateway.push.apple.com' # if not sandbox
APNS.send_notification(
  'your device token',
  alert: 'alert message',
  badge: 1,
  sound: 'default'
)

# If you want to delete PEM file
File.delete 'PEM-filename' if File.exist? 'PEM-filename'

For APNS module's further information, refer jpoz/APNS.

Contributing

  1. Fork it ( https://github.com/kaosf/apns-s3/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request