Im trying to implement Push notification in my app using Rpush Gem. This is so far i have tried.
if @push_notification.present?
else
app = Rpush::Apns::App.new
app.name = "ios_app"
app.certificate = File.read("config/apns-dev.pem")
app.environment = "development" # APNs environment.
app.password = ""
app.connections = 1
app.save!
end
n = Rpush::Apns::Notification.new
n.app = Rpush::Apns::App.find_by_name("ios_app")
n.device_token = session[:push_notification_token]
n.alert = "hi im alert!"
n.data = { foo: :bar }
n.save!
this save a notification to the database. I want to know how to send this notification.
using rpush this should be working to send your push message actually. there is the possibility that your certificates are not set up right, or that the push token is incorrect, or that perhaps you have not started rpush. Do you call Rpush.embed somewhere in your stack? I have placed this in config.ru