{"id":15048390,"url":"https://github.com/github/zero_push","last_synced_at":"2025-10-04T08:31:35.935Z","repository":{"id":41577723,"uuid":"47560383","full_name":"github/zero_push","owner":"github","description":"Ruby wrapper for the ZeroPush API","archived":true,"fork":true,"pushed_at":"2015-07-21T19:00:07.000Z","size":472,"stargazers_count":7,"open_issues_count":0,"forks_count":10,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-09-29T00:21:33.660Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/zero_push","language":"Ruby","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"ZeroPush/zero_push","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/github.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-07T15:23:20.000Z","updated_at":"2024-07-31T03:21:23.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/github/zero_push","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fzero_push","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fzero_push/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fzero_push/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fzero_push/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/github","download_url":"https://codeload.github.com/github/zero_push/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235232624,"owners_count":18957057,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T21:11:20.484Z","updated_at":"2025-10-04T08:31:30.648Z","avatar_url":"https://github.com/github.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![ZeroPush](https://raw.github.com/ZeroPush/zero_push/master/zeropush-header.png)](https://zeropush.com)\n\n[![Build Status](http://img.shields.io/travis/ZeroPush/zero_push.svg)](https://travis-ci.org/ZeroPush/zero_push) [![Code Climate](https://codeclimate.com/github/ZeroPush/zero_push/badges/gpa.svg)](https://codeclimate.com/github/ZeroPush/zero_push) [![Gem Version](http://img.shields.io/gem/v/zero_push.svg)](http://rubygems.org/gems/zero_push)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'zero_push'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install zero_push\n\n## Usage\n\n### Rails Generator\nGenerate the ZeroPush initializer if you are using Ruby on Rails.\n\n    $ rails g zero_push:install\n\n### API Client\n\nThe easiest way to use the API client is to set the server `auth_token` at the module level and call methods on the ZeroPush module. You can find the token on settings page for your app.\n\n```ruby\n  ZeroPush.auth_token = 'iosprod_your-server-token'\n  ZeroPush.notify(device_tokens: ['abcdef'], alert: 'hello, world', badge: '+1', info: {user_id: 1234})\n```\n\nIf your web application supports must support multiple mobile apps, you may configure it like this:\n\n```ruby\n  if Rails.env == 'development'  #or ENV['RACK_ENV']\n    ZeroPush.auth_tokens = {\n      apns: 'iosdev_XYZ',\n      gcm: 'gcmdev_ABC',\n    }\n  else\n    ZeroPush.auth_tokens = {\n      apns: 'iosprod_XYZ',\n      gcm: 'gcmprod_ABC',\n    }\n  end\n```\n\nYou may then instantiate clients by calling the method that matches the auth token key:\n\n```ruby\n  ZeroPush.apns.broadcast( ... )\n  ZeroPush.gcm.broadcast( ... )\n```\n\n\nLastly, if you have many apps you may instantiate clients API Clients\n\n```ruby\n  client_1 = ZeroPush.client('iosprod_app-server-token-1')\n  client_1.broadcast(alert: 'hello, app1')\n\n  client_2 = ZeroPush.client('iosprod_app-server-token-2')\n  client_1.broadcast(alert: 'hello, app2')\n```\n\nMethods supported by this gem and their parameters can be found in the [API Reference](https://zeropush.com/documentation/api_reference)\n\nFor more documentation, check our [Getting Started Guide with ZeroPush](https://zeropush.com/documentation)\n\n## Contributing\n\n1. Fork it\n1. Create your feature branch (`git checkout -b my-new-feature`)\n1. Write tests for your feature\n1. Commit your changes (`git commit -am 'Add some feature'`)\n1. Push to the branch (`git push origin my-new-feature`)\n1. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub%2Fzero_push","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgithub%2Fzero_push","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub%2Fzero_push/lists"}