Messager.EskizUz
2.0.0
dotnet add package Messager.EskizUz --version 2.0.0
NuGet\Install-Package Messager.EskizUz -Version 2.0.0
<PackageReference Include="Messager.EskizUz" Version="2.0.0" />
paket add Messager.EskizUz --version 2.0.0
#r "nuget: Messager.EskizUz, 2.0.0"
// Install Messager.EskizUz as a Cake Addin #addin nuget:?package=Messager.EskizUz&version=2.0.0 // Install Messager.EskizUz as a Cake Tool #tool nuget:?package=Messager.EskizUz&version=2.0.0
Tavsif
Messager, SMS xabarlarini yuborish uchun ma'lum Eskiz.uz API xizmatidan foydalanish uchun yaratilgan .NET kutubxonasi. U bir martalik parollar (OTP) va odatiy matnli xabarlarni yuborish jarayonini sodda funksionallik orqali osonlashtiradi.
O'rnatish
Messager NuGet paketini quyidagi buyruq yordamida o'rnatishingiz mumkin:
dotnet add package Messager.EskizUz
Boshlash
Messagerdan foydalanish uchun siz e-mail va maxfiy kalitni taqdim etib, Messager klassining misolini yaratishingiz kerak. Klass autentifikatsiya va belgilangan so'rov uchun belgilangan to'kenni olishni avtomatik ravishda boshlaydi.
using Messager.EskizUz;
// Messager obyektini yarating
var messager = new MessagerAgent("sizning-email@example.com", "sizning-maxfiy-kalitingiz");
OTP SMS Yuborish
Messager orqali OTP SMS xabarlarni osonlik bilan yuborishingiz mumkin. Telefon raqamiga bir martalik OTP kod yuborish uchun SendOtpAsync metodidan foydalaning.
// OTP SMS yuborish
var natija = await messager.SendOtpAsync("+998901234567");
if (natija.Success)
{
Console.WriteLine($"OTP muvaffaqiyatli yuborildi. Kod: {natija.Code}");
}
else
{
Console.WriteLine("OTP SMS yuborishda xatolik yuz berdi.");
}
Odatiy SMS Yuborish
SendSMSAsync metodidan foydalanib odatiy matnli SMS xabarlarni yuborishingiz mumkin.
// Odatiy SMS yuborish
var yuborildi = await messager.SendSMSAsync("+998901234567", "Salom Messager.EskizUz dan!");
if (yuborildi)
{
Console.WriteLine("SMS muvaffaqiyatli yuborildi.");
}
else
{
Console.WriteLine("SMS yuborishda xatolik yuz berdi.");
}
Muhim Eslatmalar
Ma'lum email va maxfiy kalitingiz bilan "sizning-email@example.com" va "sizning-maxfiy-kalitingiz" ni almashtiring.
Ogohlantirish
Ushbu kutubxona sodda shaklda taqdim etilgan va har bir yuz berishi mumkin bo'lgan xatolar boshqaruvini o'z ichiga olmaydi. Sizning mahsulotingizga mos ravishda xato boshqaruvini yanada rivojlantirish tavsiya etiladi.
Litsenziya
Ushbu kutubxona MIT litsenziyasi asosida tarqalgan.
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
- Newtonsoft.Json (>= 13.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.