GSMClients.Web.Framework
1.0.4
dotnet add package GSMClients.Web.Framework --version 1.0.4
NuGet\Install-Package GSMClients.Web.Framework -Version 1.0.4
<PackageReference Include="GSMClients.Web.Framework" Version="1.0.4" />
<PackageVersion Include="GSMClients.Web.Framework" Version="1.0.4" />
<PackageReference Include="GSMClients.Web.Framework" />
paket add GSMClients.Web.Framework --version 1.0.4
#r "nuget: GSMClients.Web.Framework, 1.0.4"
#:package GSMClients.Web.Framework@1.0.4
#addin nuget:?package=GSMClients.Web.Framework&version=1.0.4
#tool nuget:?package=GSMClients.Web.Framework&version=1.0.4
GSMClients.Web.Framework ✨
Global Session Manager ( GSM ) Client library for .NET Framework Web Applications. Provides easy integration with GSM Server for:
Features 🎉
- Session Managment 🔐 : SSO :-
Single Active Session (SSA)Ensures only one active session per user across apps.Single Active User Per Device (SAUPD)Restricts multiple logins from same device.
- Push Notifications 🔔 : Real-Time Alerts instantly to connected clients
- Scheduled Triggers ⏰ : Automates periodic tasks like session cleanup and Notifications.
Installation 🛠️
Install via NuGet:
dotnet add package GSMClients.Web.Framework
Steps 💡
There are two simple steps to follow:
1. GSM Configuration :-
In your Login method, add the following lines to retrieve the GSM Token:
using GSMClients.Web.Framework;
var gsmData = await GSMClient.InitializeAsync(
loggedUserId: // Logged User Id,
baseUrl: // Update your GSM URL,
clientId: // Update your Client Id,
clientSecret: // Update your Client Secret,
sessionId: Guid.NewGuid().ToString(),
sessionIp: HttpContext.Connection.RemoteIpAddress?.ToString() ?? "",
ignoreCertErrors : true //for Production Build Need to be Changed as False.
);
// ✅ You will receive the connection details in the gsmData variable. Simply pass the same gsmData to your view page to establish the connection.
2. GSM Initializtion :-
Add JS Libraries in View Layout Pages.
<script type="text/javascript" src="Scripts/gsm/signalr-7.0.5.min.js"></script>
<script type="text/javascript" src="Scripts/gsm/GSM-client-1.0.0.min.js"></script>
/**
* ✨ After receiving the gsmData from the Controller, trigger this JS function.
*/
async function gsmConnector(gsmData) {
const gsmClient = new GSMClient({
apiUrl: gsmData.BaseUrl,
token: gsmData.Token,
userId: gsmData.UserId,
sessionId: gsmData.SessionId,
sessionIp: gsmData.SessionIp,
onRegisterSuccess: function () {
window.location.href = "default.htm"; // ✅ Add your Home Page / Login success redirection.
},
onForceLogout: function () {
window.location.href = "login.aspx"; // 🚫 Add the Logout Page / trigger the Logout Logic.
}
});
await gsmClient.connect();
/* If you have multiple layouts, trigger this function from each layout,
and replace the`onRegisterSuccess: () => window.location.href = "/Home"`
line with `onRegisterSuccess: () => console.log("GSM successfully registered")`.
Check the Browser Console!
Happy coding! ✨🎉
*/
}
Using GSM Services 🚀:-
After configuring GSM, now you can trigger broadcasts for real-time messages or data, such as push notifications.
Service 1: Send message to specific user :-
using GSMClients.Web.Framework;
var resUser = await GSMService.BroadcastToUserAsync(
baseUrl : "", // GSM Url
token : "", // Generated token
userId : "", // receiver login Id
message : "", // message
ignoreCertErrors: true // ✅ for UAT - SSL exception
);
Service 2 : Send Message to all user :-
using GSMClients.Web.Framework;
var resGroup = await GSMService.BroadcastToGroupAsync(
baseUrl : "",
token : "",
message : "",
ignoreCertErrors: true // ✅ for UAT - SSL exception
);
Package Contents 📦
GSMClient.cs(C# helper class)GSMService.cs(C# service class)signalr-7.0.5.min.js(SignalR library)GSM-client-1.0.0.min.js(GSM JavaScript client)
Requirements ✅
.NET Framwork 4.7.2 and Above
ASP.NET Framework Web App
We hope this is exactly what you were looking for! Let me know if you have any other requests. Thank you.. 😊
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net472 is compatible. net48 was computed. net481 was computed. |
-
.NETFramework 4.7.2
- 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.