iOS Build Environment Help Center

How to add URL schemes in Xcode?

append delete Jay

Windows 11 Home 23H2
Builder version 3.64
iOS SDK 17.5

My app got rejected from the App Store because it requires me to add Sign in with Apple.
I am using this asset: https://assetstore.unity.com/packages/tools/integration/simple-sign-in-with-apple-284697
And in the author's doc (https://github.com/hippogamesunity/SimpleSignIn/wiki/Apple), it mentions:

For iOS and macOS: navigate to Player Settings > Other > Configuration and add your Custom URI scheme to Supported URL schemes. In Xcode, make sure that the URL scheme is added (Register your URL scheme).

So my question is how do I add the URL schemes in Xcode using the project builder?

Reply RSS

Replies

append delete #1. Jay

Basically, I need to do this: https://developer.apple.com/documentation/xcode/defining-a-custom-url-scheme-for-your-app#Register-your-URL-scheme
But I'm not sure how to do it using the project builder :(

append delete #2. Pierre-Marie Baty

Hello Jay

To add a custom URL scheme, what Xcode does behind the curtains is just adding an entry in the app's Info.plist under an array called CFBundleURLTypes. Here's an example:

% Info.plist -- how to add an URL beginning as 'myprefix://'
<key>CFBundleURLTypes</key>
<array>
	<dict>
		<key>CFBundleURLSchemes</key>
		<array>
			<string>myprefix</string>
		</array>
		<key>CFBundleURLName</key>
		<string>com.mycoolapp.myprefix</string>
	</dict>
</array>
%

Then add the relevant code in your app as per Apple's docs.

Hope it helps :)

Reply

(Leave this as-is, it’s a trap!)

There is no need to “register”, just enter the same name + password of your choice every time.

Pro tip: Use markup to add links, quotes and more.

Moderators: Pierre-Marie Baty