Web App Links Not Opening

Hello,

I've published my animated children's book apps. Find them in the Apple Apps Store under "Lulu & Friends".

Problem: In my web app, I've included links to my other book apps in the Apple App Store and a link to the App Store Review of the particular app. When any of these links/URLs are clicked in Xcode Simulator or in the published app, they don't go anywhere. However, in Hype preview or from the exported HTML, they work just fine. Any suggestions? Thanks!

Lulu & the Laughing Daisy: https://apple.co/33D6dKm
Lulu & the Crazy Caterpillar: https://apple.co/3ln0tdN
Lulu & the Missing Spots: https://apple.co/33DRj6x


App Review Link: https://itunes.apple.com/us/app/appName/id1533863839?mt=8&action=write-review

The issue may be related to this :

If I remember right my conlusion of the issue is in this post

and the work around in this one.

1 Like

You may need to check 'Open link in new Window' within Hype. This resolved a similar issue in iBooks.

Screenshot 2020-10-16 at 11.28.33 AM

1 Like

Here is what I have... BTW, this is an iOS app not iBooks issue :grinning:

Do you see any errors in Xcode's console? Did either of @MarkHunte's suggestions help?

Now that you asked, I waited for a bit and get this error in Simulator after clicking on a link to the Apple App Store
.


I contacted DJON who he worked with to see if he had any further explanation to the issue MarkHunte helped him with.

If this is an iOS app and always had "open in a new window" checked, then you'll need explicit code that takes the new window request and redirects it to open in Safari.

A basic solution appears to be here:

1 Like

I believe I added this bit of code to address this issue a while ago.

You have set the navigation delegate, but you need to implement the delegate method that does the redirection. From the link I previously sent, this code is:

    func webView(_ webView: WKWebView, createWebViewWith configuration: WKWebViewConfiguration, for navigationAction: WKNavigationAction, windowFeatures: WKWindowFeatures) -> WKWebView? {
        if navigationAction.targetFrame == nil {
            //webView.load(navigationAction.request)
            UIApplication.shared.open(navigationAction.request.url!, options: [:])
        }
        return nil
    }
2 Likes

I think I'm getting there. Lol! Looks like this code will need to be included in the "AppDelegate.swift" file?

No, it would be in your ViewController.swift, in the ViewController class as a sibling function to viewDidLoad.

Note that you are setting webView.naviationDelegate = self. In this case self refers to the ViewController so it should go there.

1 Like

Thanks. I added the code with no additional results. :thinking:

Adding import UIKit and changing

webView.naviationDelegate = self

to

webView.uiDelegate = self

may have fixed it. External links, & Review page is appearing to work. Not sure if the links to App Store are working properly yet. I'm going to submit this build and try it out after it is accepted.

Update. All three of my apps have been updated and submitted to the Apple App Store and are awaiting review. I'll test and update here soon. Thanks!

1 Like

Great - glad you got it!

1 Like

All are pulling up links. However, the review link works fine by going to the store review section:
https://itunes.apple.com/us/app/appName/id1533863839?mt=8&action=write-review
The store links do not work. They go to Apple's web page. They were made by the Apple Link Builder:

So. I think the apps need a link like the first one which I found through forums not from Apple.

I think these are the proper links:

I'm going to test them tonight.

Hello everyone. I'm happy to say that everything is working great. I downloaded all my apps from the store and every link works! Thank you everyone for your help!

Frank

2 Likes

Great - glad you got it all working!

1 Like