You are reading about how to unhide someone else’s post on facebook. Here are the best content from the team C0 thuy son tnhp synthesized and compiled from many sources, see more in the category How To.

Bạn đang xem: Cách sử dụng facebook timeline cleaner


5How to lớn unhide a post on Facebook on desktop and mobile to lớn make posts from friends visible again <4>
13Unhide a individual story/post that was hidden by the reader và used to lớn be on the Facebook news feed or the poster’s page <12>
While hiding posts on Facebook is just a single click away, bringing back or figuring out how to lớn unhide a post on Facebook can be a challenging task.. In this article, I’ve written down the steps to lớn unhide posts on Facebook on desktop as well as on Android/i
OS.
Hiding a post allows you to get back at it at a better time or as you deem it necessary.. There are certain situations where you might need khổng lồ unhide a Facebook post:
You changed your mind: We’re frequently greeted with posts on our timeline from our friends or family that can sometimes seem a bit surprising or awkward. While the first instinct is usually lớn remove the content, you might want lớn bring it back after some consideration.
This article was co-authored by wiki
How staff writer, Nicole Levine, MFA. Nicole Levine is a giải pháp công nghệ Writer & Editor for wiki
How
Nicole also holds an MFA in Creative Writing from Portland State University & teaches composition, fiction-writing, và zine-making at various institutions.. An easy-to-follow guide for showing posts from Friends on Facebook
Download Article
Nicole Levine is a công nghệ Writer & Editor for wiki
How. She has more than 20 years of experience creating technical documentation và leading tư vấn teams at major web hosting & software companies
Hiding someone on your Facebook friends list banishes their posts & updates from the News Feed that displays on your Facebook homepage. If you change your mind later and decide that you want to view updates from your hidden friend, acquaintance or work colleague again, you can unhide the person by changing the News Feed settings on your homepage or your friend’s Timeline page
Sign in khổng lồ your Facebook trương mục to xuất hiện your homepage.. Mouse over the “News Feed” button in the sidebar to display the “Edit” button with the pen icon.
Facebook lists the friends you’ve hidden next to “Hide posts from” in the dialog window.. Click the “x” button next to lớn the name of the friend who you want to unhide.
– khổng lồ unhide a post on Facebook, select the Activity Log from the three-dotted thực đơn near your cover photo.. – Once in your Activity Log, unhide a post on Facebook by clicking the “Filter” link and choosing the “Hidden from timeline” option.
Facebook provides a quick and easy way to hide a post you’ve created without actually deleting it. This is convenient for removing it temporarily from your timeline.
You can unhide a post on Facebook on a desktop browser or the mobile ứng dụng through the Hidden from timeline filter in your Activity Log located in the three-dotted menu of your profile page.
Find out how to unhide a post on Facebook, whether you’re using a desktop browser or a smartphone app.. Facebook makes the nội dung that appears on your personal page easy to lớn manage
But what if you didn’t mean khổng lồ remove the post or you changed your mind about hiding the content?. Even if you’re an experienced social truyền thông media manager, it isn’t easy to lớn figure out how to locate a hidden Facebook post.
Although the steps lớn reveal a hidden post aren’t exactly obvious, the process is relatively simple.. Related Post: How to Remove a Page from the Facebook Business Manager
Facebook is a popular social network worldwide, used for various purposes. For some, it is just a social network – a place where you can find out news about loved ones & chat with friends
If you belong lớn the latter category, hiding posts from the Facebook page will allow you always lớn offer up-to-date information & relevant advertising content.. Even if sometimes it seems better khổng lồ delete a post, this is not always the best solution, and you are hiding it with a few clicks
Whether you are using a desktop browser or a Facebook tiện ích on a thiết bị di động device, you can unhide a post on Facebook. Though the process to reveal a hidden post is not apparent, it is still straightforward
Have you hidden a questionable post or phản hồi from your Facebook business page, but changed your mind about it?. If, on reflection, you’re fine with your followers seeing, reacting to, & interacting with the content, you can reverse your decision và unhide it.
Managing social media nội dung has never been easier. One easy-to-use platform.Start your không tính tiền 15-day trial
In 2020, Facebook quietly removed the option of hiding original posts that have already been published to business pages. The only published posts you can still hide are posts about events such as cover photo và profile image updates.
Facebook allows you khổng lồ show the post you once hid back khổng lồ your profile. In addition to lớn unhiding your own post, it also lets you unhide someone else’s post
However, unhiding your own post from your timeline might get tricky.. You can unhide your own posts in both the web and mobile application versions of Facebook.
– Navigate to lớn the post you want to unhide và click the three dots icon beside it.. – Tap on your Profile Picture beside the “what’s on your mind?” bar at the vị trí cao nhất of your home page.
Facebook allows you to manage your data easily: you can choose what khổng lồ show or hide. Given that, you always have the right khổng lồ reveal all previously removed content from your timeline
– Go khổng lồ the Activity Log by clicking on the three-dotted thực đơn next to your cover photo.. – Select the “Hidden from Timeline” option when filtering the results.
While you can unhide any post, you need to lớn be sure that you actually want to bởi it. After all, creating a cohesive account that will contribute rather than compromise your reputation is essential in the world where your online image is shaped by social media
Have you ever accidentally hidden a post from someone on Facebook and struggled lớn unhide it? Or perhaps you intentionally hid a friend’s post but now regret it and want lớn see their updates again? Whatever the reason, unhiding someone else’s post on Facebook is a simple process that you can complete in just a few clicks. In this article, we’ll guide you through the steps lớn unhide someone else’s post on Facebook.
When you hide a friend’s post, it will be removed from your newsfeed, and you won’t see any future updates from that person unless you undo your action. However, keep in mind that hiding someone’s post doesn’t mean that they’re unfriended or blocked.
Click on “Settings,” and then select “News Feed Preferences.” From there, click “Unhide People” lớn view all of the people whose posts are currently hidden in your feed. You can easily unhide anyone by clicking on their name and selecting “Save.”
Affiliate links on game android Authority may earn us a commission. If you’ve hidden (rather than deleted) a post và want to lớn get it back, here’s how to lớn unhide a Facebook post using the app và the website.
Then, tap on the three dots icon (…) > Activity Log > View Activity History > Filters > Categories > Logged actions & other activities > Hidden from profile. Next, tap the three dots icon (…) next to the post you want lớn unhide & select add to profile.
Then, from the left sidebar, choose Logged actions và other activity > Hidden from profile. Lớn unhide a post, click on the three dots (…) next khổng lồ a post & select showroom to profile.

