iFrame not not responding to postMessage call on iOS

I recently integrated with a third party to give us an iFrame to handle sensitive user input within a Capacitor app. After a user enters finishes entering information we have to signal this iFrame to get a token from the third party by querying for the iFrame in the DOM and then calling contentWindow.postMessage() to send a message to the iFrame, then we listen for message events to get the token back.

This is working as it should on all devices except for physical iOS devices, where it seems like the iFrame isn’t getting or responding to the postMessage call at all. I’ve confirmed that we’re successfully querying for it and passing the correct information, but the iFrame takes no action as if we didn’t make the postMessage call at all and there are no errors thrown. Oddly, it works on an iOS simulator, just not physical devices.

The app is built upon Capacitor 4.1.0 using Angular Typescript.

After doing some digging through the iFrame’s source code via the Sources tab in browsers, I can see that the iFrame is expecting the window.document.referrer value to be set. For iOS, it isn’t, but it is on other browsers.