Bläddra i källkod

Completely stop forcing static frameworks (#7570)

Paul Beusterien 5 år sedan
förälder
incheckning
38a056f36c

+ 0 - 1
FirebaseMLModelDownloader.podspec

@@ -29,7 +29,6 @@ Pod::Spec.new do |s|
   s.watchos.deployment_target = watchos_deployment_target
 
   s.cocoapods_version = '>= 1.4.0'
-  s.static_framework = true
   s.prefix_header_file = false
 
   s.source_files = [

+ 2 - 3
FirebasePerformance.podspec

@@ -24,7 +24,6 @@ Firebase Performance library to measure performance of Mobile and Web Apps.
   s.tvos.deployment_target = tvos_deployment_target
 
   s.cocoapods_version = '>= 1.4.0'
-  s.static_framework = true
   s.prefix_header_file = false
 
   base_dir = "FirebasePerformance/"
@@ -56,8 +55,8 @@ Firebase Performance library to measure performance of Mobile and Web Apps.
   }
 
   s.ios.framework = 'CoreTelephony'
-  s.ios.framework = 'QuartzCore'
-  s.ios.framework = 'SystemConfiguration'
+  s.framework = 'QuartzCore'
+  s.framework = 'SystemConfiguration'
   s.dependency 'FirebaseCore', '~> 7.0'
   s.dependency 'FirebaseInstallations', '~> 7.0'
   s.dependency 'FirebaseRemoteConfig', '~> 7.0'

+ 1 - 0
FirebasePerformance/CHANGELOG.md

@@ -1,5 +1,6 @@
 # Unreleased
 * Deprecate Clearcut event transport mechanism.
+* Enable dynamic framework support. (#7569)
 
 # Version 7.7.0
 * Add community supported tvOS.

+ 1 - 1
FirebasePerformance/Sources/FPRClient.m

@@ -119,7 +119,7 @@
     // Create the Logger for the Perf SDK events to be sent to Google Data Transport.
     self.gdtLogger = [[FPRGDTLogger alloc] initWithLogSource:logSource];
 
-#if __has_include("CoreTelephony/CTTelephonyNetworkInfo.h")
+#ifdef TARGET_HAS_MOBILE_CONNECTIVITY
     // Create telephony network information object ahead of time to avoid runtime delays.
     FPRNetworkInfo();
 #endif

+ 4 - 2
FirebasePerformance/Sources/FPRProtoUtils.h

@@ -12,7 +12,9 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#if __has_include("CoreTelephony/CTTelephonyNetworkInfo.h")
+#import <TargetConditionals.h>
+#if __has_include("CoreTelephony/CTTelephonyNetworkInfo.h") && !TARGET_OS_MACCATALYST
+#define TARGET_HAS_MOBILE_CONNECTIVITY
 #import <CoreTelephony/CTTelephonyNetworkInfo.h>
 #endif
 
@@ -55,7 +57,7 @@ extern FPRMSGGaugeMetric* _Nullable FPRGetGaugeMetric(NSArray* _Nonnull gaugeDat
  */
 extern FPRMSGApplicationProcessState FPRApplicationProcessState(FPRTraceState state);
 
-#if __has_include("CoreTelephony/CTTelephonyNetworkInfo.h")
+#ifdef TARGET_HAS_MOBILE_CONNECTIVITY
 /** Obtain a CTTelephonyNetworkInfo object to determine device network attributes.
  *  @return CTTelephonyNetworkInfo object.
  */

+ 5 - 5
FirebasePerformance/Sources/FPRProtoUtils.m

@@ -14,7 +14,7 @@
 
 #import "FirebasePerformance/Sources/FPRProtoUtils.h"
 
-#if __has_include("CoreTelephony/CTTelephonyNetworkInfo.h")
+#ifdef TARGET_HAS_MOBILE_CONNECTIVITY
 #import <CoreTelephony/CTCarrier.h>
 #import <CoreTelephony/CTTelephonyNetworkInfo.h>
 #endif
@@ -36,7 +36,7 @@ static GPBStringInt64Dictionary *FPRGetProtoCounterForDictionary(
     NSDictionary<NSString *, NSNumber *> *dictionary);
 static FPRMSGNetworkRequestMetric_HttpMethod FPRHTTPMethodForString(NSString *methodString);
 static FPRMSGNetworkConnectionInfo_NetworkType FPRNetworkConnectionInfoNetworkType(void);
-#if __has_include("CoreTelephony/CTTelephonyNetworkInfo.h")
+#ifdef TARGET_HAS_MOBILE_CONNECTIVITY
 static FPRMSGNetworkConnectionInfo_MobileSubtype FPRCellularNetworkType(void);
 #endif
 NSArray<FPRSessionDetails *> *FPRMakeFirstSessionVerbose(NSArray<FPRSessionDetails *> *sessions);
@@ -58,7 +58,7 @@ FPRMSGApplicationInfo *FPRGetApplicationInfoMessage() {
   iosAppInfo.bundleShortVersion = [mainBundle infoDictionary][@"CFBundleShortVersionString"];
   iosAppInfo.sdkVersion = [NSString stringWithUTF8String:kFPRSDKVersion];
   iosAppInfo.networkConnectionInfo.networkType = FPRNetworkConnectionInfoNetworkType();
-#if __has_include("CoreTelephony/CTTelephonyNetworkInfo.h")
+#ifdef TARGET_HAS_MOBILE_CONNECTIVITY
   CTTelephonyNetworkInfo *networkInfo = FPRNetworkInfo();
   CTCarrier *provider = networkInfo.subscriberCellularProvider;
   NSString *mccMnc = FPRValidatedMccMnc(provider.mobileCountryCode, provider.mobileNetworkCode);
@@ -256,7 +256,7 @@ FPRMSGApplicationProcessState FPRApplicationProcessState(FPRTraceState state) {
   return processState;
 }
 
-#if __has_include("CoreTelephony/CTTelephonyNetworkInfo.h")
+#ifdef TARGET_HAS_MOBILE_CONNECTIVITY
 CTTelephonyNetworkInfo *FPRNetworkInfo() {
   static CTTelephonyNetworkInfo *networkInfo;
   static dispatch_once_t onceToken;
@@ -340,7 +340,7 @@ static FPRMSGNetworkConnectionInfo_NetworkType FPRNetworkConnectionInfoNetworkTy
   return networkType;
 }
 
-#if __has_include("CoreTelephony/CTTelephonyNetworkInfo.h")
+#ifdef TARGET_HAS_MOBILE_CONNECTIVITY
 /** Get the current cellular network connection type in NetworkConnectionInfo_MobileSubtype format.
  *  @return Current cellular network connection type.
  */

+ 1 - 1
FirebasePerformance/Tests/Unit/FPRProtoUtilsTest.m

@@ -256,7 +256,7 @@
                  FPRApplicationProcessState(100));
 }
 
-#if __has_include("CoreTelephony/CTTelephonyNetworkInfo.h")
+#ifdef TARGET_HAS_MOBILE_CONNECTIVITY
 /** Validates if network object creation works. */
 - (void)testNetworkInfoObjectCreation {
   XCTAssertNotNil(FPRNetworkInfo());

+ 0 - 1
FirebaseSegmentation.podspec

@@ -19,7 +19,6 @@ Firebase Segmentation enables you to associate your custom application instance
   s.tvos.deployment_target = '10.0'
 
   s.cocoapods_version = '>= 1.4.0'
-  s.static_framework = true
   s.prefix_header_file = false
 
   s.source_files = [