Unhide a individual story/post that was hidden by the reader & used to lớn be on the Facebook news feed or the poster’s page <12>


I accidentally hid an individual post by someone else (or story as Facebook calls it) on the news feed. The post is now hidden everywhere, even on the page of the poster
Facebook gave me the option lớn undo it, but after a simple refresh of the page it disappeared. The post in question was by Mac
Rumors, and I did it again with the Make
Use
Of page to demo it
Is there any way to unhide posts? The solution may also be a simple script/tool lớn fool Facebook so that it shows the undo button khổng lồ unhide again.. Unhide a individual story/post that was hidden by the reader và used khổng lồ be on the Facebook news feed or the poster’s page
Facebook is a social network used by all types of people. But all categories of users have different reasons for hiding or unhiding posts
Although the easier option would be khổng lồ delete Facebook posts, in certain instances, you need the option to return them to lớn your profile quickly. Up until recently, hiding & unhiding posts on Facebook was effortless
That said, there is still a way to lớn hide unwanted posts và unhide them later.. Some people simply lượt thích to have their Facebook timeline clean và often hide old & unwanted posts
Hiding posts is a standard kích hoạt on Facebook — but a reversible one. You may have hidden old photos of yourself you found embarrassing but now want lớn retrieve them
The steps of viewing hidden posts are relatively simple. But it helps khổng lồ have guidance, especially when you’re completely oblivious of how you can unhide your content
Facebook gives its users total control over the nội dung on their timeline. So you can hide and unhide your nội dung or make them public or private when necessary
– Click on the three lines in the đứng top left corner of the main screen.. – Under “Hidden From Your News Feed,” find the post you want khổng lồ unhide và click on it.
There is no sure way lớn get a hidden post back on Facebook. If the post was hidden by mistake, you can try reaching out khổng lồ Facebook tư vấn for help
To unhide a post on your timeline, follow these steps:. Click on the three lines in the vị trí cao nhất left corner of the post.
You can change your privacy settings by clicking on the Accounts tab in your Facebook account.. Click on Privacy Settings to lớn control what you share và with whom you choose to share
You may have some friends who post too many status messages, & you don’t want too much information turning up on your home Page new feed. You don’t want lớn unfriend or block them permanently, but you vày want to hide their posts
If you chose khổng lồ hide a friend on Facebook, the decision is always reversible. Lớn unhide a friend, scroll down on your trang chủ Page until you get to lớn the bottom
Facebook offers control to lớn users over who can see what they share. Plus, you can also control what appears on your Facebook page, allowing you lớn hide and/or delete posts from your Timeline, Feed, or Profile.
– Why bởi vì you need khổng lồ hide/unhide content on Facebook. – How can you control who sees what you share on Facebook
– How to lớn hide a post shared on your Facebook Profile. – How to lớn hide and unhide comments on a Facebook Post
Open Instagram on your mobile phone and go lớn the profile of the person whose posts you want khổng lồ unhide. Mở cửa the screen where you’ll find three lines in the đứng đầu left corner
Pressing the big button on the right side of the screen, is how you will unhide Instagram followers.. Khổng lồ show pictures on Instagram, first open the app and then click on the three lines in the đứng top left corner of the main screen
You can hide your profile from other people by selecting “Only Me” under Settings > Privacy.. Khổng lồ delete posts, go to a specific post.Click the down arrow to lớn the right of the word “Comments”, above the post that contains the comments you want to lớn delete.You will now see a drop-down menu with three options: “Leave a comment”, “Report inappropiate content” or “Delete post.” Select the option you want to lớn use.
For many, creating a Facebook tài khoản is so easy that it became the first social network in the world. Và if you’re lượt thích me, you may have a profile that’s about ten years old
In principle, because of the large amount of photography you have & the friendship you have achieved all these years.. However, despite the time you’ve been using Facebook, you still haven’t fully understood the functions it has
This is because the common ones are usually used, while the rest are just ignored. In fact, there is an phầm mềm for companies called Facebook Business Manager
Undoubtedly, Facebook offers users many juicy features khổng lồ keep them returning to lớn the app.. Only a few people won’t be tempted to use Facebook with Facebook Reels, Stories, Games, Events, và Videos.
This feature has been good so far as it lets people know if you have mutual friends.. However, exposing a friend list might feel too vulnerable for some people; hence, they hide it.
You can unhide your Friends danh mục on Facebook at any time. To lớn unhide the friend các mục on Facebook, follow these straightforward steps:
*
20 how to lớn unhide someone else’s post on facebook Tutorial
https://statusbrew.com/insights/unhide-posts-on-facebook/https://www.wikihow.com/Unhide-Friends%27-Posts-on-Facebookhttps://smallbusiness.chron.com/unhide-somebody-facebook-62649.htmlhttps://www.businessinsider.com/guides/tech/how-to-unhide-a-post-on-facebookhttps://www.agorapulse.com/blog/unhide-post-facebook/https://vistasocial.com/insights/how-to-unhide-a-post-on-facebook-in-2022/https://blog.loomly.com/unhide-facebook-post/https://insidetheweb.com/how-to-unhide-post-in-facebook/https://onlypult.com/blog/unhide-a-post-on-facebookhttps://thcsngogiatu.edu.vn/how-to-unhide-someone-elses-post-on-facebook/https://www.androidauthority.com/unhide-facebook-post-3258525/https://webapps.stackexchange.com/questions/30166/unhide-a-individual-story-post-that-was-hidden-by-the-reader-and-used-to-be-on-thttps://www.online-tech-tips.com/computer-tips/how-to-hide-and-unhide-a-post-on-facebook/https://inkforall.com/ai-writing-tools/facebook-marketing/how-to-see-hidden-posts-on-facebook/https://kiiky.com/tech/how-do-you-unhide-a-post-on-facebook/https://computer.howstuffworks.com/internet/social-networking/networks/unhide-friends-facebook.htmhttps://sociality.io/blog/unhide-facebook-post/https://istouchidhackedyet.com/how-to-unhide-someones-posts-on-instagram/https://notesread.com/how-to-see-hidden-posts-on-a-friends-facebook/https://www.itgeared.com/how-to-unhide-friends-on-facebook/

