We are aware of these blocking issues which have been reported in the
Github repository for the RingCentral C# SDK, and we are working on prioritizing this work to get our developers unblocked.
In the meantime, the RingCentral C# SDK is open source, and we welcome contributions from our community. Please see the Github Issue tracker for reported issues and follow the contribution documentation to become an active contributor this open source project.
https://github.com/ringcentral/ringcentral-csharp/issuesThis issue has more activity on this thread, please consider this post deprecated and use the original post for any content or new relating issues:
https://devcommunity.ringcentral.com/ringcentraldev/topics/long-running-subscription-issues-c-sdk
Please have a look at this code. I have subscription and presence working in C#. This should help :
https://github.com/vyshakhbabji/ringcentral-csharp-demo/blob/master/ConsoleApplication1/Program.cs
Using the C# SDK, the following example code should get you started. I just verified it working and receiving decrypted events. Since the C# SDK will automatically decrypt the PubNub payload, you should not need to specify any cipher keys yourself.
The following app is a console app that will listen to presence events and print out state changes. I've also added this example code
here.
http://ringcentral-sdk-csharp-simple.readthedocs.org/en/latest/notifications/Subscription/
using System; using RingCentral.SDK; using RingCentral.Subscription; namespace console.subscribe { class MainClass { static void ActionOnNotification(object message) { var receivedMessage = message.ToString(); Console.WriteLine(receivedMessage); } static void ActionOnConnect(object message){ var receivedMessage = message.ToString(); Console.WriteLine(receivedMessage); } static void ActionOnError(object error) { var receivedMessage = error.ToString(); Console.WriteLine(receivedMessage); } public static void Main (string[] args) { var url = "https://platform.devtest.ringcentral.com"; var sdk = new RingCentral.SDK.SDK("myAppKey", "myAppSecret", url, "appName", "appVersion"); sdk.GetPlatform().Authorize("myUsername", "myExtension", "myPassword", true); var sub = new SubscriptionServiceImplementation(){ _platform = sdk.GetPlatform()}; sub.AddEvent("/restapi/v1.0/account/~/extension/~/presence"); sub.Subscribe(ActionOnNotification, ActionOnConnect, ActionOnError); Console.ReadLine(); Console.WriteLine("Hello World!"); } } }