Anjo.Android.AgoraIO.AgoraDynamicKey 4.0.0

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

// Install Anjo.Android.AgoraIO.AgoraDynamicKey as a Cake Tool
#tool nuget:?package=Anjo.Android.AgoraIO.AgoraDynamicKey&version=4.0.0                

Anjo.Android.AgoraIO.AgoraDynamicKey


This section delves into the authentication mechanism implemented by the Agora SDK. Equally important, this also provides the requisite code for generating access tokens - Wael Anjo

NuGet License

This page describes the authentication mechanism used by the Agora SDK, as well as providing the related code for generating AccessToken (v2.1.0) or Dynamic Key (v2.0.2 or earlier). https://github.com/AgoraIO/Tools/tree/master/DynamicKey/AgoraDynamicKey


How To Use

AccessToken

AccessToken is more powerful than the legacy Dynamic Key. It encapsulates several privileges in one token to cover various services provided by Agora.

AccessToken is available as of SDK 2.1.0.

Sample usage,

  • For Rtm Token
private string _appId = "970CA35de60c44645bbae8a215061b33";
private string _appCertificate = "5CFd2fd1755d40ecb72977518be15d3b";
private string _account = "2882341273";
private uint _expireTimeInSeconds = 3600;

uint privilegeExpiredTs = _expireTimeInSeconds + (uint)Utils.getTimestamp();
string token = RtmTokenBuilder.buildToken(_appId, _appCertificate, _account, privilegeExpiredTs);
Console.WriteLine(">> token" + token);
  • For Rtc Token
private string _appId = "970CA35de60c44645bbae8a215061b33";
private string _appCertificate = "5CFd2fd1755d40ecb72977518be15d3b";
private string _channelName = "7d72365eb983485397e3e3f9d460bdda";
private string _account = "2882341273";
private uint _uid = 2882341273;
private uint _expireTimeInSeconds = 3600;

uint privilegeExpiredTs = _expireTimeInSeconds + (uint)Utils.getTimestamp();
string token = RtcTokenBuilder.buildTokenWithUserAccount(_appId, _appCertificate, _channelName, _account, RtcTokenBuilder.Role.RolePublisher, privilegeExpiredTs);
Console.WriteLine(">> token" + token);

Star on Github if this project helps you: https://github.com/mhdwaelanjo/Anjo.Android.AgoraIO.AgoraDynamicKey


Agora Full SDK

You can fine Agora.io Rtc Full SDK for .NET for Android Here :

NuGet Version

Agora Lite SDK

You can fine Agora.io Rtc Lite SDK for .NET for Android Here :

NuGet Version


Help & Feedback:

SUPPORT:

Product Compatible and additional computed target framework versions.
.NET net7.0-android33.0 is compatible.  net8.0-android was computed.  net8.0-android34.0 is compatible. 
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
4.0.0 191 10/21/2024

Agora.io Dynamic Key - Access Tokens SDK v4.0.0