Question

Notification is not coming up in C#

  • 29 August 2016
  • 4 replies
  • 536 views

I am able to register the sandbox account using the C#. I can also able to send the SMS messages through my C# API. However for the incoming call events, Incoming SMS events the notification is not raising.


sample code below:


sdk = new SDK(appKey, appSecret, SDK.Server.Sandbox, "CMC CTI Test", "");

var platform = sdk.Platform;

sdk.Platform.Login(phoneNumber, "", password, false);

sub = sdk.CreateSubscription();


sub.NotificationEvent += (sender, e) => {


Console.WriteLine(e.Message);

};

sub.Register();



4 replies

Are you using the latest version of the C# SDK from Github? https://github.com/ringcentral/ringcentral-csharp-client

Looking at your sample code, I do not see where you've added the event filters, and it appears you may be on an older or unofficial version of the RingCentral C# SDK.

Here is the code sample provided in the README.md for Subscriptions which appears slightly different from yours:

var subscription = rc.Restapi().Subscription().New(); subscription.EventFilters.Add("/restapi/v1.0/account/~/extension/~/message-store"); subscription.EventFilters.Add("/restapi/v1.0/account/~/extension/~/presence"); subscription.ConnectEvent += (sender, args) => {     Console.WriteLine("Connected:");     Console.WriteLine(args.Message); }; subscription.NotificationEvent += (sender, args) => {     Console.WriteLine("Notification:");     Console.WriteLine(args.Message); }; subscription.ErrorEvent += (sender, args) => {     Console.WriteLine("Error:");     Console.WriteLine(args.Message); }; subscription.Register();
Hi Benjamin,

Thank you for sharing the information. I have downloaded and verified that test applications and getting this below error on 

private RestClient rc; (Unable to resolve the symbol RestClient)

rc.Restapi().Subscription.New (Unable to resolve the symbol Restapi)

I was checking all references added properly and i downloaded the required packages from Nuget Manager.

Thanks.

This seems like an appropriate issue to post in the issue tracker in Github for the repository of the C# SDK: https://github.com/ringcentral/ringcentral-csharp-client/issues.
Because you didn't add any event filters for sms and call events. Please check the sample code posted by Dean.

Notifications in sandbox don't work reliably, so even you add the event filters, you might still have issues.

We are moving away to GitHub and Stackoverflow so it's better for you to post your questions there.

Reply