I followed all the instructions but cant seem to get this working.
I need to create bindings for Agora Video Call iOS Sdk.
Here's the steps I tried:
I also tried unloading and reloading the project but that didn't help.
Am I missing something here?
I feel stupid ... I figured this out after diving into the real details of sharpie and binding objective-c.
Turns out whatever I did above is correct. It's just a matter of correcting the ApiDefinition.cs.
Some stuffs/errors I came across that had to be modified:
Remove unnecessary 'using AgoraRtcKit;' on top.
void* -> IntPtr.
Change delegate method name to reflect the preferred name if there exists another method with same parameters list. Ex:
[Export("rtcEngine:didJoinChannel:withUid:elapsed:")] void RtcEngine(AgoraRtcEngineKit engine, string channel, nuint uid, nint elapsed); [Export("rtcEngine:didRejoinChannel:withUid:elapsed:")] void RtcEngine(AgoraRtcEngineKit engine, string channel, nuint uid, nint elapsed); // above changed to [Export("rtcEngine:didJoinChannel:withUid:elapsed:")] void DidJoinChannel(AgoraRtcEngineKit engine, string channel, nuint uid, nint elapsed); [Export("rtcEngine:didRejoinChannel:withUid:elapsed:")] void DidRejoinChannel(AgoraRtcEngineKit engine, string channel, nuint uid, nint elapsed);
Any type that seems too whacky or unsure, change to NSObject. The consumer can take care of the parsing/conversion.
Namespace is important. Needs to be matched with the 'library' part of library.framework.
Other minor translation between native and C#.
Eventually was able to build and compile this ...
Answers
I feel stupid ... I figured this out after diving into the real details of sharpie and binding objective-c.
Turns out whatever I did above is correct. It's just a matter of correcting the ApiDefinition.cs.
Some stuffs/errors I came across that had to be modified:
Remove unnecessary 'using AgoraRtcKit;' on top.
void* -> IntPtr.
Change delegate method name to reflect the preferred name if there exists another method with same parameters list. Ex:
Any type that seems too whacky or unsure, change to NSObject. The consumer can take care of the parsing/conversion.
Namespace is important. Needs to be matched with the 'library' part of library.framework.
Other minor translation between native and C#.
Eventually was able to build and compile this ...
Congrats, and thanks for sharing the answer.