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

Cannot add user to custom audience on Ruby 3.2 #198

Closed
fout-hiroshi opened this issue Jun 16, 2023 · 0 comments
Closed

Cannot add user to custom audience on Ruby 3.2 #198

fout-hiroshi opened this issue Jun 16, 2023 · 0 comments

Comments

@fout-hiroshi
Copy link

Which SDK version are you using?

  • facebookbusiness 17.0.0
  • ruby 3.2.2

What's the issue?

Cannot add user to custom audience

Steps/Sample code to reproduce the issue

require "facebookbusiness"

access_token = <ACCESS_TOKEN>
app_secret = <APP SECRET>
customaudience_id = <CUSTOM_AUDIENCE_ID>
device_ids = ['AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA']
session = FacebookAds::Session.new(access_token: access_token, app_secret: app_secret)
customaudience = FacebookAds::CustomAudience.get(customaudience_id, session)
customaudience.add_user(device_ids, "MOBILE_ADVERTISER_ID")

Observed Results:

Fail to add user with following error:

facebookbusiness-17.0.0/lib/facebook_ads/ad_objects/helpers/custom_audience_helpers.rb:61:in `prepare_params': wrong number of arguments (given 3, expected 2) (ArgumentError)

With my observation, this is raised by the incompatibility of keyword arguments in Ruby 3.0.

https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/

Expected Results:

Can add user to Custom Audience

Related Cases:

#136

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

2 participants