EchoCoders.FacebookAPIServiceWrapper 1.0.0

dotnet add package EchoCoders.FacebookAPIServiceWrapper --version 1.0.0
                    
NuGet\Install-Package EchoCoders.FacebookAPIServiceWrapper -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EchoCoders.FacebookAPIServiceWrapper" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EchoCoders.FacebookAPIServiceWrapper" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="EchoCoders.FacebookAPIServiceWrapper" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EchoCoders.FacebookAPIServiceWrapper --version 1.0.0
                    
#r "nuget: EchoCoders.FacebookAPIServiceWrapper, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=EchoCoders.FacebookAPIServiceWrapper&version=1.0.0
                    
Install EchoCoders.FacebookAPIServiceWrapper as a Cake Addin
#tool nuget:?package=EchoCoders.FacebookAPIServiceWrapper&version=1.0.0
                    
Install EchoCoders.FacebookAPIServiceWrapper as a Cake Tool

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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