Using RuntimeInitializeOnLoadMethod inside dll and using in iOS build

Hi all,

I created a simple script containing a method with [RuntimeInitializeOnLoadMethod] and then packed this script into a dll.

After that I created an empty project, imported this dll and built it for Android and iOS. On Android everything worked fine (the method is called as expected), but on iOS the method doesn’t seem to be called at all.

So the question is: Did I do something wrong or DLLs don’t work on iOS?

I used Unity 2018.2.11f1 to pack the dll and for the empty project.

This is the script I packed into a dll:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TestInitializeOnLoad : MonoBehaviour {
	static void OnRuntimeMethodLoaded()
		Debug.Log("I'm initializing in runtime");

In case anyone is still having this issue you need force unity to include the lib because of managed code striping with: [assembly: AlwaysLinkAssembly] from UnityEngine.Scripting