Giter Site home page Giter Site logo

ionic_push's Introduction

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.

ionic_push's People

Contributors

kidush avatar michaelwhi avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.