iOS Question Main.App.OpenURL do not open anything

Pendrush

Well-Known Member
Licensed User
Longtime User
At least on iOS v18.1 code below do nothing.
B4X:
#QueriesSchemes: https

If Main.App.CanOpenURL("https://www.example.com") Then  ' The result is TRUE
    Main.App.OpenURL("https://www.example.com")         ' This line is executed but nothing happened
End If

Tested on real device and simulator.

Any ideas?
 

Pendrush

Well-Known Member
Licensed User
Longtime User
Well it's a big project with a few libs, maybe something interfere with something, but I'm sure it was OK on v17.x.
I will investigate. Thank you for response.
 
Upvote 0

Pendrush

Well-Known Member
Licensed User
Longtime User
No, did not work.
Local builder with XCode v16.1
Example attached to post.
 

Attachments

  • Test1.zip
    5.6 KB · Views: 136
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
Works on my iPhone with 18.1.1 and compiled with the hosted builder. And does not work in the IOS simulator with ios 18.1

But it also doesn't work on my iPhone with 18.1.1 when I compile it via my local builder.
So the fault lies with the local builder.

xCode Version 16.1
 
Upvote 0

jtare

Active Member
Licensed User
Longtime User
Was it fixed? I could not reproduce this error before or after updating to B4i v8.80 and my app was rejected before updating to b4i 8.80. I will try compiling with the new version.

Could it be that the openURL(_: ) method is deprecated? https://developer.apple.com/documentation/uikit/uiapplication/openurl(_:)

By reading the compiled source code, it seems Main.App.OpenURL is using the deprecated API, or is it just a wrapper that actually uses the updated API underneath?

Thanks
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
 
Upvote 0
Top