You are right. I added this code to my assembly and now bass is able to load all the libraries normally:
// Used to get correct dylib path for bass libraries
public static nint ImportResolver(string libraryName, Assembly assembly, DllImportSearchPath? searchPath)
{
nint libHandle = 0;
if (libraryName.StartsWith("bass"))
{
#if WINDOWS
NativeLibrary.TryLoad($"{libraryName}.dll", out libHandle);
#elif __ANDROID__
NativeLibrary.TryLoad($"{libraryName}.so", assembly, DllImportSearchPath.ApplicationDirectory, out libHandle);
#elif __IOS__
NativeLibrary.TryLoad($"./Frameworks/{libraryName}.framework/{libraryName}", assembly, DllImportSearchPath.ApplicationDirectory, out libHandle);
#else
CrossPlatform.Assert(false);
#endif
}
return libHandle;
}
Just register the above function before making the first bass calls:
#if IOS
NativeLibrary.SetDllImportResolver(typeof(BassNet).Assembly, ImportResolver);
#endif