Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Duplicated pushes #19

Open
ghost opened this issue Jul 9, 2013 · 2 comments
Open

Duplicated pushes #19

ghost opened this issue Jul 9, 2013 · 2 comments

Comments

@ghost
Copy link

ghost commented Jul 9, 2013

Hello, I'm using your gem for one of my project.
The project allows the user to send a push notification of an event, a user can have multiple events.
When I use this code to send the push:

push_notification.devices.each do |d|
         APNS.send_notification(d.token, :alert => push_notification.event.title, :badge => 0, :sound => 'default', :other => {:event_id => push_notification.event.id})  
      end

everything works fine.

if insteas I use this code

 pushes = [] 
      push_notification.devices.each do |d|
         pushes << APNS::Notification.new(d.token, :alert => push_notification.event.title, :badge => 0, :sound => 'default', :other => {:event_id => push_notification.event.id})  
      end
       APNS.send_notifications(pushes)

I receive, on the phone side, pushes for events I pushed even yesterday (actually for all the events that have been pushed).
I'm not saying this is a bug of your gem, maybe it's about the way the apple manages the push requests, just to let you know.

@toto
Copy link
Contributor

toto commented Aug 30, 2013

It is a bug I the gem. More precisely in my update to it. Please use either an older version or my fork (https://github.com/toto/APNS) until it is fixed.

@arthurchui
Copy link

@jpoz I experienced the same issue as well. Looks like master...toto:master had the proper fix. Do you plan to merge it?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants