I am creating an app, and I have a banner which promotes my other app. This is my code:
var barsButton : UIButton = UIButton(frame: CGRectMake((self.view.bounds.width / 2) - 51, self.view.bounds.height - 100, 102, 30)) barsButton.setImage(UIImage(named: "Bars Icon 2.png"), forState: .Normal) barsButton.addTarget(self, action: "openBarsLink", forControlEvents: UIControlEvents.TouchUpInside) func openBarsLink() { var barsLink : String = "itms-apps:https://itunes.apple.com/app/bars/id706081574?mt=8" UIApplication.sharedApplication().openURL(NSURL.URLWithString(barsLink)) }
However, when the user presses the button, it just takes them to the App Store, and not the specific page for my app. What am I doing wrong?
Step 1: Go to the Apple App Store on your iOS device. Step 2: Search for your app and go to the app page. Step 3: Tap the Share Sheet button on the top right of the screen, then choose Copy Link. You can also share your app with others using available sharing methods, such as Skype.
You have too many protocols in your URL. Get rid of https:
so the URL reads
itms-apps://itunes.apple.com/app/bars/id706081574
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With