Fix RCTLinkingManager crash on iOS7
Reviewed By: nicklockwood Differential Revision: D2982199 fb-gh-sync-id: 28ff6ddfe850df5925424423115ba953651ca94f shipit-source-id: 28ff6ddfe850df5925424423115ba953651ca94f
This commit is contained in:
parent
9edfd945d1
commit
c8835d0226
|
@ -34,17 +34,18 @@ RCT_EXPORT_MODULE()
|
|||
- (NSDictionary<NSString *, id> *)constantsToExport
|
||||
{
|
||||
NSURL *initialURL;
|
||||
|
||||
|
||||
if (_bridge.launchOptions[UIApplicationLaunchOptionsURLKey]) {
|
||||
initialURL = _bridge.launchOptions[UIApplicationLaunchOptionsURLKey];
|
||||
} else if (_bridge.launchOptions[UIApplicationLaunchOptionsUserActivityDictionaryKey]) {
|
||||
} else if (&UIApplicationLaunchOptionsUserActivityDictionaryKey &&
|
||||
_bridge.launchOptions[UIApplicationLaunchOptionsUserActivityDictionaryKey]) {
|
||||
NSDictionary *userActivityDictionary = _bridge.launchOptions[UIApplicationLaunchOptionsUserActivityDictionaryKey];
|
||||
|
||||
if ([userActivityDictionary[UIApplicationLaunchOptionsUserActivityTypeKey] isEqual:NSUserActivityTypeBrowsingWeb]) {
|
||||
initialURL = ((NSUserActivity *)userActivityDictionary[@"UIApplicationLaunchOptionsUserActivityKey"]).webpageURL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return @{@"initialURL": RCTNullIfNil(initialURL.absoluteString)};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue