OneSignal / onesignal-ruby-api

Other
15 stars 12 forks source link

[question]: Unclear behavior when not specifying is_android and is_ios flags #33

Open mochizuki-pg opened 1 year ago

mochizuki-pg commented 1 year ago

How can we help?

when I tried sending notifications to users who are subscribed on both Android and iOS platforms, I noticed that unless I explicitly set the is_android and is_ios flags, notifications weren't sent to my Android users.

OneSignal::Notification.new(
  app_id: ,
  contents: ,
  channel_for_external_user_ids: 'push',
  include_external_user_ids: ,
  app_url: ,
  ios_attachments: ,
  existing_android_channel_id: ,
  is_ios: true,    
  is_android: true 
)

documentation lists several flags like is_android, is_ios, is_huawei, is_any_web, is_chrome_web, is_firefox, is_safari, is_wp_wns, is_adm, and is_chrome as [optional]. However, the observed behavior suggests that we might need to specify them to ensure delivery. while these parameters are labeled as optional, do we essentially need to specify all of them to ensure the messages are delivered correctly?

The discrepancy between the documentation and the actual behavior has caused some confusion. Any clarification or guidance on this matter would be greatly appreciated.

Code of Conduct

bismark64 commented 1 year ago

Same issue here. Is this optional or required? What about if we don't want to specify to which platform we want to deliver?

mochizuki-pg commented 1 year ago

@bismark64 Perhaps it is better to specify true or false explicitly, although the documentation mentions optional

mochizuki-pg commented 1 year ago

For iOS only, I could send without writing When adding other devices, such as Android, it was not sent to Android unless I explicitly wrote true.

bismark64 commented 1 year ago

Yeah docs are really not clear regarding this. It's not optional if without it, it does not work imo.. It works for ios because is_ios defaults to true in any request. But if you want any other device, apparently, you need to explicitly define it.