AfricasTalking.USSD 0.1.0

Additional Details

The current AfricasTalking SDK handles scenarios like these

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 AfricasTalking.USSD --version 0.1.0
NuGet\Install-Package AfricasTalking.USSD -Version 0.1.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="AfricasTalking.USSD" Version="0.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AfricasTalking.USSD --version 0.1.0
#r "nuget: AfricasTalking.USSD, 0.1.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.
// Install AfricasTalking.USSD as a Cake Addin
#addin nuget:?package=AfricasTalking.USSD&version=0.1.0

// Install AfricasTalking.USSD as a Cake Tool
#tool nuget:?package=AfricasTalking.USSD&version=0.1.0

AfricasTalking.USSD

.Net Standard Class Library that allows you to consume AfricasTalking API USSD requests easily.

What it does?

This wrapper package simply allows to consume the AfricasTalking Packages easily!

Get the Package HERE.

Current Version: 0.1.0

The package handles two main types of USSD menus;

  1. Plain Menus
  2. Backhandled Menus

Plain Menus

Sample:

[HttpPost]
        [Route("plain")]
        public ContentResult Post([FromBody] USSD value)
        {
            if (ModelState.IsValid)
            {
                string response = String.Empty;
                int[] arr = this._handler.ReqHandler(value.Text);

                if(arr.Length == 0)
                {
                    response = "CON Welcome to AfricasTalking USSD .NET Package\n";
                    response += "1. Show my Phone Number\n";
                    response += "2. Exit";

                    return Content(response);
                }
                else if(arr.Length ==1 && arr[0] == 1)
                {
                    response = $"END Your Phone Number is {value.PhoneNumber}";

                    return Content(response);
                }
                else
                {
                    return Content("END Thank you!");
                }
            }

            return Content("END err0r");
        }

Back Handled Menu

Sample

[HttpPost]
        [Route("backhandled")]
        public ContentResult Postbackhandled([FromBody] USSD value)
        {
            if (ModelState.IsValid)
            {
                string response = String.Empty;
                int[] backarr = this._handler.BackHandler(value.Text);

                if (backarr.Length == 0)
                {
                    response = "CON Welcome to AfricasTalking USSD .NET Package\n";
                    response += "1. Choose Platform\n";
                    response += "2. Exit";
                    return Content(response);
                }
                else if(backarr.Length ==1 && backarr[0] == 1)
                {
                    response = "CON Choose .NET Platform\n";
                    response += "1. Web\n";
                    response += "2. Mobile\n";
                    response += "00. Home";
                    return Content(response);

                }else if(backarr.Length ==1 && backarr[0] == 2)
                {
                    return Content("END Thank you!");
                }
                else if(backarr.Length ==2 && backarr[1] == 1 )
                {

                    response = "CON Choose .Net Web\n";
                    response += "1. ASP.Net Core\n";
                    response += "2. ASP.Net MVC\n";
                    response += "0: Back\n";
                    response += "00: Home";
                    return Content(response);
                }
                else if (backarr.Length == 2 && backarr[1] == 2)
                {
                    response = "CON Choose .Net Mobile\n";
                    response += "1. Xamarin\n";
                    response += "0: Back\n";
                    response += "00: Home";
                    return Content(response);
                }
                else if(backarr.Length == 3)
                {
                    return Content("END We've saved your request. Thank you");
                }
            }

            return Content("END err0r");
        }

Contribution

Fork the repo then create a pull request

Author

John Nyingi

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

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

First Release:

1. Handles plain USSD requests
2. Handles back handled USSD requests.

Target Platform .Net Standard >= 2.0