Opening an iOS app from another iOS app: Difference between revisions
(Created page with "{{Header |Status=Resolved |The problem=There may be occasions where you want to link to content in another app. You can open this by a few lines in Xcode. In this example, I am going to create a link from one iOS app, in this example, I am going to open the Cheeky News App with Cheeky Radio Pro. }} {{How to guide}}") |
No edit summary |
||
| Line 5: | Line 5: | ||
In this example, I am going to create a link from one iOS app, in this example, I am going to open the Cheeky News App with Cheeky Radio Pro. | In this example, I am going to create a link from one iOS app, in this example, I am going to open the Cheeky News App with Cheeky Radio Pro. | ||
}} | }} | ||
{{How to guide}} | {{How to guide | ||
|Device=iPhone | |||
|Operating system=iOS | |||
|Software=Xcode | |||
|Guidance=First, open the Cheeky News app in Xcode: | |||
[[File:Cheeky News info.png|alt=This show the Cheek News open in Xcode in the main information page for the deployment targets.|none|frame|Cheeky News open in Xocde]] | |||
Open the info.plist for the app: | |||
[[File:Cheeky News info plist.png|alt=This shows the Cheeky News info plist|none|frame|Cheeky News info.plist]] | |||
Right click and add a new row and select URL types: | |||
[[File:Cheeky News add URL types 1.png|alt=Cheeky News URL select in the info.plist|none|frame|Cheeky News URL select in the info.plist]] | |||
Over the Item 0, click on the + and select URL schemes: | |||
[[File:URL schemes.png|alt=This shows the URL schemes that are under the URL identifier.|none|frame|URL schemes]] | |||
In the third column, give the app a unique name, in this case CheekyNews. | |||
Run the app. | |||
In the app you are going to link from, the link you will use is CheekyNews// | |||
In this example, Cheeky Radio Pro this goes in the PopUpMenuViewController.swift file: | |||
[[File:Cheeky Radio link to Cheeky News.png|alt=This shows where I am going to link to the Cheeky News app from.|none|frame|Cheeky Radio file to link to Cheeky News]] | |||
The link in this example is called by: | |||
@IBAction func NewsButton(_ sender: UIButton) { | |||
if let url = URL(string: “CheekyNews://”) { | |||
UIApplication.shared.open(url) | |||
} | |||
} | |||
Run the app and make sure it works. | |||
}} | |||
Revision as of 22:16, 11 November 2023
Status: Resolved
Publication date:
Last edited by: Garyf
Last updated: 2023 - 11 - 11
The problem
There may be occasions where you want to link to content in another app. You can open this by a few lines in Xcode.
In this example, I am going to create a link from one iOS app, in this example, I am going to open the Cheeky News App with Cheeky Radio Pro.
The resolution
Please note: cheekyfactor.com or the owners of this site cannot be held responsible if things go wrong. You perform these tasks at your own risk.
Device: iPhone
Operating system: iOS
Software: Xcode
Guidance for iPhone, iOS, Xcode
First, open the Cheeky News app in Xcode:
Open the info.plist for the app:
Right click and add a new row and select URL types:
Over the Item 0, click on the + and select URL schemes:
In the third column, give the app a unique name, in this case CheekyNews.
Run the app.
In the app you are going to link from, the link you will use is CheekyNews//
In this example, Cheeky Radio Pro this goes in the PopUpMenuViewController.swift file:
The link in this example is called by:
@IBAction func NewsButton(_ sender: UIButton) {
if let url = URL(string: “CheekyNews://”) {
UIApplication.shared.open(url)
}
}
Run the app and make sure it works.