Ở part lần trước, mình đã trình làng các kỹ thuật cơ phiên bản mà tài liệu facebook-graph-api cung ứng gồm : READ/CREATE/UPDATE/DELETEvới những nodes cùng edges , Read after write , Multiple ids lookup , Nested request .

Ở bài viết lần này, gồm 2 nội dung chính mà mình sẽ làm:

Ngoài các chức năng kể trên, mình sẽ giới thiệu thêm 1 tác dụng nâng cao: batch-api-request . Chức năng này cần thao tác khá lướt thướt khi triển khai trên tool explorer, vày vậy mình nuốm ý nhằm nó được ra mắt ở part-2 mang đến dễ hiểu. Đối cùng với mình, batch-api-request là một tác dụng rất quyền lực. Bản thân sẽ sử dụng nó để gia công 1 cái ứng dụng khá thú vui ở part 3.Đăng nhập rails app bằng facebook (Qua chức năng này, phầm mềm cần lấy về được access_token cùng lưu nó vào database như một thuộc tính của user .)Publish 1 dòng post lên trang fanpage mà lại user sử dụng app có quyền admin
Edit chiếc post đó.Delete cái post đó.Đồng thời like, và tạo nhiều comment lên chiếc post đó. (Batch-api-request)

1. Chế tác và thiết lập app bên trên trang Facebook for developer

