I am using following pods in a Share Extension. The complier is keep showing error: sharedApplication' is unavailable: not available on iOS (App Extension) - Use view controller based solutions where appropriate instead. in every library on [UIApplication sharedApplication] line
I installed all libraries in the Share Extension target.
I have four targets including Share-Extension in my project and I have set “AppExtension flag is NO” for each target. Still appear errors.
Target -> Build Settings -> Require Only AppExtension-Safe API -> NO
My Podfile:
platform :ios, '11.2'
def shared_pods
use_frameworks!
source 'https://github.com/CocoaPods/Specs.git'
pod 'XMPPFramework', :git => "https://github.com/robbiehanson/XMPPFramework.git", :branch => 'master'
pod 'MBProgressHUD'
pod 'GoogleMaps'
pod 'GooglePlaces'
pod 'AccountKit'
pod 'Alamofire', '~> 4.5'
pod 'AlamofireImage', '~> 3.3'
pod 'SVProgressHUD'
pod 'SDWebImage', '~> 4.1.1'
pod 'AWSS3', '~> 2.6.0'
pod 'Fabric'
pod 'Crashlytics'
pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'ReverseExtension'
end
target ‘Production' do
shared_pods
end
target ‘Development’ do
shared_pods
end
target ‘Testing’ do
shared_pods
end
Some Pods can not be used in extensions. I ran into this exact same issue with IQKeyboardManager. https://github.com/hackiftekhar/IQKeyboardManager/issues/410
sharedApplication or shared are not available in the Extension type I was using.