Skip to content

Commit

Permalink
migrate to v20
Browse files Browse the repository at this point in the history
  • Loading branch information
magnustw committed Aug 14, 2024
1 parent 4e884d3 commit 42086e2
Show file tree
Hide file tree
Showing 1,103 changed files with 27,385 additions and 9,108 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest]
version: [2.5, 2.6, 2.7, '3.0']
version: ['3.0', '3.2']
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.

## Unreleased

## v17.0.0


### Added
- `advanced_measurement_table` field to Event for Conversion API

## v0.11.0.0


Expand Down
116 changes: 59 additions & 57 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,104 +1,106 @@
PATH
remote: .
specs:
facebookbusiness (0.14.0.0)
facebookbusiness (20.0.0)
concurrent-ruby (~> 1.1)
countries (~> 3.0)
faraday (~> 2.7.4)
faraday-multipart
json (~> 2.2)
countries (>= 3, < 6)
faraday (~> 2.6)
faraday-multipart (~> 1.0.4)
json (~> 2.6)
money (~> 6.13)

GEM
remote: https://rubygems.org/
specs:
ast (2.4.1)
awesome_print (1.8.0)
ast (2.4.2)
awesome_print (1.9.2)
byebug (11.1.3)
coderay (1.1.3)
concurrent-ruby (1.1.7)
concurrent-ruby (1.3.3)
coolline (0.5.0)
unicode_utils (~> 1.4)
countries (3.0.1)
i18n_data (~> 0.10.0)
sixarm_ruby_unaccent (~> 1.1)
unicode_utils (~> 1.4)
diff-lcs (1.4.4)
dotenv (2.7.6)
faraday (2.7.4)
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
countries (5.7.2)
unaccent (~> 0.3)
diff-lcs (1.5.0)
dotenv (2.8.1)
faraday (2.9.2)
faraday-net_http (>= 2.0, < 3.2)
faraday-multipart (1.0.4)
multipart-post (~> 2)
faraday-net_http (3.0.2)
i18n (1.8.5)
faraday-net_http (3.1.0)
net-http
i18n (1.14.5)
concurrent-ruby (~> 1.0)
i18n_data (0.10.0)
json (2.6.3)
json (2.7.2)
method_source (1.0.0)
minitest (5.14.4)
money (6.13.8)
money (6.19.0)
i18n (>= 0.6.4, <= 2)
multipart-post (2.3.0)
parallel (1.19.2)
parser (2.7.1.4)
multipart-post (2.4.1)
net-http (0.4.1)
uri
parallel (1.22.1)
parser (3.2.0.0)
ast (~> 2.4.1)
pry (0.13.1)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
pry-coolline (0.2.5)
pry-coolline (0.2.6)
coolline (~> 0.5)
rainbow (3.0.0)
rake (13.0.1)
regexp_parser (1.7.1)
rexml (3.2.4)
rspec (3.9.0)
rspec-core (~> 3.9.0)
rspec-expectations (~> 3.9.0)
rspec-mocks (~> 3.9.0)
rspec-core (3.9.2)
rspec-support (~> 3.9.3)
rspec-expectations (3.9.2)
pry (~> 0.13)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.6.2)
rexml (3.3.3)
strscan
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
rspec-mocks (~> 3.12.0)
rspec-core (3.12.0)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-mocks (3.9.1)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-support (3.9.3)
rubocop (0.89.1)
rspec-support (~> 3.12.0)
rspec-support (3.12.0)
rubocop (0.93.1)
parallel (~> 1.10)
parser (>= 2.7.1.1)
parser (>= 2.7.1.5)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.7)
regexp_parser (>= 1.8)
rexml
rubocop-ast (>= 0.3.0, < 1.0)
rubocop-ast (>= 0.6.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 2.0)
rubocop-ast (0.3.0)
parser (>= 2.7.1.4)
ruby-progressbar (1.10.1)
ruby2_keywords (0.0.5)
sixarm_ruby_unaccent (1.2.0)
unicode-display_width (1.7.0)
rubocop-ast (1.24.1)
parser (>= 3.1.1.0)
ruby-progressbar (1.11.0)
strscan (3.1.0)
unaccent (0.4.0)
unicode-display_width (1.8.0)
unicode_utils (1.4.0)
uri (0.13.0)

PLATFORMS
ruby
arm64-darwin-22
x86_64-darwin-20
x86_64-linux

DEPENDENCIES
awesome_print (~> 1.8)
bundler (~> 2.1.4)
bundler (~> 2.2)
byebug (~> 11.0)
countries (~> 3.0)
dotenv (~> 2.7)
facebookbusiness!
minitest (~> 5.14.2)
money (~> 6.13)
pry (~> 0.12)
pry-coolline (~> 0.2)
rake (~> 13.0)
rspec (~> 3.8)
rubocop (~> 0.71)

BUNDLED WITH
2.1.4
2.2.33
3 changes: 2 additions & 1 deletion LICENSE.txt → LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Copyright (c) 2017-present, Facebook, Inc. All rights reserved.
Copyright (c) Meta Platforms, Inc. and affiliates.
All rights reserved.

You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
copy, modify, and distribute this software in source code or binary form for use
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Facebook Business SDK for Ruby

