Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A gem for creating Safari push notification push packages.
Ruby
tag: v0.1.0

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
lib
spec
.gitignore
.travis.yml
Gemfile
Gemfile.lock
LICENSE.txt
README.md
Rakefile
push_package.gemspec

README.md

Push Package

Purpose

This gem provides a Ruby library and command line tool for creating a push package to be used for Safari Push Notifications.

Features

  • Validates push package contents
  • Generates manifest.json
  • Signs package with required signature
  • Creates pushPackage.zip

Installation

gem install push_package

Notes:

This gem depends on zip being in your shell's PATH

You must obtain a Website Push certificate from apple which requires a iOS developer license or a Mac developer license

require 'push_package'

website_params = {
  websiteName: "Bay Airlines",
  websitePushID: "web.com.example.domain",
  allowedDomains: ["http://domain.example.com"],
  urlFormatString: "http://domain.example.com/%@/?flight=%@",
  authenticationToken: "19f8d7a6e9fb8a7f6d9330dabe",
  webServiceURL: "https://example.com/push"
}

iconset_path = 'path/to/iconset'
certificate = 'path/to/certificate.p12' # or certificate_string
package = PushPackage.new(website_params, iconset_path, certificate, 'optional cert password')
package.save('path/to/save')
$> push_package --website-json=./website.json --iconset-path=~/project/iconset --output-dir=./ --certificate=./Certificate.p12
   wrote: ./pushPackage.zip

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Write tests for your feature
  4. Commit your changes (git commit -am 'Add some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create new Pull Request
Something went wrong with that request. Please try again.