Skip to content

[Bug]: Notification class missing name attribute #20

@damonbauer

Description

@damonbauer

What happened?

When initializing a new Notification, the name attribute is missing. It's available in the Create Notification documentation.

Steps to reproduce?

  1. Install v1.0.1 of this library
  2. Initialize the API
one_signal_api = OneSignal::DefaultApi.new
  1. Initialize a new Notification with the following attributes:
notification = OneSignal::Notification.new({
  app_id: APP_ID,
  include_external_user_ids: ['SOME_EXTERNAL-USER-ID'],
  channel_for_external_user_ids: ["push"],
  headings: {en: 'TITLE'},
  contents: {en: 'BODY'},
  name: 'INTERNAL_CAMPAIGN_NAME'
})
  1. Send the notification
one_signal_api.create_notification(notification)

What did you expect to happen?

I expected the SDK to allow a Notification to include the name attribute, set to INTERNAL_CAMPAIGN_NAME.

Relevant log output

WARN: ArgumentError: `name` is not a valid attribute in `OneSignal::Notification`. Please check the name to make sure it's valid. List of attributes: [:included_segments, :excluded_segments, :last_session, :first_session, :session_count, :session_time, :amount_spent, :bought_sku, :tag, :language, :app_version, :location, :email, :country, :include_player_ids, :include_external_user_ids, :include_email_tokens, :include_phone_numbers, :include_ios_tokens, :include_wp_wns_uris, :include_amazon_reg_ids, :include_chrome_reg_ids, :include_chrome_web_reg_ids, :include_android_reg_ids, :id, :value, :aggregation, :is_ios, :is_android, :is_huawei, :is_any_web, :is_chrome_web, :is_firefox, :is_safari, :is_wp_wns, :is_adm, :is_chrome, :channel_for_external_user_ids, :app_id, :external_id, :contents, :headings, :subtitle, :data, :huawei_msg_type, :url, :web_url, :app_url, :ios_attachments, :template_id, :content_available, :mutable_content, :target_content_identifier, :big_picture, :huawei_big_picture, :adm_big_picture, :chrome_big_picture, :chrome_web_image, :buttons, :web_buttons, :ios_category, :android_channel_id, :huawei_channel_id, :existing_android_channel_id, :huawei_existing_channel_id, :android_background_layout, :small_icon, :huawei_small_icon, :large_icon, :huawei_large_icon, :adm_small_icon, :adm_large_icon, :chrome_web_icon, :chrome_web_badge, :firefox_icon, :chrome_icon, :ios_sound, :android_sound, :huawei_sound, :adm_sound, :wp_wns_sound, :android_led_color, :huawei_led_color, :android_accent_color, :huawei_accent_color, :android_visibility, :huawei_visibility, :ios_badge_type, :ios_badge_count, :collapse_id, :web_push_topic, :apns_alert, :send_after, :delayed_option, :delivery_time_of_day, :ttl, :priority, :apns_push_type_override, :throttle_rate_per_minute, :android_group, :android_group_message, :adm_group, :adm_group_message, :thread_id, :summary_arg, :summary_arg_count, :email_subject, :email_body, :email_from_name, :email_from_address, :sms_from, :sms_media_urls]
2022-08-02T20:21:17.039Z pid=56631 tid=26l3 WARN: /Users/damonbauer/.rvm/gems/ruby-2.7.5/gems/onesignal-1.0.1/lib/onesignal/models/notification.rb:653:in `block in initialize'

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions