我正在开发一个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);
}
我希望收到来电通知。
提前致谢。
答案 0 :(得分:0)
感谢您在GitHub上发布您的答案,Shridhar。我在这里发布,所以如果遇到同样的问题,人们可以找到它:
我可以通过使用
Gacutil.exe
向GAC添加程序集来解决此问题。
https://github.com/ringcentral/ringcentral-csharp-client/issues/32