やりたいこと
Facebookの友達リストを取得したいです。
#試したこと
こちらの記事を参考し、facebookでログインできました。
https://qiita.com/makoto15/items/ad124f611cb8adb2cf1d#%EF%BC%90%E5%89%8D%E6%8F%90
データーベースを参照したら以下のようになっているのですが、これだけだと友達リストの取得の仕方がよくわからなくて、誰が御教授いただけませんか。
User id: 1, email: "xxx", created_at: "2019-07-13 11:36:46", updated_at: "2019-07-13 11:36:46", uid: "xxxxx", provider: "facebook", name: "xxx", image: "xxxxxxx"
環境
Gemfile
1source 'https://rubygems.org' 2git_source(:github) { |repo| "https://github.com/#{repo}.git" } 3 4ruby '2.5.3' 5gem 'devise' 6gem 'omniauth' 7gem 'omniauth-facebook' 8gem 'dotenv-rails' 9 10# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 11gem 'rails', '~> 5.2.3' 12# Use sqlite3 as the database for Active Record 13gem 'sqlite3' 14# Use Puma as the app server 15gem 'puma', '~> 3.11' 16# Use SCSS for stylesheets 17gem 'sass-rails', '~> 5.0' 18# Use Uglifier as compressor for JavaScript assets 19gem 'uglifier', '>= 1.3.0' 20# See https://github.com/rails/execjs#readme for more supported runtimes 21# gem 'mini_racer', platforms: :ruby 22 23# Use CoffeeScript for .coffee assets and views 24gem 'coffee-rails', '~> 4.2' 25# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks 26gem 'turbolinks', '~> 5' 27# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 28gem 'jbuilder', '~> 2.5' 29# Use Redis adapter to run Action Cable in production 30# gem 'redis', '~> 4.0' 31# Use ActiveModel has_secure_password 32# gem 'bcrypt', '~> 3.1.7' 33 34# Use ActiveStorage variant 35# gem 'mini_magick', '~> 4.8' 36 37# Use Capistrano for deployment 38# gem 'capistrano-rails', group: :development 39 40# Reduces boot times through caching; required in config/boot.rb 41gem 'bootsnap', '>= 1.1.0', require: false 42 43group :development, :test do 44 # Call 'byebug' anywhere in the code to stop execution and get a debugger console 45 gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] 46end 47 48group :development do 49 # Access an interactive console on exception pages or by calling 'console' anywhere in the code. 50 gem 'web-console', '>= 3.3.0' 51 gem 'listen', '>= 3.0.5', '< 3.2' 52 # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 53 gem 'spring' 54 gem 'spring-watcher-listen', '~> 2.0.0' 55end 56 57group :test do 58 # Adds support for Capybara system testing and selenium driver 59 gem 'capybara', '>= 2.15' 60 gem 'selenium-webdriver' 61 # Easy installation and use of chromedriver to run system tests with Chrome 62 gem 'chromedriver-helper' 63end 64 65# Windows does not include zoneinfo files, so bundle the tzinfo-data gem 66gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
あなたの回答
tips
プレビュー