calonso / ruby-push-notifications

iOS, Android and Windows Phone Push Notifications made easy!!
https://rubygems.org/gems/ruby-push-notifications
MIT License
399 stars 33 forks source link

apns-push-type header #25

Open ab320012 opened 5 years ago

ab320012 commented 5 years ago

Hi guys, trying to find a libirary that supports the new ios 13 apns push type headers, i am not seeing it in this library wondering if you guys are going to support it

https://github.com/calonso/ruby-push-notifications/blob/master/lib/ruby-push-notifications/apns/apns_notification.rb#L67

Juksefantomet commented 5 years ago

We are using push towards app on ios at work - using this Gem.

You can use FCM to push - have you tried FCM / APNS guides on push notifications.

It should work towards 13. Trying to confirm with my co-worker here exactly what versions we are targeting, but we did bump up to latest recently.

Using this gem you can use it. but do be aware that the payload has to look like this:

ios_payload =
  {
    "notification": {
      "title": "Greetings #{user}",
      "body": message,
      "badge": 1,
      "sound": true
    }
  }

android_payload =
  {
    "data": {
      "sound": true,
      "url": "#{url_payload}",
      "title": "Greetings #{user}",
      "body": message,
      "ttl": '2419200s',
      "count": '1'
    }
  }

This has to do with behavior, we discovered that after alot of testing, in relation to badge updating and missing/non-functioning sound/vibration on both platforms.

Hope this helps!