Last active
March 12, 2017 21:40
-
-
Save naumov/b7a0a320336c3d396ce5cffcbcf42c1e to your computer and use it in GitHub Desktop.
rpush apns 2 http/2 example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app = Rpush::Apns2::App.new | |
app.name = "ios_app" | |
app.certificate = File.read("/path/to/cert/cert.pem") | |
app.environment = "production" | |
app.connections = 1 | |
app.save! | |
Rpush.embed # to deliver in console on notification save | |
n = Rpush::Apns2::Notification.new | |
n.app = app | |
n.alert = "hello" | |
n.device_token = "TOKEN" # replace TOKEN with ios device token | |
n.data = {'headers' => { 'apns-topic' => "com.ios.app" }} # replace com.ios.app with ios app bundle id | |
n.save! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment