EchoCoders.FacebookAPIServiceWrapper
1.0.0
dotnet add package EchoCoders.FacebookAPIServiceWrapper --version 1.0.0
NuGet\Install-Package EchoCoders.FacebookAPIServiceWrapper -Version 1.0.0
<PackageReference Include="EchoCoders.FacebookAPIServiceWrapper" Version="1.0.0" />
<PackageVersion Include="EchoCoders.FacebookAPIServiceWrapper" Version="1.0.0" />
<PackageReference Include="EchoCoders.FacebookAPIServiceWrapper" />
paket add EchoCoders.FacebookAPIServiceWrapper --version 1.0.0
#r "nuget: EchoCoders.FacebookAPIServiceWrapper, 1.0.0"
#addin nuget:?package=EchoCoders.FacebookAPIServiceWrapper&version=1.0.0
#tool nuget:?package=EchoCoders.FacebookAPIServiceWrapper&version=1.0.0
EchoCoders.FacebookAPIServiceWrapper
A Facebook API package that supports creating, retrieving, and deleting posts.
Available Methods
PostContentAsync()
This method will be used to Post content to facebook page.
PostContentWithImageAsync()
With the help of this method, we can Post content to facebook page with image
GetApprovedPostsAsync()
The GetApprovedPostsAsync() method has two overloads:
One without parameters, which retrieves all posts made since the beginning. Another that accepts startDate, endDate, contentFilter, and pageLimit, returning Facebook posts based on these filters.
DeletePostAsync()
This method will be used to delete a facebook page using postId.
Full Code to Post Content
IFaceBookAPIService facebookService = new FaceBookAPIService(options, httpClientFactory);
var postResponse = await facebookService.PostContentAsync("Welcome everyone to our new page");
Full Code to Post Content with an Image
var postResponse = await facebookService.PostContentWithImageAsync(
"Welcome everyone to our new page",
"https://example.com/path-to-image.jpg"
);
Full Code to Retrieve Approved Posts
var approvedPosts = await facebookService.GetApprovedPostsAsync();
Full Code to Retrieve Approved Posts with Filters & Pagination
var paginatedResponse = await facebookService.GetApprovedPostsAsync(
DateTime.Now.AddDays(-30),
DateTime.Now,
"Welcome",
10,
null
);
Full Code to Delete a Post
var deleteResponse = await facebookService.DeletePostAsync("post_id_to_delete");
EchoCoders.FacebookAPIServiceWrapper.DependencyInjection
There is a supplementary package which covers dependency injection in .NET Core framework. To inject the depdency we need to call following methods:
services.AddFaceBookAPIService(options =>
{
options.PageAccessToken = "your_page_access_token_";
options.BaseUrl = "https://graph.facebook.com/v12.0";
options.PageId = "your_pageId";
});
Supported .NET versions
.NET 8 and upper
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Microsoft.Extensions.Http (>= 9.0.1)
- Microsoft.Extensions.Options (>= 9.0.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on EchoCoders.FacebookAPIServiceWrapper:
Package | Downloads |
---|---|
EchoCoders.FacebookAPIServiceWrapper.DependencyInjection
A Facebook API package that supports creating, retrieving, and deleting posts with dependency injection (DI) |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 167 | 3/11/2025 |