expo-community / expo-server-sdk-ruby

A Ruby library for sending push notifications with Expo's notification service
MIT License
95 stars 53 forks source link

Push notifications not being sent #5

Closed maharjanaman closed 6 years ago

maharjanaman commented 6 years ago

Currently using this sdk, I'm unable to sent push notifications which was working fine before. I have tested multiple times with other sdk and with curl -H "Content-Type: application/json" -X POST https://exp.host/--/api/v2/push/send -d '{ "to": "ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]", "title":"hello", "body": "world" }' and it sends push notification, but issue persist with this sdk.

jeanpaulsio commented 6 years ago

Having the same issue - in the mean time I'm just using good ol' net/http

Inside of my controller looks something like this:

require 'net/http'

def create
  # ...

  uri = URI.parse('https://exp.host/--/api/v2/push/send')

  Net::HTTP.post_form(uri, {
    "to": "ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]",
    "title": "hello",
    "body": "world"
  })

  # ...
end
StephenGrider commented 6 years ago

See #6. Short term solution is to add httparty as a dependency then manually copy paste over the source from here to your project

pablonahuelgomez commented 6 years ago

Gentlemen, see #8. I wrote that PR to solve this issue.

pablonahuelgomez commented 6 years ago

@maharjanaman @jeanpaulsio @StephenGrider updating your gem version to the latest will solve this problem. If you have any question, please let me know.