I am writing a C# app and I am attempting to automatically join a meeting when I start a console app. I am able to successfully initialize the SDK and authenticate, however, I am unable to complete the auth process for some reason. When I call the auth method, it doesn’t error out, but it also never triggers the callback method either, so it appears to do nothing. Can someone in support take a look at my code and let me know if I am missing something?
I am able to run the demo app and join a meeting perfectly fine, so I know my JWT and other credentials are good. It’s just that I cannot do this from a console app.
Code:
using System;
// ...
using ZOOM_SDK_DOTNET_WRAP;
namespace ZoomCliTest
{
public class Program
{
private static ManualResetEvent waitHandle = new ManualResetEvent(false);
static void Main(string[ ] args)
{
new Program().Run();
Console.WriteLine("Cleaning up...");
ZOOM_SDK_DOTNET_WRAP.CZoomSDKeDotNetWrap.Instance.CleanUp();
}
public void AuthReturn(AuthResult ret)
{
Console.WriteLine("We've been auth'd!!!");
if (ZOOM_SDK_DOTNET_WRAP.AuthResult.AUTHRET_SUCCESS == ret)
{
JoinMeeting();
}
else
{
Console.WriteLine("Auth error: {0}", ret);
}
waitHandle.Set();
}
public void onLoginRet(LOGINSTATUS ret, IAccountInfo pAccountInfo)
{
Console.WriteLine("Logging in...");
}
public void onLogout()
{
Console.WriteLine("Logging out...");
}
public void Run()
{
var initParam = new InitParam { web_domain = "https://zoom.us",enable_log = true};
var initErr = CZoomSDKeDotNetWrap.Instance.Initialize(initParam);
Console.WriteLine("Init Error: {0}", initErr);
//register callback
CZoomSDKeDotNetWrap.Instance.GetAuthServiceWrap().Add_CB_onAuthenticationReturn(AuthReturn);
CZoomSDKeDotNetWrap.Instance.GetAuthServiceWrap().Add_CB_onLoginRet(onLoginRet);
CZoomSDKeDotNetWrap.Instance.GetAuthServiceWrap().Add_CB_onLogout(onLogout);
var authParam = new AuthContext
{
jwt_token = "..."
};
var authErr = CZoomSDKeDotNetWrap.Instance.GetAuthServiceWrap().SDKAuth(authParam);
Console.WriteLine("Auth status: {0}", authErr);
var result = CZoomSDKeDotNetWrap.Instance.GetAuthServiceWrap().GetAuthResult();
Console.WriteLine("Auth result: {0}", result);
var id = CZoomSDKeDotNetWrap.Instance.GetAuthServiceWrap().GetSDKIdentity();
Console.WriteLine(id);
var status = CZoomSDKeDotNetWrap.Instance.GetAuthServiceWrap().GetLoginStatus();
Console.WriteLine(status);
waitHandle.WaitOne();
}
private static void JoinMeeting()
{
// ...join a meeting
}
}
}
And the logs yield the following:
Init status: SDKERR_SUCCESS
Auth status: SDKERR_SUCCESS
Auth result: AUTHRET_NONE
LOGIN_IDLE
And I am running it in Release x86 mode.