stntz / Xamarin.ZoomBinding

Zoom Mobile SDK Binding for Xamarin Android and iOS(device only)
15 stars 13 forks source link

[Android] Missing ZoomUIDelegate on ZoomUIService #33

Open AdamDiament opened 3 years ago

AdamDiament commented 3 years ago

In my fix for https://github.com/stntz/Xamarin.ZoomBinding/issues/30 I added this line to metadata

<remove-node path="/api/package[@name='us.zoom.sdk']/interface[@name='ZoomUIService']/method[@name='setZoomUIDelegate']"/>

It allowed the ZoomUIService to appear on the ZoomSdk instance, which was great. However, setZoomUIDelegate is actually quite a key method, allowing the addition of listener functions to common zoom ui actions, like knowing when the user has gone into mini meeting mode.

Here are the docs for ZoomUIDelegate

Removing the remove-node line above, I've then tried tracing the binding warnings in the output back through the invalid interfaces to find the reason it doesn't like ZoomUIDelegate.

It seems to have something to do with the interfaces IMeetingInviteMenuItem and IMeetingInviteAction as per these lines

1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\Xamarin.Android.Bindings.Core.targets(53,5): obj\Release\api.xml(260053,6) warning BG8C00: Could not find base interface 'com.zipow.videobox.sdk.m0<us.zoom.sdk.IMeetingInviteMenuItem>' for type 'US.Zoom.Sdk.IZoomUIDelegate'.
1>C:\projects\Xamarin.ZoomBinding\src\MobileRTC_Droid\obj\Release\api.xml(257452,10): warning BG8801: Invalid parameter type 'us.zoom.sdk.MeetingInviteMenuItem.MeetingInviteAction' for member 'US.Zoom.Sdk.MeetingInviteMenuItem.MeetingInviteMenuItem (string, int, US.Zoom.Sdk.MeetingInviteMenuItem.IMeetingInviteAction)'.
1>C:\projects\Xamarin.ZoomBinding\src\MobileRTC_Droid\obj\Release\api.xml(257462,6): warning BG8502: Invalidating 'US.Zoom.Sdk.MeetingInviteMenuItem.IMeetingInviteAction' and all its nested types because some of its interfaces were invalid.

the "m0" in this line is also interesting

1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\Xamarin.Android.Bindings.Core.targets(53,5): obj\Release\api.xml(260053,6) warning BG8C00: Could not find base interface 'com.zipow.videobox.sdk.m0<us.zoom.sdk.IMeetingInviteMenuItem>' for type 'US.Zoom.Sdk.IZoomUIDelegate'.

So far I have tried adding the following nodes, all with no success

    <remove-node path="/api/package[@name='us.zoom.sdk']/interface[@name='ZoomUIDelegate']/method[@name='onClickInviteButton']"/>
    <remove-node path="/api/package[@name='us.zoom.sdk']/interface[@name='IMeetingInviteMenuItem']/method[@name='getAction']"/>
    <remove-node path="/api/package[@name='us.zoom.sdk']/interface[@name='IMeetingInviteMenuItem']"/>
    <attr path="/api/package[@name='us.zoom.sdk']/interface[@name='IMeetingInviteMenuItem']" name="obfuscated">false</attr>
stntz commented 3 years ago

Will using SimpleUIDelegate suffice and you can override the methods in there?

SimpleUIDelegate doc

AdamDiament commented 3 years ago

I think the simple delegate would work, but the problem is I need a way to register it as the delegate for a specific call. That is done with ZoomUIService.SetZoomUIDelegate(del), which is the method we are excluding from ZoomUIService in order to get it to appear via

<remove-node path="/api/package[@name='us.zoom.sdk']/interface[@name='ZoomUIService']/method[@name='setZoomUIDelegate']"/>