tompesman / push-core

Core of the modular push daemon
MIT License
112 stars 23 forks source link

Does not work in sandbox mode #40

Open SergeyMell opened 6 years ago

SergeyMell commented 6 years ago

I have a server on heroku

Configuration looks like this

    Push::ConfigurationApns.create(app: 'MyApp', connections: 2, enabled: true,
                                   certificate: File.read('apns.pem'),
                                   feedback_poll: 2,
                                   sandbox: true)

However, it is still connecting to production gateway. Here is what I get from the logs

2017-11-03T09:21:23.192081+00:00 app[push.1]: [2017-11-03 09:21:23] [MyApp: ConnectionApns 1] Connected to gateway.push.apple.com:2195
2017-11-03T09:21:23.372482+00:00 app[push.1]: [2017-11-03 09:21:23] [MyApp: ConnectionApns 2] Connected to gateway.push.apple.com:2195

Thanks in advance for your help

tompesman commented 6 years ago

The host is set here: https://github.com/tompesman/push-apns/blob/master/lib/push/daemon/apns_support/connection_apns.rb#L16 so it looks like it is false there.

If you query the configuration is the sandbox value true or false?

SergeyMell commented 6 years ago

It remains false for some reason. Maybe this could be some issue connected directly with heroku... Seems I need to investigate for a while