question

hardik-joshi6230 avatar image
hardik-joshi6230 asked Tyler Liu answered

Getting WaitingForActivation while using c# sdk

Hi,


I am using c# sdk for my server application.i have already done authorization using appKey and appSecret and user name password.


now when i am going call method to get the messages (Message List) from c# using below code.its giving me following response.


Request :


var extension = rc.Restapi().Account().Extension();


var response = await extension.MessageStore().List();


var messages = response.records;


in response i am getting below :


Id = 1487

Status = WaitingForActivation

Result = null


can you please help me solve this problem

sdk
1 |1500 characters needed characters left characters exceeded

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
The C# SDK is async.

  var response = await extension.MessageStore().List();

Do not omit the await keyword.

 Or you can try the following:

var response = extension.MessageStore().List(). Result;

Reference:  https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/async
1 |1500 characters needed characters left characters exceeded

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

hardik-joshi6230 avatar image
hardik-joshi6230 answered
Thanks Tyler for your reply. but when i am using above mention solutions. it will not giving me any response just stuck over there.

Nothing is happens when i use await keyword or writing .Result as above. it will simply stuck and not able to get any response from it


1 |1500 characters needed characters left characters exceeded

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
It's hard to get C# async correct. And it is often "stuck". Generally speaking it is a C# programming issue:  https://www.google.com.hk/search?q=c%23+async+stuck&oq=c%23+async+stuck&aqs=chrome..69i57j69...
1 |1500 characters needed characters left characters exceeded

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
According to this:  https://stackoverflow.com/a/14527164/862862

One possible solution is to use await everywhere. Don't mixup await and .Result
1 |1500 characters needed characters left characters exceeded

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