Bây giờ giả sử các bạn đã sở hữu phần code của một chiếc rails phầm mềm ở thiết bị local của mình rồi. Việc các bạn cần làm là đăng ký và thiết lập nó bên trên trang facebook for developer . Tôi đã nói về kiểu cách đăng ký nó ở bài bác lần trước đề xuất lần này mình sẽ nói về việc thiết đặt một vài tham số bắt buộc thiết.Đầu tiên, trong phần thông số cơ bản, chúng ta hãy setup tên miền vận dụng của bạn.

*

Nếu chúng ta chỉ đang để rails tiện ích trong tâm trạng development, bạn có thể để thương hiệu miền là http://0.0.0.0:3000/ cũng được. Nhưng sẽ có được một đôi điều hay ho vẫn xảy ra, và mình sẽ bật mí những điều đó vào thời điểm khiến cho bạn dễ nắm bắt nhất.

Tiếp theo, bạn phải kích hoạt kỹ năng Đăng nhập facebook ở đoạn bảng điều khiển bằng phương pháp click vào nút thiết lập :

*

Sau đó, làm việc trong hành lang cửa số hiện lên, các bạn chỉ cần setup và save cái tên miền website cho bản thân là được, đừng có tác dụng những cách đằng sau:

*

Ok, cố là xong, giờ bạn có thể bắt đầu code chức năng đăng nhập facebook.

2. Đăng nhập bởi facebook(thủ công)

Bây giờ, mình sẽ làm tác dụng đăng nhập app của bản thân mình thông qua facebook, mục đích là để gửi các yêu tróc nã nhập thông tin ( permissions ) đến phía user và lấy về access_token . Tổng thể quá trình sẽ ra mắt theo flow cầm cố này:

