GiantSms.Net
2.0.0
dotnet add package GiantSms.Net --version 2.0.0
NuGet\Install-Package GiantSms.Net -Version 2.0.0
<PackageReference Include="GiantSms.Net" Version="2.0.0" />
paket add GiantSms.Net --version 2.0.0
#r "nuget: GiantSms.Net, 2.0.0"
// Install GiantSms.Net as a Cake Addin #addin nuget:?package=GiantSms.Net&version=2.0.0 // Install GiantSms.Net as a Cake Tool #tool nuget:?package=GiantSms.Net&version=2.0.0
GiantSms.Net
GiantSms.Net is a .NET library that provides a simple and easy-to-use interface for sending SMS messages using the Giant SMS API.
GiantSms.Net is a .NET library that provides a simple and easy-to-use interface for sending SMS messages using the Giant SMS API.
Getting Started
To use the library, you will need to obtain an API key from Giant SMS.
You can register for an API key by visiting https://app.giantsms.com/register.
Prerequisites
.NET 8.0 or later
A valid API key from Giant SMS
Installing
You can install GiantSms.Net via NuGet package manager.
Usage
Register the Service
To use the GiantSmsService class, you need to register it as a service in your application's IServiceCollection. You can do this by calling the AddGiantSms extension method on IServiceCollection:
//...
builder.Services.AddGiantSms();
//...
Inject the Service
In your controller, add the following field:
private readonly IGiantSmsService _giantSmsService;
In the controller's constructor, inject IServiceProvider
, and in the constructor body, set _giantSmsService = serviceProvider.GetService<IGiantSmsService>();
.
public class MyController : ControllerBase
{
private readonly IGiantSmsService _giantSmsService;
public MyController(IServiceProvider serviceProvider)
{
_giantSmsService = serviceProvider.GetService<IGiantSmsService>();
}
// ...
}
Send SMS Messages
To send an SMS message, call the SendSingleMessage method on the IGiantSmsService interface:
var phoneNumber = "1234567890";
var message = "Hello, World!";
var result = await _giantSmsService.SendSingleMessage(phoneNumber, message);
Built With
.NET 8.0
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
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. |
-
net8.0
- Acidic.Extensions.Configuration.Binder (>= 1.0.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 7.0.0)
- Microsoft.Extensions.Http (>= 7.0.0)
- Newtonsoft.Json (>= 13.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial Release