question

z-admin2902 avatar image
z-admin2902 asked Tyler Liu answered

Notification is not coming up in C#

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();


sdk
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

benjamin-dean avatar image
benjamin-dean answered
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();
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

z-admin2902 avatar image
z-admin2902 answered
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.

1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

benjamin-dean avatar image
benjamin-dean answered
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.
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Tyler Liu avatar image
Tyler Liu answered
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.
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys