简单的场景。我有一个带有URL方案设置的应用程序。 e.g。
infoplist包含一个数组URL类型
该数组包含一个包含2个键的字典:URL标识符(String)和URL Schemes(Array)
标识符等于捆绑ID,方法是将其设置为$(PRODUCT_BUNDLE_IDENTIFIER)。
网址方案仅包含1个值" deeplink-test"在这种情况下。在我的AppDelegate中,我有应用程序:openURL:options:实现的方法返回true。
现在,当我去Safari(在模拟器或设备上)并输入" deeplink-test://" Safari问我是否要打开应用程序。我选择是,但没有调用deeplink。 didFinishLaunchingWithOptions也返回true。知道为什么没有调用openURL委托方法?这曾经在前段时间工作,但最近我发现我们的深层链接不再被正确处理了。因此应用程序将打开,但不会调用委托方法。
我创建了一个具有相同实现的新项目。我可能使用的Pod会导致问题吗?
荚:
pod 'Apollo'
pod 'ReactiveObjC'
pod 'Underscore.m'
pod 'Masonry'
pod 'Locksmith'
pod 'INTULocationManager'
pod 'GoogleAnalytics'
pod 'GoogleTagManager'
pod 'GoogleAppIndexing'
pod 'GoogleSignIn'
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Messaging'
pod 'HockeySDK'
pod 'Adjust'
pod 'UIDevice-Hardware'
pod 'Accengage-iOS-SDK'
pod 'MultiDelegate'
pod 'SwipeView'
pod 'DZNEmptyDataSet'
pod 'FBSDKLoginKit'
pod 'PINCache'
pod 'FCFileManager'
pod 'SnapKit'
pod 'GoogleMaps'
pod 'GooglePlaces'
pod 'RSKGrowingTextView'
pod 'FlexiblePageControl'
pod 'SwiftyBeaver'
pod 'Crashlytics'
pod 'Fabric'
pod 'React', :path => '../../node_modules/react-native', :subspecs => [
'Core',
'RCTText',
'RCTNetwork',
'RCTWebSocket',
'RCTLinkingIOS',
'RCTImage',
'RCTAnimation',
'RCTActionSheet'
]
pod 'Yoga', :path => '../../node_modules/react-native/ReactCommon/yoga'
pod 'CodePush', :path => '../../node_modules/react-native-code-push'
pod 'RNDeviceInfo', :path => '../../node_modules/react-native-device-info'
pod 'react-native-cookies', :path => '../../node_modules/react-native-cookies'
pod 'react-native-navigation', :path => '../../node_modules/react-native-navigation'
pod 'react-native-video', :path => '../../node_modules/react-native-video'
编辑 - 添加了plist源代码:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>xx.xxx.xxx</string>
<key>CFBundleURLSchemes</key>
<array>
<string>deeplink-test-again</string>
</array>
</dict>
</array>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME} ${BUNDLE_DISPLAY_NAME_SUFFIX}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIcons</key>
<dict/>
<key>CFBundleIcons~ipad</key>
<dict/>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>11.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>105</string>
<key>Fabric</key>
<dict>
<key>APIKey</key>
<string>xx.xxx.xxx</string>
<key>Kits</key>
<array>
<dict>
<key>KitInfo</key>
<dict/>
<key>KitName</key>
<string>Crashlytics</string>
</dict>
</array>
</dict>
<key>FacebookAppID</key>
<string>xx.xxx.xxx</string>
<key>FacebookDisplayName</key>
<string>xx.xxx.xxx</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>Icon files (iOS 6)</key>
<dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>icon.png</string>
<string>icon@2x.png</string>
</array>
<key>UIPrerenderedIcon</key>
<true/>
</dict>
</dict>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>comgooglemaps</string>
<string>bma4sreceiver</string>
<string>xx.xxx.xxx</string>
<string>fbapi</string>
<string>fb-messenger-share-api</string>
<string>fbauth2</string>
<string>fbshareextension</string>
</array>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>xx.xxx.xxx</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>facebook.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>fbcdn.net</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>localhost</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
<key>NSCalendarsUsageDescription</key>
<string>xx.xxx.xxx</string>
<key>NSCameraUsageDescription</key>
<string>xx.xxx.xxx</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>xx.xxx.xxx</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>xx.xxx.xxx</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>xx.xxx.xxx</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>xx.xxx.xxx</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>xx.xxx.xxx</string>
<key>UIBackgroundModes</key>
<array>
<string>remote-notification</string>
</array>
<key>UILaunchStoryboardName</key>
<string>xx.xxx.xxx</string>
<key>UIPrerenderedIcon</key>
<true/>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UIRequiresFullScreen</key>
<true/>
<key>UIStatusBarHidden</key>
<false/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>
</dict>
</plist>
答案 0 :(得分:0)
问题原来是我用于推送通知的Pod(https://docs.accengage.com/display/IOS/SDK+Setup)。他们在设置过程中做了一些奇怪的事情,并自动拦截了应该将其转发给应用程序的应用程序委托方法。
虽然它无法正常工作。