Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question]: when creating a Notification should isIos default to true? #19

Open
1 task done
scottbartell opened this issue Jun 30, 2022 · 3 comments
Open
1 task done

Comments

@scottbartell
Copy link

scottbartell commented Jun 30, 2022

How can we help?

Is it intentional for isIos to default to true when creating a Notification?

For example, this request (that doesn't specify is_ios) results in an API request with a body where isIos is set to true:

notification = OneSignal::Notification.new({
  app_id: 'YOUR APP ID',
  include_external_user_ids: [user.id],
  channel_for_external_user_ids: 'push',
  contents: {
    en: body
  },
})
one_signal_client.create_notification(notification)

It looks like it's because of this default: https://github.com/OneSignal/onesignal-ruby-api/blob/master/lib/onesignal/models/notification.rb#L793

Code of Conduct

  • I agree to follow this project's Code of Conduct
@kesheshyan
Copy link
Contributor

Hey @scottbartell, thanks for the question. We are about to release an update that should mitigate this issue. I will update this thread when it's done. Thanks!

@FinnLawrence
Copy link

As far as I can see this is still happening in the current version.

isIos silently defaults to true, meaning my notifications weren't targeting Android at all - since targeting any platform turns off the others in the API.

Need to add both is_ios and is_android as true in the notification payload to get it sending to both platforms

@sherwinski
Copy link
Contributor

Thanks for the callout @FinnLawrence. I'm unfamiliar with why this default was added so let me dig into it a bit more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants