Netloji.Core.SmsGateway 1.0.322.1406

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package Netloji.Core.SmsGateway --version 1.0.322.1406
                    
NuGet\Install-Package Netloji.Core.SmsGateway -Version 1.0.322.1406
                    
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="Netloji.Core.SmsGateway" Version="1.0.322.1406" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Netloji.Core.SmsGateway" Version="1.0.322.1406" />
                    
Directory.Packages.props
<PackageReference Include="Netloji.Core.SmsGateway" />
                    
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 Netloji.Core.SmsGateway --version 1.0.322.1406
                    
#r "nuget: Netloji.Core.SmsGateway, 1.0.322.1406"
                    
#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.
#:package Netloji.Core.SmsGateway@1.0.322.1406
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Netloji.Core.SmsGateway&version=1.0.322.1406
                    
Install as a Cake Addin
#tool nuget:?package=Netloji.Core.SmsGateway&version=1.0.322.1406
                    
Install as a Cake Tool

Netloji.Core.SmsGateway

NuGet License

AI-Optimized SMS Gateway & OTP Management Library for .NET 9+

Netloji.Core.SmsGateway, .NET uygulamalarınız için esnek, plugin tabanlı SMS gönderimi ve OTP (One-Time Password) yönetimi sağlayan modern bir kütüphanedir. AI coding araçları ile entegrasyon için optimize edilmiştir.

✨ Özellikler

🚀 SMS Gateway Management

  • Plugin Architecture - Dinamik SMS gateway ekleme/çıkarma
  • Multi-Provider Support - NetGsm, TTMesaj ve özel sağlayıcılar
  • Automatic Discovery - Gateway assembly'lerini otomatik tarama
  • Configuration-Driven - JSON tabanlı konfigürasyon yönetimi

🔐 OTP Management

  • Secure Code Generation - Kriptografik olarak güvenli OTP üretimi
  • Flexible Code Types - Sayısal veya alfanümerik kodlar
  • Memory Caching - Hızlı ve güvenli OTP depolama
  • Multi-Language Support - Yerelleştirilmiş OTP mesajları
  • Debug Mode - Geliştirme için simülasyon desteği

🛠️ Developer Experience

  • AI-Friendly API - Temiz, self-documenting interface'ler
  • Dependency Injection Ready - .NET DI container ile tam uyum
  • Async-First Design - Modern async/await pattern'leri
  • Comprehensive Error Handling - Detaylı hata raporlama

📦 Kurulum

NuGet Package Manager

Install-Package Netloji.Core.SmsGateway

.NET CLI

dotnet add package Netloji.Core.SmsGateway

PackageReference

<PackageReference Include="Netloji.Core.SmsGateway" Version="1.0.0" />

🚀 Hızlı Başlangıç

1. Konfigürasyon

appsettings.json dosyanıza SMS gateway konfigürasyonunu ekleyin:

{
  "NetlojiSmsGateway": {
    "AppKey": "your-app-key",
    "DefaultGateway": "NetGsm",
    "DefaultCulture": "tr-TR",
    "DefaultOtpCodeType": "Numeric",
    "Gateways": {
      "NetGsm": {
        "Username": "your-username",
        "Password": "your-password",
        "Originator": "YOUR_SENDER_NAME"
      },
      "TTMesaj": {
        "Username": "your-ttmesaj-username",
        "Password": "your-ttmesaj-password",
        "Originator": "YOUR_SENDER_NAME"
      }
    }
  }
}

2. Dependency Injection

Program.cs dosyanızda servisleri kaydedin:

using Netloji.Core.Sms;
using Netloji.Core.Sms.Gateway;

var builder = WebApplication.CreateBuilder(args);

// SMS Gateway servisini ekle
builder.Services.AddSingleton<ISmsService, SmsService>();

// Memory cache ekle (OTP için gerekli)
builder.Services.AddMemoryCache();

// OTP Manager ekle
builder.Services.AddSingleton<IOtpManager, OtpManager>();

var app = builder.Build();

3. OTP Gönderimi

public class AuthService
{
    private readonly IOtpManager _otpManager;
    
    public AuthService(IOtpManager otpManager)
    {
        _otpManager = otpManager;
    }
    
    public async Task<bool> SendOtpAsync(long phoneNumber)
    {
        var response = await _otpManager.SendOtpAsync(
            recipient: phoneNumber,
            otpCodeType: OtpCodeType.Numeric,
            culture: new CultureInfo("tr-TR")
        );
        
        return response.IsSuccess;
    }
    
    public bool VerifyOtp(long phoneNumber, string code)
    {
        return _otpManager.ValidateOtp(phoneNumber, code);
    }
}

4. SMS Gönderimi

public class NotificationService
{
    private readonly ISmsGateway _smsGateway;
    
    public NotificationService(ISmsGateway smsGateway)
    {
        _smsGateway = smsGateway;
    }
    
    public async Task<SmsResponse> SendSmsAsync(long phoneNumber, string message)
    {
        return await _smsGateway.SendSingleSmsMessageAsync(phoneNumber, message);
    }
    
    public async Task<SmsResponse> SendBulkSmsAsync(List<long> phoneNumbers, string message)
    {
        return await _smsGateway.SendMultipleSmsMessageAsync(message, phoneNumbers);
    }
}

📚 API Referansı

IOtpManager Interface

OTP yönetimi için ana interface:

public interface IOtpManager
{
    OtpCodeType DefaultOtpCodeType { get; set; }
    OtpManagerSettings Settings { get; }
    LanguageResource LanguageResource { get; }
    
    string GenerateOtpCode();
    Task<SmsResponse> SendOtpAsync(long recipient, OtpCodeType otpCodeType, CultureInfo culture, ISmsGateway? gateway = null);
    Task<SmsResponse> SendOtpAsync(long recipient, OtpCodeType otpCodeType, string messageTemplate, ISmsGateway? gateway = null);
    Task<SmsResponse> SendOtpAsync(long recipient, string otpCode, string message, ISmsGateway? gateway = null);
    bool ValidateOtp(long recipient, string otpInput);
    Task<bool> VerifyOtpAsync(long phoneNumber, string code, bool invalidateOnSuccess = true);
}

ISmsGateway Interface

SMS gateway implementasyonları için interface:

public interface ISmsGateway
{
    string ProviderKey { get; }
    string AppKey { get; }
    string Name { get; }
    string Version { get; }
    string Originator { get; set; }
    string Username { get; set; }
    string Password { get; set; }
    
    bool CanHandle(string providerKey);
    
    Task<SmsResponse> SendOtpMessageAsync(long recipient, string message);
    Task<SmsResponse> SendSingleSmsMessageAsync(long recipient, string message);
    Task<SmsResponse> SendMultipleSmsMessageAsync(string message, List<long> recipients);
    Task<SmsResponse> SendMultipleSmsMessageWithNameAsync(string message, List<SmsRecipient> recipients);
}

SmsGatewayManager

Static gateway yöneticisi:

public static class SmsGatewayManager
{
    public static IReadOnlyList<ISmsGateway> AvailableGateways { get; }
    public static ISmsGateway? DefaultGateway { get; set; }
    public static ISmsGateway Gateway { get; set; }
    
    public static ISmsGateway? GetGateway(string providerKey);
    public static bool SetDefaultGateway(string providerKey);
}

🔧 Konfigürasyon Seçenekleri

OtpManagerSettings

public class OtpManagerSettings
{
    public OtpCodeType CodeType { get; set; } = OtpCodeType.Numeric;
    public int Length { get; set; } = 6;
    public int TimeoutInSeconds { get; set; } = 300;
    public bool SimulateForDebugMode { get; set; } = false;
}

SmsGatewayOptions

public class SmsGatewayOptions
{
    public string AppKey { get; set; }
    public string DefaultGateway { get; set; } = "NetGsm";
    public string DefaultCulture { get; set; } = "tr-TR";
    public OtpCodeType DefaultOtpCodeType { get; set; } = OtpCodeType.Numeric;
    public Dictionary<string, SmsGatewayConfig> Gateways { get; set; } = new();
}

🌐 Desteklenen Gateway'ler

NetGsm

  • Provider Key: NetGsm
  • Özellikler: Türk SMS sağlayıcısı, yüksek gönderim kapasitesi
  • Konfigürasyon: Username, Password, Originator

TTMesaj

  • Provider Key: TTMesaj
  • Özellikler: Türk SMS sağlayıcısı, uygun fiyatlandırma
  • Konfigürasyon: Username, Password, Originator

Özel Gateway Geliştirme

Kendi SMS gateway'inizi geliştirmek için:

using Netloji.Core.Sms.Gateway.Interfaces;
using Netloji.Core.Sms.Gateway.Models;

public class CustomSmsGateway : ISmsGateway
{
    public string ProviderKey => "Custom";
    public string AppKey { get; set; } = string.Empty;
    public string Name => "Custom SMS Gateway";
    public string Version => "1.0.0";
    public string Originator { get; set; } = string.Empty;
    public string Username { get; set; } = string.Empty;
    public string Password { get; set; } = string.Empty;
    
    public bool CanHandle(string providerKey) => ProviderKey.Equals(providerKey, StringComparison.OrdinalIgnoreCase);
    
    public async Task<SmsResponse> SendSingleSmsMessageAsync(long recipient, string message)
    {
        // SMS gönderim mantığınızı burada implemente edin
        // API call'lar, HTTP request'ler, vb.
        
        return SmsResponse.Success("message-id-123", "SMS sent successfully");
    }
    
