Satori is a cloud-based, live data ecosystem that manages any form of schema-less real-time live data as it happens. The ecosystem includes a fast and scalable messaging engine known as RTM. Use the C# SDK for Satori RTM to create mobile, desktop or server-based applications that communicate with the RTM to publish and subscribe.
- .NET Standard 1.3+ (Xamarin.Android, Xamarin.iOS, .NET Framework, Mono, etc)
- Mono / .NET 4.5+
- Unity 5.6+ (Standalone, iOS, Android)
To install C# SDK for Satori RTM, run the following command in the Package Manager Console:
PM> Install-Package Satori.RTM.SDK
Alternatively, install the package via the user interface provided by Visual Studio or Xamarin Studio.
The package is hosted on Nuget Gallery.
To add C# SDK for Satori RTM to a Unity project, copy the following files from Quickstart on GitHub to the Assets folder:
link.xml
Newtonsoft.Json.dll
Satori.RTM.Unity.dll
The various documentation is available:
- The Documentation on Satori Website
- The API Documentation
- The RTM API specification
All log messages are received by listeners in Trace.Listeners
collection. For example, in order to direct
log messages to the console, add ConsoleTraceListener
to Trace.Listeners
collection:
using System.Diagnostics;
...
Trace.Listeners.Add(new ConsoleTraceListener());
Read about Trace Listeners on MSDN
By default, verbosity level is warning. Verbosity of the different components of C# SDK can be set separately:
using Satori.Rtm;
...
DefaultLoggers.Dispatcher.SetLevel(Logger.LogLevel.Verbose);
DefaultLoggers.Serialization.SetLevel(Logger.LogLevel.Verbose);
DefaultLoggers.Connection.SetLevel(Logger.LogLevel.Verbose);
DefaultLoggers.Client.SetLevel(Logger.LogLevel.Verbose);
DefaultLoggers.ClientRtm.SetLevel(Logger.LogLevel.Verbose);
DefaultLoggers.ClientRtmSubscription.SetLevel(Logger.LogLevel.Verbose);
The SDK supports working through an HTTPS proxy. The following is an example how to set a proxy server:
IRtmClient client = new RtmClientBuilder("YOUR_ENDPOINT", "YOUR_APPKEY")
.SetHttpsProxy(new Uri("http://127.0.0.1:3128"))
.Build();
This functionality is available when running on .NET Framework. Proxy options are ignored on Mono (including Xamarin and Unity).
- Open
Satori.VS.sln
with Visual Studio 2017 on Windows. - Build the
Satori.RTM.Portable
andSatori.RTM.Net45
projects
- Open
Satori.VS.sln
with Visual Studio 2017 on Windows. - Build the
Satori.RTM.Unity
project
Note, the Satori.RTM.Unity
project must be built by msbuild
(Visual Studio). Assemblies, built by xbuild
(Xamarin Studio), won't work.
Tests require credentials to establish connection to Satori endpoint. Credentials should be provided in the following format:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Endpoint>wss://<SATORI HOST>/</Endpoint>
<Appkey><APP KEY></Appkey>
<AuthRoleName><ROLE NAME></AuthRoleName>
<AuthRoleSecretKey><ROLE SECRET KEY></AuthRoleSecretKey>
<AuthRestrictedChannel><CHANNEL NAME></AuthRestrictedChannel>
</PropertyGroup>
</Project>
Endpoint
is your customer-specific DNS name for RTM access.Appkey
is your application key.AuthRoleName
is a role name that permits to publish / subscribe toAuthRestrictedChannel
. Must be notdefault
.AuthRoleSecretKey
is a secret key forAuthRoleName
.AuthRestrictedChannel
is a channel with subscribe and publish access forAuthRoleName
role only.
You must use DevPortal to create role and set channel permissions.
To replace placeholders in the SDK source code with the provided credentials:
- Save the credentials to the
..\Satori.RTM.Credentials.props
path, relative to theSatori.VS.sln
file - Build the
ApplyCredentials.csproj
project - To revert changes back, run the Clean task of the
ApplyCredentials.csproj
project
Tests for .NET/Mono 4.6 can be run in the similar way. The project with tests for .NET 4.6 is called Satori.RTM.Test.Net46
.
nuget restore Satori.VS.sln -ConfigFile nuget.config
msbuild tests\integration\Satori.RTM.Test.Net45\Satori.RTM.Test.Net45.csproj /t:RunTests /p:Configuration=Release
nuget restore Satori.XS.sln -ConfigFile nuget.config
xbuild tests/integration/Satori.RTM.Test.Net45/Satori.RTM.Test.Net45.csproj /t:RunTests /p:Configuration=Release
- Build the
tests/integration/Satori.RTM.Test.Net45
project - Click 'Test > Run > All Tests' in the top menu
- Build the
tests/integration/Satori.RTM.Test.Net45
project - Click 'Run > Run Unit tests' in the top menu
- Click 'View > Pads > Test Results' to view test results
Tu run tests for Xamarin (Android or iOS) on a device or simulator:
- Build the
tests/integration/Satori.RTM.Test.Android
(or .iOS) project with Visual Studio 2017 - Start this project. It deploys the test app on the device.
- Run tests using the UI of the deployed app
To run tests for Unity on a device:
- Open the
tests/integration/Satori.RTM.Test.Unity/Satori.RTM.TestRunner/
folder in the Unity Editor - Switch to one of the platforms in Build Settings: Standalone, Android, or iOS
- Click 'Window > Test Runner' in the top menu
- Select the PlayMode tab
- Press the 'Run all in player' button
We follow C# Coding Style of .NET Core Libraries (CoreFX) project. Code style is enforced by StyleCop. Not all StyleCop rules are enabled.