How ever in practice we need to send push based notifications on ios devices from the rails application.
For this purpose you can use grocer
ruby gem. Here is sample implementation for this:
Install Gem
- Write
gem 'grocer'
in you gem file and run bundle install
or just run gem install grocer
.
Create a yml for notification
- Create a yml file in config folder on app for settings
Creating Class for Notification
- Create a file in
app\config\initializers\
, say user_notifications.rb
. - Add following lines of code inside
user_notifications.rb
Send Notification
Enjoy!!!!