Failed to load resource: The operation couldn’t be completed. Operation not permitted (Real device)

I'm building app where I use website in wkwebview. All the resources for website are local in my app packed as Web.bundle and everything work perfect, I don't have any issue with that. My website has feature to load pdf doc.

I'm trying to pass local pdf file from the Documents directory to be loaded in my website. The url(filePath) is like:

"file:///var/mobile/Containers/Data/Application/00DF5276-4836-462F-B3BC-E0734D638CF5/Documents/9772F378-16E1-4017-AF67-7712AB22B260.pdf". and it is as query param. The full url is like:

file:///private/var/containers/Bundle/Application/6FE99419-FC4A-4D91-9FCA-D9E6C17816A5/my.app/Web.bundle/site/index.html?file=file:///var/mobile/Containers/Data/Application/00DF5276-4836-462F-B3BC-E0734D638CF5/Documents/9772F378-16E1-4017-AF67-7712AB22B260.pdf'

allowingReadAccessToURL is correctly set.

Perfectly work on iOS simulator but not on real device. On real device I have error "Failed to load resource: The operation couldn’t be completed. Operation not permitted" and "The resource was requested insecurely."

Is there any permissions that I'm missing??

I've tried with 'Allow arbitrary load', 'Allow arbitrary load in Web content' but no luck.

Do I break some security rules with this approach? and what is the correct way to make real device to load file from Documents directory?

Failed to load resource: The operation couldn’t be completed. Operation not permitted (Real device)
 
 
Q