Next version already breaks anything releated to the websocket as I switched the underlying library to Websocket.Client
more breaking changes are coming soon
Library used to interact with Gotify Server built in .Net Core 3.0
The structure of this library chagned many many time as I expiremented and tried to figure out which way I liked best.
Therefore a lot of code cleanup is needed including breaking changes for naming. I would not use this library in any production enviroments at the moment.
- Create a more consistent naming scheme
- Support Extras in Messages
- Add support for The rest of the APi
- Version
- Plugin
- Health
- User
- Deleting in all other endpoints
- Finish Intergration Tests
To createt the object just supply the follows shown below
IConfig config = new AppConfig(Username, Password, Url, port, Protocol, Path);
GotifySharp _gotifySharp = new GotifySharp(config);
When calling an endpoint it will return an Response object specific to that endpoint. Before using the data always check the Success property.
If true then you can read the Model data from the response otherwise get the Error Response and see what Gotify returned.
if you try to access the Success Response on failure or Error Response on Success you will get an Exception
To get a list of Applications just call GetApplications()
var response = await _gotifySharp.GetApplications();
on Success it will return a List
Getting Messages follows the same format but you must pass in the AppID of an application on the Gotify Server
To use the /stream URL just listen for the GotifySharp_OnMessage event
gotifySharp.OnMessage += GotifySharp_OnMessage;
private void GotifySharp_OnMessage(object sender, MessageModel e)
{
//Code Here
}