*

Lúc đầu, bản thân định áp dụng gem omniauth để thực hiện công dụng nói trên. Tuy nhiên, sau khi khám phá về bí quyết đăng nhập bằng tay thủ công qua facebook , mình cảm giác nó bổ ích hơn cho bài viết lần này ở cả 2 điểm:

Thứ hai, khi thực hiện gem omniauth , bản thân không thực sự hiểu được flow của quá trình đăng nhập facebook như tôi đã vẽ ở trên. Vị vậy, trường hợp phải sử dụng một ngôn ngữ backend khác như PHPhoặc Java , mình sẽ không code được tính năng này.

Vì vậy , mình quyết định sẽ làm tính năng này theo cách thủ công.

Bước đầu tiên, mong tạo công dụng đăng nhập, bọn họ phải có một cái button Sign in with facebook để nhưng mà click vào. Chiếc button ấy đại loại được code như vậy này:

%= link_to "Sign in with facebook", %q(https://www.facebook.com/v3.2/dialog/oauth?client_id=#your_app_id>&scope#your_app_permissions&redirect_uri=#redirect_uri"), class: "btn btn-primary"%>Như chúng ta đã thấy, để cái button trên hoạt động, họ cần 3 tham số quan tiền trọng :

client_id : app_id đăng ký trên trang facebook for developers của bạn.scope : các permissions mà ứng dụng của bạn muốn yêu mong từ user .redirect_uri : Sau khi quy trình user xác thực cấp những permissions ngừng tại trang ủy quyền của facebook , trình để ý sẽ gửi về một đường truyền khác (thường là chuyển về đường dẫn đến phầm mềm của bạn) và đường dẫn này chính là redirect_uri.

Lưu ý, để button Sign in with facebook hoạt động, họ bắt buộc phải bao gồm 2 tham số: client_id với redirect_uri . Tham số scope là không bắt buộc, mặc dù nó vẫn rất đặc trưng vì nó tương quan trực tiếp nối quyền hạn về những loại dữ liệu mà tiện ích của chúng ta có thể sử dụng.

Mình vẫn đi vào cách để lấy từng tham số một. Đầu tiên là clien_id . Trước hết chúng ta phải đăng ký app của mình trên trang facebook for developer như nghỉ ngơi part một mình đã phía dẫn.Sau đó, bạn cũng có thể lấy app_id của mình ở vào dashboard như hình dưới đây:

*

Thế là dứt việc rước app_id . Tiếp theo, bản thân sẽ khẳng định tham số redirect_uri . Cụ thể là sau khi kết thúc quá trình xác nhận quyền truy vấn dữ liệu của user , bạn thích xử lý những bước tiếp theo nghỉ ngơi trong facebooks_controller và action login mà mình sẽ tạo. Điều đó đồng nghĩa tương quan với việc, redirect_uri là băng thông mà sẽ gửi trình thông dịch Ruby nhẩy vào action facebooks#login .Để thông số kỹ thuật đường dẫn này, trước hết, vào routes.rb, mình chế tạo 1 dòng singular resource thương hiệu là facebook , đồng thời sinh sản 1 facebooks_controller khớp ứng :

#routes.rbget "/facebook/login", to: "facebooks#login", as: "login"resource :facebookclass Facebooks
Controller Application
Controller def login over def new endend
Với phần cấu ngoài ra trên, redirect_uri của mình chính là login_url , được tạo nên bởi method get "/facebook/login", to: "facebooks#login", as: "login" .Bạn phải đk redirect_uri của chính mình trên trang facebook for developer nữa. Bạn vào phần Đăng nhập facebook , thiết đặt URI chuyển sang làn đường khác OAuth vừa lòng lệ như hình bên dưới đây:

*

Tạm thời mình cứ nhằm redirect_uri là http://0.0.0.0:3000/facebook/login , như vậy là ngừng phần setup về thông số này.

Cuối cùng, chỉ từ lại tham số scope . Dựa trên các chức năng của app, các bạn có thể chọn các permissions phù hợp( coi danh sách các permissions được cập nhật liên tục sinh sống đây). Ở trong nội dung bài viết này, vì bạn muốn làm các chức năng CRUD liên quan đến page nhưng mình có quyền admin, phải mình sẽ chỉ cần các quyền sau:

?scope="publish_pages,manage_pages,pages_manage_cta,pages_manage_instant_articles,pages_show_list"`Cuối cùng, sau thời điểm xác định ngừng 3 tham số , mình vẫn viết được nút Sign in with facebook không thiếu thốn ở file facebooks/new.html.erb của bản thân như sau:

%= link_to "Sign in with facebook", %q(https://www.facebook.com/v3.2/dialog/oauth?client_id=#ENV<"app_id">&scope="publish_pages,manage_pages,pages_manage_cta,pages_manage_instant_articles,pages_show_list"&redirect_uri=#login_url) %>Bấy giờ nhằm hiểu rộng về flow của quy trình đăng nhập, việc của bạn là click vào dòng nút vừa tạo.

*

Cùng xem chuyện gì sẽ xẩy ra nhé:

Như vậy là Facebook đã báo cho doanh nghiệp biết, loại rails app của bản thân mình đang chạy xe trên 1 đường dẫn không an toàn , rõ ràng là không tồn tại https . Nguyên nhân là vì chưng mình đang chạy rails app của bản thân ở môi trường development với băng thông http://0.0.0.0:3000/ . Để sửa được lỗi này, đơn giản dễ dàng bạn chỉ cần làm cách nào đấy để app của bạn chạy với một cái domain gồm https . Có rất nhiều cách mà chúng ta có thể nghĩ mang đến :

Mua tên miền xịn cùng deploy tiện ích của bạn.Nếu lười download domain thì có thể sử dụng những dịch vụ dạng Paas như heroku nhưng mà deploy
Dùng ngrok : 1 phần mềm cung cấp cho local web của người tiêu dùng một mẫu public_url(có cả http và https) .

Trong các giải pháp mình suy nghĩ ra, bản thân chọn thực hiện ngrok . Sử dụng nó rất đơn giản, bạn chỉ việc tải nó về và cài đặt ở phía trên . Sau khi bạn login trong home của nó, thì nó được đặt theo hướng dẫn cụ thể những vấn đề cần làm luôn:

*

Sau khi có tác dụng xong các bước setup solo giản, bạn chỉ việc rails s để chạy tiện ích trong môi trường thiên nhiên development, tiếp nối chạy lệnh ./ngrok http your_localweb_port . Cầm cố là bạn đã sở hữu 1 dòng url tất cả https mà chúng ta muốn:

*

Bây giờ, hãy lấy mẫu url kia và đăng ký lại tên miền bên trên trang facebook for developer cho cái phầm mềm của bạn, làm việc mục Thông tin cơ bản :

*

Vào phần Đăng nhập facebook, đk lại cả redirect_uri nữa:

*

Đó, hiện giờ thì thuộc thử click lại vào button Sign in with facebook xem điều gì đã xảy ra:

Như chúng ta thấy, trình ưng chuẩn đã redirect mang đến login dialog của facebook . Cụ thể thì facebook_api sẽ giúp rails ứng dụng hỏi thằng user(ở đó là chính bạn) rằng: "Mày vẫn muốn cấp giấy phép( permissions) sử dụng những cái thông tin này mang đến thằng rails phầm mềm không? trường hợp mày hy vọng thì ấn tiếp tục, ko thì lướt." Ở trên đây mình trả sử là các bạn sẽ ấn nút Tiếp tục , theo flow thì bây chừ browser của các bạn sẽ được chuyển hướng đến đường dẫn redirect_uri , rõ ràng là login_url củarails app, đồng nghĩa với vấn đề nó sẽ thực hiện action facebooks#login . Thuộc thử nhìn vào log ở hành động này xem tất cả gì đặc trưng nhé:

Processing by Facebooks
Controller#login as HTML Parameters: "code"=>"AQDe5OYrk
PRErl
Fa
VTRo6FEz
Jfjfq4y6QXO8JMQb_......" Completed 500 Internal vps Error in 273ms (Active
Record: 0.0ms)Bạn thấy đấy, lúc chuyển mang đến redirect_uri, facebook_api gởi kèm theo băng thông này một thông số code . Họ sẽ đề xuất tham số code này để lấy về access_token (thứ vào vai trò đặc trưng để rất có thể sử dụng được graph-api như mình đã nói ở bài xích trước). Ở trong kích hoạt login này, bạn cũng có thể dễ dàng lấy giá tốt trị của code , nó chính là params<:code> . Bạn cần thêm 2 tham số là client_id và client_secret và triển khai lấy về access_token bằng cách thực hiện nay HTTP Request sau:

GET https://graph.facebook.com/v3.3/oauth/access_token? client_id=app-id &redirect_uri=redirect-uri &client_secret=app-secret &code=code-parameterSau khi triển khai HTTP Request này thành công, response trả về sẽ bao hàm giá trị access_token.

Để thực hiện HTTP Request này trong Rails , bản thân chọn sử dụng thư viện Net::HTTP vốn được tích đúng theo sẵn vào Ruby . Trong facebooks_controller mình đã viết một private method get_api_request như sau:

class Facebooks
Controller Application
Controller private def get_api_request endpoint uri = URI "https://graph.facebook.com/v3.2/#endpoint" response_body = JSON.parse Net::HTTP.get_response(uri).body endendmethodnày sẽ triển khai 1 request mang đến 1 api endpoint mà bọn họ chỉ định, tiếp nối nó trả về body toàn thân của response nhận ra . Tiếp theo, vào login kích hoạt , mình sẽ tiến hành HTTP Request mặt trên:

class Facebooks
Controller Application
Controller def login response_body = get_api_request "oauth/access_token? client_id=#ENV<"app_id">&client_secret=#ENV<"app_secret">&code=#params<:code>&redirect_uri=https://71696d90.ngrok.io/facebook/login" access_token = response_body<"access_token"> end private def get_api_request endpoint uri = URI "https://graph.facebook.com/v3.2/#endpoint" response_body = JSON.parse Net::HTTP.get_response(uri).body endend
Với đoạn code mặt trên, nếu như HTTP Request thành công , mình vẫn lưu giá tốt trị của access_token vào một trong những biến local cùng tên. Cực hiếm của response_body khi request thành công sẽ như thế này:

(byebug) response_body"access_token"=>"EAAFqh
Qv
I4vo
BADz
GSrqoiz
XG...........", "token_type"=>"bearer", "expires_in"=>5183847Như chúng ta đã thấy, xung quanh access_token, họ còn nhận giá tốt trị token_type và expires_in. Hai quý giá này thì mình ko nghĩ ra cách để sử dụng nó vào app, nhưng ít nhất giá trị "expires_in" cho khách hàng biết, cái access_token này chỉ thực hiện được vào 5183847s (tương đương cùng với 6 ngày) . Vị vậy, nếu muốn sử dụng các công dụng liên quan mang lại graph-api thì user nên được update access_token trong khoảng thời gian cần thiết.

Sau khi mang được access_token rồi, chúng ta chỉ còn một bước ở đầu cuối phải làm để trả tất quá trình đăng nhập, sẽ là đăng nhập với lưu access_token vào database của current_user. Trước hết, hãy thêm field access_token vào bảng User vào database của người sử dụng Đến phía trên thì tất cả hai ngôi trường hợp đang xảy ra:

Trường vừa lòng 1: user đang triển khai đăng nhập sẽ tồn trên trong database của app. Trong trường hòa hợp này, ta chỉ việc update_attribute access_tokenTrường phù hợp 2: user không tồn trên trong database của app . Ở trường hòa hợp này, ta phải tạo lập 1 record new trong database với các thuộc tính e-mail và access_token

details = get_api_request "me?fields=email,name&access_token=#access_token"Và cục bộ action facebooks#login được viết hoàn chỉnh như sau:

class Facebooks
Controller Application
Lưu ý một chút, ở chỗ này mình cần sử dụng devise để làm tác dụng đăng nhập, cần mình áp dụng method sign_in của Devise để triển khai đăng nhập user mang đến nhẹ nhàng. Nếu bạn làm công dụng đăng nhập bằng một phương pháp khác, thì hãy sửa chữa dòng sign_in user bởi method của công ty nhé.

Thế là xong phần 1 rồi đó. Khi sử dụng facebook-graph-api, đem được access_token về chính là phần nặng nề nhất. Giờ bọn họ sẽ bước vào làm đa số phần dễ dàng hơn, đó là tìm phương pháp để tạolời hotline api bằng code Ruby.

Xem thêm: Ông Bác Siêu Nhân Anime Đến Phiên Bản Điện Ảnh, Ông Bác Siêu Nhân

3. Các cách để tạo lời điện thoại tư vấn API bằng code Ruby.

Như mình đã nói sinh sống part 1, việc tạo lời hotline API có khá nhiều cách làm. Vì bản chất của nó chỉ với HTTP Request , nên bạn có thể tạo lời gọi API với bất kỳ một ngôn ngữ, một framework , một tools nào kia có cung ứng một HTTP library. Đặc biệt, vào Ruby on Rails cung cấp khá những library, gem mà chúng ta cũng có thể sử dụng để sinh sản HTTP request ví dụ như : HTTP gem, HTTParty, Restclient,....Như chúng ta đã thấy ở chỗ trên, tôi đã tạo một GET api request trải qua method sau:

def get_api_request endpoint uri = URI "https://graph.facebook.com/v3.2/#endpoint" response_body = JSON.parse Net::HTTP.get_response(uri).bodyend
Ở đây mình thực hiện thư viện Net::HTTP tích hòa hợp sẵn trong ruby đến đỡ đề xuất kéo thêm package nào về . Mặc dù nhiên, khi nỗ lực thực hiện DELETE HTTP request , mình ban đầu gặp một số vấn đề. Cụ thể là bản thân ko tạo ra cú pháp đúng mực để triển khai DELETE HTTP request với thư viện này. Thế cho nên là bản thân đã cố gắng đi tìm một cách khác. Dịp đầu, mình chỉ đơn giản và dễ dàng định áp dụng 1 thư viện khác. Nhưng trong những khi tìm kiếm, mình phát hiện ra một thứ quyền lực tối cao hơn nhiều, đó làgem koala . Koala là một gem được tạo thành để tích hợp một số trong những facebook-api(nhưng đa số là Graph API) vào rails phầm mềm . Koala hỗ trợ nhiều method quyền lực tối cao với cú pháp rất dễ dàng và đơn giản để tiến hành các api request , nên tại phần còn lại của nội dung bài viết này, mình sẽ thực hiện nó để làm 4 tác dụng như tôi đã nói sinh hoạt đầu bài viết:

Publish 1 dòng post lên trang fanpage mà user sử dụng app bao gồm quyền admin
Edit dòng post đó.Delete mẫu post đó.Đồng thời like, và sinh sản nhiều comment lên cái post đó. (Batch-api-request)

4. áp dụng gem Koala

Để cài đặt gem koala trong rails app , bạn thêm cái này vào vào Gemfile của app :

Koala.configure vì |config| config.app_id = MY_APP_ID config.app_secret = MY_APP_SECRETend
Như cố là setup xong, giờ mình đã hướng dẫn chúng ta cách để sản xuất lời hotline api với gem này. Để tạo thành một lời điện thoại tư vấn api đơn giản và dễ dàng với koala bạn cần 2 bước: