expo-community/expo-server-sdk-ruby

Push notifications not being sent

maharjanaman opened this issue ยท 4 comments

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.

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

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

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

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