RingCentral 来电通知
RingCentral incoming call notification
我正在开发一个winform应用程序来实时获取来电通知。我在授权方法
上遇到错误
下面是我的代码片段
private async void button1_Click(object sender, EventArgs e)
{
//rc = new RestClient(txtClientID.Text, txtClientSecrete.Text, !chkIsSandBox.Checked);
rc = new RestClient(txtClientID.Text, txtClientSecrete.Text);
await rc.Authorize(txtUsrName.Text, txtExtension.Text, txtPWD.Text);
RegisterSubscription();
}
async void RegisterSubscription()
{
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.PresenceEvent += subscription_PresenceEvent;
await subscription.Register();
}
void subscription_PresenceEvent(object sender, SubscriptionEventArgs e)
{
rtLog.Text += e.Message;
}
private async Task<TokenInfo> Authorize()
{
return await rc.Authorize(txtUsrName.Text, txtExtension.Text, txtPWD.Text);
}
我想收到来电通知。
提前致谢。
感谢您在 GitHub 上发布您的回答,Shridhar。我将其张贴在这里,以便人们 运行 遇到相同问题时可以找到它:
I was able to resolve this by adding assembly to the GAC using Gacutil.exe
.
https://github.com/ringcentral/ringcentral-csharp-client/issues/32
我正在开发一个winform应用程序来实时获取来电通知。我在授权方法
上遇到错误 private async void button1_Click(object sender, EventArgs e)
{
//rc = new RestClient(txtClientID.Text, txtClientSecrete.Text, !chkIsSandBox.Checked);
rc = new RestClient(txtClientID.Text, txtClientSecrete.Text);
await rc.Authorize(txtUsrName.Text, txtExtension.Text, txtPWD.Text);
RegisterSubscription();
}
async void RegisterSubscription()
{
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.PresenceEvent += subscription_PresenceEvent;
await subscription.Register();
}
void subscription_PresenceEvent(object sender, SubscriptionEventArgs e)
{
rtLog.Text += e.Message;
}
private async Task<TokenInfo> Authorize()
{
return await rc.Authorize(txtUsrName.Text, txtExtension.Text, txtPWD.Text);
}
我想收到来电通知。
提前致谢。
感谢您在 GitHub 上发布您的回答,Shridhar。我将其张贴在这里,以便人们 运行 遇到相同问题时可以找到它:
I was able to resolve this by adding assembly to the GAC using
Gacutil.exe
.
https://github.com/ringcentral/ringcentral-csharp-client/issues/32