Sha256: 1082416c75110f0075f05e4c848998b5f575bb06728803b512ed6ce78e3a8ef4

Contents?: true

Size: 755 Bytes

Versions: 2

Compression:

Stored size: 755 Bytes

Contents

require 'one_signal'

class NotificationPusher::OneSignal

    def initialize notification, options = {}
        if options[:player_ids].any?
            ::OneSignal::Notification.create params: {
                app_id: options[:app_id],
                url: options[:url] || notification.metadata[:onesignal_url],
                contents: options[:contents] || notification.metadata[:onesignal_contents].to_h,
                headings: options[:headings] || notification.metadata[:onesignal_headings].to_h,
                subtitle: options[:subtitle] || notification.metadata[:onesignal_subtitle].to_h,
                include_player_ids: options[:player_ids]
    		}, opts: { auth_key: options[:auth_key] }
        end
    end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
notification-pusher-onesignal-1.2.5 lib/notification_pusher/one_signal.rb
notification-pusher-onesignal-1.2.4 lib/notification_pusher/one_signal.rb