RecursiveGeek.DotNetLib.Facebook
1.1.0
See the version list below for details.
dotnet add package RecursiveGeek.DotNetLib.Facebook --version 1.1.0
NuGet\Install-Package RecursiveGeek.DotNetLib.Facebook -Version 1.1.0
<PackageReference Include="RecursiveGeek.DotNetLib.Facebook" Version="1.1.0" />
paket add RecursiveGeek.DotNetLib.Facebook --version 1.1.0
#r "nuget: RecursiveGeek.DotNetLib.Facebook, 1.1.0"
// Install RecursiveGeek.DotNetLib.Facebook as a Cake Addin
#addin nuget:?package=RecursiveGeek.DotNetLib.Facebook&version=1.1.0
// Install RecursiveGeek.DotNetLib.Facebook as a Cake Tool
#tool nuget:?package=RecursiveGeek.DotNetLib.Facebook&version=1.1.0
Introduction
<img src="Images/facebook.png" width="64" align="right" alt="Facebook Project Logo"/> This is a Facebook library that is written in C# using .NET Standard, with unit testing using .NET Core. Its purpose is to make it a little easier to call the Facebook Graph API, via Web Api calls and using JSON, to return C# objects with populated data (when successful).
Getting Started
This presumes a strong understanding of the following tools and technologies:
- Visual Studio 2017 Community, Professional, or Enterprise
- .NET Standard 2.0 libraries
- .NET Core 2.2 (for xUnit Testing)
- C# development
- Facebook Graph API
Facebook Graph API
Facebook Pages have been the first implementation to allow the publishing of content posted to Facebook appear on non-Facebook destinations, such as on website. This allows social media to serve as a primary source of information and allowing to propagate to other instances without requiring all visitors to have a Facebook account.
To use this API, you will need to perform the following steps in a timely manner (before any of the access tokens expire):
- Setup a Facebook App, setting up an App ID and App Secret, on an account that has access to the Facebook resources desired.
- Use the Facebook Graph API Explorer to generate a User Token, under an account that has access to the Facebook resources desired. This token will expire in 1 hour.
- Use the Facebook Access Token Debugger to verify the User Token just generated and generate an Extended User Token.
- Take the Extended Access Token and your App Secret to generate an App Secret Proof (appsecret_proof) hash key. This can be done via website using a HMAC Generator with a SHA256 message digest algorithm.
- Return back to the Facebook Graph API Explorer and paste in the Extended Access Token in the Access Token field, Change the URL so it has the following parameters
?fields=access_token&appsecret_proff={hash key}
and click on the Submit button. This will generate a new Non-expiring Access Token. - Verify the access token is non-expiring, return back to the Facebook Access Token Debugger and review its expiration.
Use the Non-expiring Access Token and App Secret in the API calls (which generates the App Secret Proof when needed).
Samples
Check out the Unit Tests for Examples on usage, especially FacebookTests.cs
.
This supports the use of appsettings.json as well as Safe Storage using App Secrets via %APPDATA%\Microsoft\UserSecrets\7c94ff42-b17b-4a22-89ff-38d531f03402\secrets.json
. This file has the same format as the included appsettings.json file, with the appropriate value information filled in.
This GUID is referenced in RecursiveGeek.DotNetLib.Core.Tests.csproj file and in the building of Configuration.
Build and Test
Open in Visual Studio to build and perform Unit Testing (xUnit for .NET Core).
References
- Visual Studio
- Facebook Graph API Explorer
- Facebook Access Token Debugger
- Facebook Page Feed Reference
Acknowledgements
- Stack Overflow postings helped figure out how to get a non-expiring access token.
- Postman has been an invaluable tool, prior to writing any code and validating the "plumbing".
~ end ~
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.Extensions.Configuration (>= 2.2.0)
- Microsoft.Extensions.Configuration.Binder (>= 2.2.0)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 2.2.0)
- Microsoft.Extensions.Configuration.Json (>= 2.2.0)
- Microsoft.Extensions.Configuration.UserSecrets (>= 2.2.0)
- Newtonsoft.Json (>= 12.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.4.9 | 1,039 | 5/31/2019 |
1.4.8 | 970 | 5/31/2019 |
1.4.7 | 939 | 5/29/2019 |
1.4.6 | 997 | 5/29/2019 |
1.4.5 | 972 | 5/28/2019 |
1.4.3 | 999 | 5/28/2019 |
1.4.2 | 1,043 | 5/21/2019 |
1.4.1 | 1,007 | 5/21/2019 |
1.4.0 | 1,010 | 5/21/2019 |
1.3.3 | 1,096 | 5/20/2019 |
1.3.2 | 1,024 | 5/1/2019 |
1.3.1 | 989 | 4/30/2019 |
1.3.0 | 1,023 | 4/30/2019 |
1.2.0 | 1,004 | 4/30/2019 |
1.1.0 | 1,032 | 3/27/2019 |