Kastri icon indicating copy to clipboard operation
Kastri copied to clipboard

Third Party iOS SDKs in Kastri ( Delphi 12.2 )

Open maurobotta opened this issue 1 year ago • 3 comments

Hi @DelphiWorlds , Delphi 12.2 is out now.

"Does not support linking with library compiled with XCode 14" should to is fixed.

Link: https://delphiworlds.com/2024/02/ongoing-support-for-third-party-ios-sdks-in-kastri/

Are there any news for use Third Party iOS SDKs in Kastri ?

Mauro

maurobotta avatar Sep 18 '24 14:09 maurobotta

I'm working on it.. deciding what to do about supporting both 12.2 and earlier versions, because using the newer Firebase iOS SDK (for example) with iOS 18 SDK (at least) requires additional frameworks to be linked (and also imported via SDK Manager in Delphi). This is a proposed change to the implementation section of DW.iOSapi.FirebaseCore.pas:

implementation

uses
  // iOS
  iOSapi.StoreKit,
  // DW
  DW.iOSapi.SwiftCompat;

const
  libSystemConfiguration = '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration';

procedure CLangRTLoader; cdecl;
  {$IF not Defined(IOSSIMULATOR)}
  external '/usr/lib/clang/lib/darwin/libclang_rt.ios.a'; // Fixes linker error: ___isOSVersionAtLeast missing (iOS SDK 12.x)
  {$ELSE}
  external '/usr/lib/clang/lib/darwin/libclang_rt.iossim.a'; // Fixes linker error: ___isOSVersionAtLeast missing (iOS SDK 12.x)
  {$ENDIF}
procedure FBLPromisesLoader; cdecl; external framework 'FBLPromises';
procedure FirebaseAnalyticsLoader; cdecl; external framework 'FirebaseAnalytics';
procedure FirebaseCoreLoader; cdecl; external framework 'FirebaseCore';
procedure FirebaseCoreInternalLoader; cdecl; external framework 'FirebaseCoreInternal';
procedure FirebaseInstallationsLoader cdecl; external framework 'FirebaseInstallations';
procedure FoundationLoader; cdecl; external libFoundation;
procedure GoogleAppMeasurementLoader; cdecl; external framework 'GoogleAppMeasurement' dependency 'sqlite3';
procedure GoogleUtilitiesLoader; cdecl; external framework 'GoogleUtilities';
procedure nanoPBLoader; cdecl; external framework 'nanoPB';
procedure SystemConfigurationLoader; cdecl; external libSystemConfiguration;
procedure StoreKitLoader; cdecl; external libStoreKit;
// Proposed change:
{$IF not Defined(PREIOS18SDK)}
procedure SwiftUILoader; cdecl; external '/System/Library/Frameworks/SwiftUI.framework/SwiftUI';
{$ENDIF}

i.e., it will mean that those using Delphi 12.1 or earlier will need to add the conditional define PREIOS18SDK unless they import the additional frameworks using Delphi's SDK Manager. I could otherwise just leave out the conditional define and create a little extra work for those still using 12.1 and/or earlier iOS SDKs

DelphiWorlds avatar Sep 18 '24 21:09 DelphiWorlds

i'm using MLKitBarcodeScanning.

Thank you

maurobotta avatar Sep 19 '24 08:09 maurobotta

I updated the Barcode Scanning support a few days ago so that it should support either Firebase iOS SDK 10.8 or 11.2. Note that if you are including Firebase Cloud Messaging, you will have to use v10.8 - it's a Google limitation, unfortunately.

DelphiWorlds avatar Sep 26 '24 22:09 DelphiWorlds