    // Diğer method'ları implemente edin...
}

🧪 AI Integration Örnekleri

ChatGPT/Copilot Integration

Kütüphanemiz AI coding araçları ile optimize edilmiştir:

// AI asistanının kolayca anlayabileceği, self-documenting kod
public async Task<bool> SendLoginOtpToUserAsync(long userPhoneNumber)
{
    // OTP oluştur ve gönder
    var otpResponse = await _otpManager.SendOtpAsync(
        recipient: userPhoneNumber,
        otpCodeType: OtpCodeType.Numeric, // 6 haneli sayısal kod
        culture: new CultureInfo("tr-TR") // Türkçe mesaj
    );
    
    // Başarısız olursa logla ve false dön
    if (!otpResponse.IsSuccess)
    {
        _logger.LogError("OTP gönderimi başarısız: {Error}", otpResponse.ErrorDetails);
        return false;
    }
    
    // Başarılı ise true dön
    return true;
}

Code Generation Friendly

API'miz kod üretimi için tasarlanmıştır:

// AI asistanının kolayca kod üretebileceği pattern'ler
public class SmsService
{
    // Constructor injection - AI friendly
    public SmsService(IOtpManager otpManager, ISmsGateway smsGateway)
    {
        _otpManager = otpManager;
        _smsGateway = smsGateway;
    }
    
    // Method isimleri ve parametreler self-documenting
    public async Task SendPromotionalSmsToMultipleUsersAsync(
        List<long> userPhoneNumbers, 
        string promotionalMessage)
    {
        var response = await _smsGateway.SendMultipleSmsMessageAsync(
            message: promotionalMessage,
            recipients: userPhoneNumbers
        );
        
        LogSmsResult(response);
    }
}

🔒 Güvenlik

OTP Güvenliği

  • Kriptografik Rastgelelik - RNGCryptoServiceProvider kullanımı
  • Zaman Bazlı Sonlanma - Yapılandırılabilir timeout
  • Tek Kullanım - Başarılı doğrulamada OTP silinir
  • Memory Isolation - Her telefon numarası için ayrı cache key

SMS Güvenliği

  • HTTPS Destek - Tüm gateway'ler güvenli bağlantı kullanır
  • Credential Yönetimi - Konfigürasyon dosyasında güvenli saklama
  • Error Handling - Hassas bilgi sızdırmayan hata mesajları

📊 Performans

Optimizasyonlar

  • Memory Caching - OTP doğrulama için hızlı erişim
  • Async Operations - Non-blocking I/O işlemleri
  • Connection Pooling - HTTP client optimizasyonu
  • Minimal Dependencies - Lightweight tasarım

Benchmark Sonuçları

  • OTP Generation: < 1ms
  • OTP Validation: < 0.5ms
  • SMS Sending: ~500ms (gateway bağımlı)
  • Memory Usage: < 10MB (1000 aktif OTP ile)

🐛 Hata Ayıklama

Debug Mode

Geliştirme için simülasyon modu:

// OtpManagerSettings'de etkinleştir
"SimulateForDebugMode": true

// Sonuç: SMS gönderimi yerine konsolda OTP gösterilir
// Debug simulation mode ON. OTP code is: 123456

Logging

Detaylı loglama için:

public class EnhancedSmsService
{
    private readonly ILogger<EnhancedSmsService> _logger;
    
    public async Task SendOtpWithLoggingAsync(long phoneNumber)
    {
        var response = await _otpManager.SendOtpAsync(phoneNumber, OtpCodeType.Numeric, CultureInfo.CurrentCulture);
        
        if (response.IsSuccess)
        {
            _logger.LogInformation("OTP sent successfully to {PhoneNumber}, MessageId: {MessageId}", 
                phoneNumber, response.MessageId);
        }
        else
        {
            _logger.LogError("OTP sending failed to {PhoneNumber}, Error: {Error}", 
                phoneNumber, response.ErrorDetails);
        }
    }
}

🤝 Katkı

Katkıda bulunmak için:

  1. Repository'i fork edin
  2. Feature branch oluşturun (git checkout -b feature/amazing-feature)
  3. Değişikliklerinizi commit edin (git commit -m 'Add amazing feature')
  4. Branch'e push edin (git push origin feature/amazing-feature)
  5. Pull Request oluşturun

📄 Lisans

Bu proje MIT Lisansı altında lisanslanmıştır - LICENSE dosyasına bakın.

📞 İletişim


Netloji.Core.SmsGateway - Modern .NET uygulamaları için akıllı SMS ve OTP yönetimi. 🚀

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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.

Version Downloads Last Updated