最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

ios - How can a url not open in a native app but open in a react-native app? - Stack Overflow

programmeradmin6浏览0评论

Hello I'm having some issue opening a URL to a browser outside the app, the error is only being reported on the MDM devices, locally they work fine

Link is being opened as follows:

        guard let url = URL(string: ";) else { return }
        if UIApplication.shared.canOpenURL(url) {
            UIApplication.shared.open(url)
        }

The following has also been added to info.plist under "Queried URL Schemes"

https, http, googlechrome, googlechromes

Users are reporting when interacting with the button, it's not doing anything

A different app in the same MDM device, opens the same link without any issues, this other app is on React-native though, and uses the following code:

<Button 
   className="w-100 p-3 mt-3 text-start"
   onClick={() => window.open(item.link,  "_blank","noopener,noreferrer")}
>

The expected functionality on both is that the default browser of the device (which is always set to Chrome) opens the link, however as stated, it works on my non managed device flawlessly, but users report that the Swift won't respond at all (seen it live with screen share), but the React-Native app works fine.

发布评论

评论列表(0)

  1. 暂无评论