Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module ApnsAdapters
- class Sync
- def notify(device_token, text, app_name)
- notification = Grocer::Notification.new(
- device_token: device_token,
- alert: text,
- )
- GrocerFactory.instance.pusher_for(app_name) do |pusher|
- pusher.push(notification)
- end
- end
- end
- end
- module ApnsAdapters
- class Async
- def notify(device_token, text)
- Resque.enqueue(ApnsJob, device_token, text)
- end
- end
- end
- module ApnsAdapters
- class Fake
- attr_reader :delivered
- def initialize
- clear
- end
- def notify(device_token, text)
- @delivered << [device_token, text]
- end
- def clear
- @delivered = []
- end
- end
- end
- set_locales
- set_timezone
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement