I have both url scheme and universal links enabled on my iOS app.
On iOS, using a simulator phone, I can type in myapp:// into the safari address bar and it will pop open my app. But on an actual iPhone, typing in myapp:// into the safari address displays this following error:
Safari cannot open the page because the address is invalid
What am I missing here? Why is it working on simulator but not on the actual iPhone? How can I resolve this? I do know that iOS has moved to universal link - and that is working. But just trying to figure out why the urlscheme is working on one and not the other. One thing to note is the simulator is running iOS 16.2 while the iPhone is running iOS 15.3.1 (its an iPhone 7, it can't update to iOS 16). One would think the older iOS would support urlscheme and the newer wouldn't...but its the opposite here.
On Android, typing myapp:// into the chrome address bar works on both physical device and simulator.
UPDATE:
this is my entitlements-release.plist - pulled from the cordova projects folder: projectMyapp/platforms/ios/myApp directory. In Xcode, i do have entitlements but these two files are pretty much empty.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>production</string>
</dict>
</plist>
The entitlements-debut.plist is pretty much the same except the string says development.
I found the source of the problem. It turns out that Safari on the iPhone had been set to
privatemode...when set back tostart pagethe browser would recognize my custom url scheme.In attempts to troubleshoot the original issue though I came across this thread: iOS Safari does not recognize url schemes after user cancels
After getting the url scheme to work again (on the iPhone) I then tested the scenario described in this other thread and I am able to replicate the same problem. I am now implementing some cache buster code to prevent it from happening to end users. The issue (bug) is specific to safari tabs. The custom url scheme will work everytime with a prompt asking user to open the app...as long as the user clicks
OKit will always work, but after the first time the user clickscancelthe url scheme will never work again on that tab. The tab must be closed/deleted and a new tab opened for it work again. Others claim to have had success using a cache buster onthe url scheme to get it to work again on the same tab, but I have not been able to get that to work.Once again...another buggy Apple product.