如何在Unreal Engine 4.18中配置iOS Universal Links与关联域名
Alright, let's tackle this Universal Links and cross-app deep linking setup between your iOS native app and UE4.18 blueprint-only marketing app. I’ve worked through similar UE4 iOS linking headaches before, so here’s a step-by-step breakdown to get this working smoothly:
1. First: Lock in Your Native App's Universal Links Configuration
Since you mentioned you can handle this via Xcode, just double-check these critical boxes to ensure it’s set up correctly (it’ll make troubleshooting the UE side easier):
- You’ve enabled Associated Domains for your native app in the Apple Developer Portal, adding
applinks:<your-domain> - Your domain hosts a valid
apple-app-site-associationfile (no.jsonsuffix) in either the root directory or.well-knownfolder, with entries for both your native and UE app’s Team ID + Bundle ID - Xcode’s project settings for the native app include the same
applinks:<your-domain>in Associated Domains - Test that the native app responds to Universal Links by opening your domain link in Safari—it should jump straight to the app without prompting to open in Safari
2. UE4.18 iOS Universal Links Configuration (Blueprint-Only)
This is where most folks hit snags with UE4.18. Here’s how to get it sorted without writing any C++:
a. Project Settings Tweaks
- Open your UE4 project, go to
Edit > Project Settings > Platforms > iOS - In the Associated Domains field, paste your
applinks:<your-domain>(match exactly what you used for the native app) - Double-check that your Bundle Identifier and Team ID match what’s in the Apple Developer Portal—typos here kill Universal Links every time
b. Force Info.plist Changes via IOSEngine.ini
UE4.18 sometimes fails to push project settings to the final Info.plist, so we’ll hardcode these values:
- Navigate to your UE project’s
Config/IOS/IOSEngine.inifile - Add these entries (replace placeholders with your actual values):
[IOSApplicationSettings] # Add custom scheme for fallback deep linking +CFBundleURLTypes = ( CFBundleURLName = "<your-ue-bundle-id>", CFBundleURLSchemes = ( "<your-ue-custom-scheme>" ) // e.g., "my-marketing-app" ) # Ensure Associated Domains are set +AssociatedDomains = "applinks:<your-domain>" # Allow querying native app's scheme +LSApplicationQueriesSchemes = "<native-app-custom-scheme>" // e.g., "my-native-app" # Temporary for testing—tighten this up for production +NSAppTransportSecurity = ( NSAllowsArbitraryLoads = true )
c. Blueprint Logic to Handle Incoming Links
Since you’re using only blueprints, use UE’s built-in URL handling:
- Open your main Game Mode or Player Controller blueprint
- Add an Event OnOpenURL node—this triggers whenever the UE app is opened via a Universal Link or custom scheme
- Use nodes like
Split StringorParse URLto break down the incoming URL, then branch logic to navigate to the correct marketing scene or content based on the link’s path
3. Cross-App Deep Linking Workflow
a. Native App → UE App
- Primary (Universal Links): Have the native app open your domain link (e.g.,
https://yourdomain.com/marketing/feature1)—if UE’s Universal Links are set up right, it’ll jump directly to the app - Fallback (Custom Scheme): If Universal Links fail (rare, but possible during testing), use the native app’s code to open the UE scheme:
if let url = URL(string: "my-marketing-app://feature1") { UIApplication.shared.open(url) }
b. UE App → Native App
- In your UE blueprint, use the Open URL node with either the native app’s Universal Link (e.g.,
https://yourdomain.com/native/home) or its custom scheme (e.g.,my-native-app://home) - Remember: We added the native scheme to
LSApplicationQueriesSchemesearlier, so this should work without permission errors
4. Troubleshooting Common UE4.18 Issues
- Associated Domains Not Sticking: If your UE app doesn’t recognize Universal Links, recheck the
IOSEngine.inientries—UE4.18 often ignores project settings here. Rebuild the project after editing the ini file. - Invalid apple-app-site-association: Use Apple’s official validation tool (found in the Apple Developer Portal) to confirm your file is formatted correctly and accessible.
- Blueprint Not Triggering: Test the
OnOpenURLevent using Xcode’sDebug > Open URLoption—input your Universal Link and see if the blueprint fires. If not, double-check that the node is attached to your active Game Mode/Player Controller. - Scheme Query Failures: If the UE app can’t open the native app, verify that
LSApplicationQueriesSchemesinIOSEngine.inihas the exact native scheme (case-sensitive!).
内容的提问来源于stack exchange,提问作者Chuck Gaffney

