Comments (3)
This backtrace looks like the problem is in your NotificationsController#create
rather than in Grocer
. Is this happening in a test?
from grocer.
I'm not write any test for that notifications controller yet. Do I need to write it? Is the error related to the test?
This is the method I used to do push notification.
def push(a,b,c)
devices = Device.where(:user_id => b)
devices.each do |device|
pusher = Grocer.pusher(certificate: "#{Rails.root}/lib/PUSHNOTICERT.pem", # required
passphrase: "megasap1", # optional
gateway: "gateway.sandbox.push.apple.com", # optional
port: 2195, #optional
retries: 3)
feedback = Grocer.feedback( certificate: "#{Rails.root}/lib/SLPushNotifDevCertAndKeys.pem",
passphrase: "megasap1",
gateway: "feedback.sandbox.push.apple.com",
port: 2196,
retries: 3)
# message = params["message"]
message = a
notification = Grocer::Notification.new(
device_token: device.device_token,
alert: message,
badge: 3,
sound: "siren.aiff", # optional
expiry: Time.now + 60*60, # optional; 0 is default, meaning the message is not stored
identifier: c # optional
# content_available: true # optional; any truthy value will set 'content-available' to 1
)
if pusher.push(notification)
render :json=> {:status => true}
else
render :json=> {:status => false}
end
end
feedback.each do |attempt|
puts "Device #{attempt.device_token} failed at #{attempt.timestamp}"
end
end
from grocer.
Hello @alifjamaluddin. I'm going to close this Issue due to inactivity. Please re-open it if you are still experiencing the problem and/or have more information to add.
Thank you!
from grocer.
Related Issues (20)
- Push sent succesfully, the lockscreen wakes up but notification doesnt show up HOT 3
- connection drops silently when notification sent to sandbox device token no error, no broken pipe not a single clue HOT 2
- New HTTP/2 Push Notification Provider API from Apple HOT 10
- Alert field HOT 1
- OpenSSL::SSL::SSLError: SSL_connect SYSCALL returned=5 errno=0 state=SSLv3 read server session ticket A HOT 2
- Send notifications using HTTP/2 request HOT 1
- Notification arrives in iphone5, but not in ipad HOT 4
- Rspec test case for sending ios push notification with Grocer is not working HOT 2
- Not getting notifications when badge value changed HOT 6
- Errno::EPIPE: Broken pipe HOT 2
- Best practice on using grocer for large scale push notifications HOT 2
- Best practice on using grocer for large scale push notifications
- Success method undefined on notification HOT 3
- SSL_connect returned=1 errno=0 state=unknown state: tlsv1 alert internal error HOT 2
- APNS p8 certificate HOT 2
- Acceptance testing server not working? HOT 1
- Fixnum deprecated in Ruby 2.4 HOT 1
- Not sending notifications in production using with heroku HOT 2
- Not working anymore? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grocer.