Project

ionic_push

0.01
No commit activity in last 3 years
No release in over 3 years
A simple gem for comunicate and send push notfication through Ionic Push.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.11
~> 0.10.3
~> 10.0
>= 3.4.0, ~> 3.4
~> 0.39.0
>= 3.0.1, ~> 3.0
>= 2.0.0, ~> 2.0

Runtime

~> 0.13.7
 Project Readme

Code Climate

IonicPush

Just a simple gem to send push notificaitons through Ionic Push API.

Installation

Add this line to your application's Gemfile:

gem 'ionic_push'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ionic_push

Usage

Configuration

Before all You'll need your Ionic API TOKEN and a Security Profile. For more details about Ionic Push see the official documentation.

You'll have create a configuration file.

Ex.initializers/ionic_push.rb

IonicPush.configure do |config|
  config.api_key = '<YOUR-API-KEY>'
  config.profile = '<YOUR-SECURIY-PROFILE>'
end

The basic

IonicPush.push(['your', 'devices', 'tokens'], { title: 'Push Title', message: 'Push Message' })

Adding Custom data to your notificaitons

notification_params = {
  title: 'Push Title',
  message: 'Push Message',
  ios: {
	message: "Hello iOS",
  },
  android: {
    message: "Hello Android"
  }
}

IonicPush.push(['your', 'devices', 'tokens'], notification_params)

Phonegap push plugin options

notification_params = {
  title: 'Push Title',
  message: 'Push Message',
  android: {
    data: "https://pbs.twimg.com/profile_images/617058765167329280/9BkeDJlV.png"
  }
}

IonicPush.push(['your', 'devices', 'tokens'], notification_params)

Customizing Notification Appearance

notification_params = {
  title: 'Push Title',
  message: 'Push Message',
  android: {
	message: 'Hello Android',
    icon: 'ionitron.png'
  },
  ios: {
    message: 'Hello iOS',
    badge: 3,
    sound: 'ios-sound.wav'
  }
}

IonicPush.push(['your', 'devices', 'tokens'], notification_params)

To do

  • Basic API Usage
  • Adding custom data to your notificaitons
  • Phonegap Push plugin options
  • Customizing Notification appearance
  • Sengind Push to Ionic User ID's
  • Scheduling a push for later delivery
  • Templating your push notification
  • Notification's priority
  • Checking the status of push

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/kidush/ionic_push.