I am trying to create a chatclient for facebook for iOS in Unity/Monotouch/C#. I get the following error
ExecutionEngineException: Attempting to JIT compile method '(wrapper managed-to-native)
System.Threading.Interlocked:CompareExchange
(System.EventHandler`1<Matrix.EventArgs>&,System.EventHandler`1<Matrix.EventArgs>,
System.Eve ntHandler`1<Matrix.EventArgs>)' while running with --aot-only.
at Matrix.Net.BaseSocket.add_OnConnect (System.EventHandler`1 value) [0x00000]
in <filename unknown>:0
at Matrix.XmppStream..ctor (StreamType type) [0x00000] in <filename unknown>:0
at Matrix.Xmpp.Client.XmppClient..ctor () [0x00000] in <filename unknown>:0
at TestFacebook.setup () [0x00000] in <filename unknown>:0
at TestFacebook.Start () [0x00000] in <filename unknown>:0
(Filename: Line: -1)
when I try to connect one of the delegates in the XMPP framework. This is the code that probably causes it:
xmppClient.OnBeforeSasl += this.xmppClient_OnBeforeSasl;
The delegate method:
public void xmppClient_OnBeforeSasl(object sender, Matrix.Xmpp.Sasl.SaslEventArgs e)
{ ... }
Have also tried to change API comparability level top .NET 2.0 without any result. Setting the xmppClient_OnBeforeSasl method as static does not help either. It works fine in Unity but crashes when running on an iOS device.
Turns out Matrix does not support iOS 🙁