Sha256: ecdf5ee7850a14a4fa78e442a15b7e003593e22d956c41e1b0b82cc5f814f260

Contents?: true

Size: 752 Bytes

Versions: 7

Compression:

Stored size: 752 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,
                headers: options[:headers] || notification.metadata[:onesignal_headers].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

7 entries across 7 versions & 1 rubygems

Version Path
notification-pusher-onesignal-1.2.3 lib/notification_pusher/one_signal.rb
notification-pusher-onesignal-1.2.2 lib/notification_pusher/one_signal.rb
notification-pusher-onesignal-1.2.1 lib/notification_pusher/one_signal.rb
notification-pusher-onesignal-1.2.0 lib/notification_pusher/one_signal.rb
notification-pusher-onesignal-1.1.2 lib/notification_pusher/one_signal.rb
notification-pusher-onesignal-1.1.1 lib/notification_pusher/one_signal.rb
notification-pusher-onesignal-1.1.0 lib/notification_pusher/one_signal.rb