Don't call sharedApplication in App Extension (#26077)

Summary:
Related to this bug: https://github.com/facebook/react-native/pull/25769

Note I also had to add to the bottom of my podfile because RCTLinking had APPLICATION_EXTENSION_API_ONLY='YES' by default somehow.

```
post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'NO'
    end
  end
end
```
Pull Request resolved: https://github.com/facebook/react-native/pull/26077

Test Plan: Sandcastle should be sufficient.

Reviewed By: shergin

Differential Revision: D16860356

Pulled By: sammy-SC

fbshipit-source-id: 02cb3fd3f977420ccdc2991f0c3666ab0186b7bf
This commit is contained in:
Chet Corcos 2019-08-19 02:48:19 -07:00 коммит произвёл Facebook Github Bot
Родитель 9a3d722ccb
Коммит 81733d9e15
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -74,7 +74,7 @@ RCT_EXPORT_METHOD(showMessage:(NSString *)message color:(UIColor *)color backgro
CGSize screenSize = [UIScreen mainScreen].bounds.size;
if (@available(iOS 11.0, *)) {
UIWindow *window = UIApplication.sharedApplication.keyWindow;
UIWindow *window = RCTSharedApplication().keyWindow;
self->_window = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, screenSize.width, window.safeAreaInsets.top + 30)];
self->_label = [[UILabel alloc] initWithFrame:CGRectMake(0, window.safeAreaInsets.top, screenSize.width, 30)];
} else {