GiantSms.Net 2.0.0

dotnet add package GiantSms.Net --version 2.0.0
                    
NuGet\Install-Package GiantSms.Net -Version 2.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="GiantSms.Net" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="GiantSms.Net" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="GiantSms.Net" />
                    
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 GiantSms.Net --version 2.0.0
                    
#r "nuget: GiantSms.Net, 2.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=GiantSms.Net&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=GiantSms.Net&version=2.0.0
                    
Install as a Cake Tool

Build Status NuGet Target Framework Downloads

Table of Contents

Description

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 Giant SMS Registration.

Prerequisites

  • .NET 8.0 or later
  • A valid API key from Giant SMS

Installing

You can install GiantSms.Net via NuGet package manager.

Dotnet CLI:

dotnet add package GiantSms.Net --version 2.0.0

NuGet Package Manager:

Install-Package GiantSms.Net -Version 2.0.0

Usage

Configuration

Add the following configuration settings to your appsettings.json file: Paste the credentials on your Giant SMS account into the appsettings.json file under the GiantSmsConnection section:

{
  "GiantSmsConnection": {
    "Username": "your_username",
    "Password": "your_password",
    "Token": "your_api_token",
    "SenderId": "your_sender_id"
  }
}

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(configuration)

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

Contributing

Contributions are welcome! Please follow these steps to contribute:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Make your changes.
  4. Commit your changes (git commit -m 'Add some feature').
  5. Push to the branch (git push origin feature-branch).
  6. Open a pull request.

Please make sure to update tests as appropriate.

For more details, see the CONTRIBUTING.md file.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Initial Release