[![Packagist](https://img.shields.io/gem/v/facebookbusiness)](https://rubygems.org/gems/facebookbusiness)
[![License](https://img.shields.io/badge/license-Facebook%20Platform-blue.svg?style=flat-square)](https://github.com/facebook/facebook-ruby-business-sdk/blob/main/LICENSE.txt)
[![Build Status](https://img.shields.io/github/actions/workflow/status/facebook/facebook-ruby-business-sdk/ci.yml)](https://github.com/facebook/facebook-ruby-business-sdk/actions/workflows/ci.yml)

### Introduction

The Facebook <a href="https://developers.facebook.com/docs/business-sdk" target="_blank">Business SDK</a> is a one-stop shop to help our partners better serve their businesses. Partners are using multiple Facebook API's to server the needs of their clients. Adopting all these API's and keeping them up to date across the various platforms can be time consuming and ultimately prohibitive. For this reason Facebook has developed the Business SDK bundling many of its APIs into one SDK to ease implementation and upkeep. The Business SDK is an upgraded version of the Marketing API SDK that includes the Marketing API as well as many Facebook APIs from different platforms such as Pages, Business Manager, Instagram, etc.
The Facebook <a href="https://developers.facebook.com/docs/business-sdk" target="_blank">Business SDK</a> is a one-stop shop to help our partners better serve their businesses. Partners are using multiple Facebook API's to serve the needs of their clients. Adopting all these API's and keeping them up to date across the various platforms can be time consuming and ultimately prohibitive. For this reason Facebook has developed the Business SDK bundling many of its APIs into one SDK to ease implementation and upkeep. The Business SDK is an upgraded version of the Marketing API SDK that includes the Marketing API as well as many Facebook APIs from different platforms such as Pages, Business Manager, Instagram, etc.

## Quick Start

Expand All @@ -11,7 +15,7 @@ Business SDK <a href="https://developers.facebook.com/docs/business-sdk/getting-
## Pre-requisites

### Ruby Version
We developed this SDK using Ruby 2.0, and supports Ruby 2.0+, however, the SDK is not thread-safe at the moment.
The minimum version supported is Ruby 3.0.

### Register An App

Expand Down
35 changes: 35 additions & 0 deletions examples/AdAccountAdCreativesEdge.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
# copy, modify, and distribute this software in source code or binary form for use
# in connection with the web services and APIs provided by Facebook.
#
# As with any software that integrates with the Facebook platform, your use of
# this software is subject to the Facebook Platform Policy
# [http://developers.facebook.com/policy/]. This copyright notice shall be
# included in all copies or substantial portions of the software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

require 'facebook_ads'

access_token = '<ACCESS_TOKEN>'
app_secret = '<APP_SECRET>'
app_id = '<APP_ID>'
id = '<AD_ACCOUNT_ID>'

FacebookAds.configure do |config|
config.access_token = access_token
config.app_secret = app_secret
end

ad_account = FacebookAds::AdAccount.get(id)
adcreativess = ad_account.adcreatives({
fields: { 'name' },
})
36 changes: 36 additions & 0 deletions examples/AdAccountAdCreativesPost.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
# copy, modify, and distribute this software in source code or binary form for use
# in connection with the web services and APIs provided by Facebook.
#
# As with any software that integrates with the Facebook platform, your use of
# this software is subject to the Facebook Platform Policy
# [http://developers.facebook.com/policy/]. This copyright notice shall be
# included in all copies or substantial portions of the software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

require 'facebook_ads'

access_token = '<ACCESS_TOKEN>'
app_secret = '<APP_SECRET>'
app_id = '<APP_ID>'
id = '<AD_ACCOUNT_ID>'

FacebookAds.configure do |config|
config.access_token = access_token
config.app_secret = app_secret
end

ad_account = FacebookAds::AdAccount.get(id)
adcreatives = ad_account.adcreatives.create({
name: 'Sample Promoted Post',
object_story_id: '<pageID>_<postID>',
})
35 changes: 35 additions & 0 deletions examples/AdAccountAdCreativesPostCreateAdCreative.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
# copy, modify, and distribute this software in source code or binary form for use
# in connection with the web services and APIs provided by Facebook.
#
# As with any software that integrates with the Facebook platform, your use of
# this software is subject to the Facebook Platform Policy
# [http://developers.facebook.com/policy/]. This copyright notice shall be
# included in all copies or substantial portions of the software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

require 'facebook_ads'

access_token = '<ACCESS_TOKEN>'
app_secret = '<APP_SECRET>'
app_id = '<APP_ID>'
id = '<AD_ACCOUNT_ID>'

FacebookAds.configure do |config|
config.access_token = access_token
config.app_secret = app_secret
end

ad_account = FacebookAds::AdAccount.get(id)
adcreatives = ad_account.adcreatives.create({
object_story_id: '<pageID>_<postID>',
})
36 changes: 36 additions & 0 deletions examples/AdAccountAdCreativesPostCreateAdCreativeCanvas.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
# copy, modify, and distribute this software in source code or binary form for use
# in connection with the web services and APIs provided by Facebook.
#
# As with any software that integrates with the Facebook platform, your use of
# this software is subject to the Facebook Platform Policy
# [http://developers.facebook.com/policy/]. This copyright notice shall be
# included in all copies or substantial portions of the software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

require 'facebook_ads'

access_token = '<ACCESS_TOKEN>'
app_secret = '<APP_SECRET>'
app_id = '<APP_ID>'
id = '<AD_ACCOUNT_ID>'

FacebookAds.configure do |config|
config.access_token = access_token
config.app_secret = app_secret
end

ad_account = FacebookAds::AdAccount.get(id)
adcreatives = ad_account.adcreatives.create({
image_hash: '<imageHash>',
object_story_spec: {'page_id':'<pageID>','link_data':{'image_hash':'<imageHash>','link':'<canvasURI>','name':'Creative message','call_to_action':{'type':'LEARN_MORE'}}},
})
Loading

0 comments on commit 42086e2

Please sign in to comment.