From b3d30e81acef1f2ad50ba6947ac7cdcd0ccba393 Mon Sep 17 00:00:00 2001 From: ReshabCT Date: Fri, 8 May 2026 00:23:28 +0530 Subject: [PATCH 01/20] Create Package.swift file for spm support --- ios/Package.swift | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 ios/Package.swift diff --git a/ios/Package.swift b/ios/Package.swift new file mode 100644 index 0000000..c16e5f2 --- /dev/null +++ b/ios/Package.swift @@ -0,0 +1,32 @@ +// swift-tools-version: 5.9 +import PackageDescription + +let package = Package( + name: "clevertap_plugin", + platforms: [ + .iOS("12.0") + ], + products: [ + .library(name: "clevertap-plugin", targets: ["clevertap_plugin"]) + ], + dependencies: [ + .package( + url: "https://github.com/CleverTap/clevertap-ios-sdk", + from: "7.6.0" + ) + ], + targets: [ + .target( + name: "clevertap_plugin", + dependencies: [ + .product(name: "CleverTapSDK", package: "clevertap-ios-sdk") + ], + path: "Classes", + publicHeadersPath: "include", + cSettings: [ + .headerSearchPath("include"), + .headerSearchPath(".") + ] + ) + ] +) From 2a7a4158598b854d281312ccd5d4ec77541e6e74 Mon Sep 17 00:00:00 2001 From: ReshabCT Date: Fri, 8 May 2026 00:25:43 +0530 Subject: [PATCH 02/20] Create symlinks for spm --- ios/Classes/include/CleverTapPlugin.h | 1 + ios/Classes/include/CleverTapPluginAppFunctionPresenter.h | 1 + ios/Classes/include/CleverTapPluginCustomTemplates.h | 1 + ios/Classes/include/CleverTapPluginTemplatePresenter.h | 1 + 4 files changed, 4 insertions(+) create mode 120000 ios/Classes/include/CleverTapPlugin.h create mode 120000 ios/Classes/include/CleverTapPluginAppFunctionPresenter.h create mode 120000 ios/Classes/include/CleverTapPluginCustomTemplates.h create mode 120000 ios/Classes/include/CleverTapPluginTemplatePresenter.h diff --git a/ios/Classes/include/CleverTapPlugin.h b/ios/Classes/include/CleverTapPlugin.h new file mode 120000 index 0000000..66b90f0 --- /dev/null +++ b/ios/Classes/include/CleverTapPlugin.h @@ -0,0 +1 @@ +../CleverTapPlugin.h \ No newline at end of file diff --git a/ios/Classes/include/CleverTapPluginAppFunctionPresenter.h b/ios/Classes/include/CleverTapPluginAppFunctionPresenter.h new file mode 120000 index 0000000..9b84638 --- /dev/null +++ b/ios/Classes/include/CleverTapPluginAppFunctionPresenter.h @@ -0,0 +1 @@ +../CleverTapPluginAppFunctionPresenter.h \ No newline at end of file diff --git a/ios/Classes/include/CleverTapPluginCustomTemplates.h b/ios/Classes/include/CleverTapPluginCustomTemplates.h new file mode 120000 index 0000000..367fdec --- /dev/null +++ b/ios/Classes/include/CleverTapPluginCustomTemplates.h @@ -0,0 +1 @@ +../CleverTapPluginCustomTemplates.h \ No newline at end of file diff --git a/ios/Classes/include/CleverTapPluginTemplatePresenter.h b/ios/Classes/include/CleverTapPluginTemplatePresenter.h new file mode 120000 index 0000000..aff2c7c --- /dev/null +++ b/ios/Classes/include/CleverTapPluginTemplatePresenter.h @@ -0,0 +1 @@ +../CleverTapPluginTemplatePresenter.h \ No newline at end of file From 5d96862bb1adea8fe6a10e41634b91f3a32ae9d2 Mon Sep 17 00:00:00 2001 From: ReshabCT Date: Fri, 8 May 2026 00:28:36 +0530 Subject: [PATCH 03/20] Add guard to obj c imports in ClevertapPlugin.m --- ios/Classes/CleverTapPlugin.m | 80 +++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/ios/Classes/CleverTapPlugin.m b/ios/Classes/CleverTapPlugin.m index 27bb390..7931576 100644 --- a/ios/Classes/CleverTapPlugin.m +++ b/ios/Classes/CleverTapPlugin.m @@ -1,21 +1,101 @@ +#if __has_include() +#import +#else #import "CleverTap.h" +#endif + #import "CleverTapPlugin.h" + +#if __has_include() +#import +#else #import "CleverTap+Inbox.h" +#endif + +#if __has_include() +#import +#else #import "CleverTapUTMDetail.h" +#endif + +#if __has_include() +#import +#else #import "CleverTapEventDetail.h" +#endif + +#if __has_include() +#import +#else #import "CleverTapSyncDelegate.h" +#endif + +#if __has_include() +#import +#else #import "CleverTap+DisplayUnit.h" +#endif + +#if __has_include() +#import +#else #import "CleverTap+FeatureFlags.h" +#endif + +#if __has_include() +#import +#else #import "CleverTap+ProductConfig.h" +#endif + +#if __has_include() +#import +#else #import "CleverTapPushNotificationDelegate.h" +#endif + +#if __has_include() +#import +#else #import "CleverTapInAppNotificationDelegate.h" +#endif + +#if __has_include() +#import +#else #import "CleverTap+InAppNotifications.h" +#endif + +#if __has_include() +#import +#else #import "CleverTap+PushPermission.h" +#endif + +#if __has_include() +#import +#else #import "CTLocalInApp.h" +#endif + +#if __has_include() +#import +#else #import "CleverTap+CTVar.h" +#endif + +#if __has_include() +#import +#else #import "CTVar.h" +#endif + +#if __has_include() +#import +#else #import "CTTemplateContext.h" +#endif @interface CleverTapPlugin () From 203c1e356789f4ed7e3a6362f7dddc7fa3889f3f Mon Sep 17 00:00:00 2001 From: ReshabCT Date: Fri, 8 May 2026 00:30:20 +0530 Subject: [PATCH 04/20] wrapped both CTJsonTemplateProducer.h and CTCustomTemplatesManager.h imports with guards --- ios/Classes/CleverTapPluginCustomTemplates.m | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ios/Classes/CleverTapPluginCustomTemplates.m b/ios/Classes/CleverTapPluginCustomTemplates.m index d5eaae4..da35cdd 100644 --- a/ios/Classes/CleverTapPluginCustomTemplates.m +++ b/ios/Classes/CleverTapPluginCustomTemplates.m @@ -9,8 +9,18 @@ #import "CleverTapPluginCustomTemplates.h" #import "CleverTapPluginTemplatePresenter.h" #import "CleverTapPluginAppFunctionPresenter.h" + +#if __has_include() +#import +#else #import "CTJsonTemplateProducer.h" +#endif + +#if __has_include() +#import +#else #import "CTCustomTemplatesManager.h" +#endif @implementation CleverTapPluginCustomTemplates From b91d17603baab04358e35c2b022a01e6f1d46597 Mon Sep 17 00:00:00 2001 From: ReshabCT Date: Fri, 8 May 2026 00:33:49 +0530 Subject: [PATCH 05/20] Narrowed header files in podspec --- ios/clevertap_plugin.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/clevertap_plugin.podspec b/ios/clevertap_plugin.podspec index e56e912..513fc75 100644 --- a/ios/clevertap_plugin.podspec +++ b/ios/clevertap_plugin.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.author = { "CleverTap" => "http://www.clevertap.com" } s.source = { :path => '.' } s.source_files = 'Classes/**/*' - s.public_header_files = 'Classes/**/*.h' + s.public_header_files = 'Classes/*.h' s.dependency 'Flutter' s.dependency 'CleverTap-iOS-SDK', '7.6.0' s.ios.deployment_target = '9.0' From c0b7ecfd3c98039329d5d74c426a5cdab5833d96 Mon Sep 17 00:00:00 2001 From: ReshabCT Date: Fri, 8 May 2026 15:39:28 +0530 Subject: [PATCH 06/20] Relocate Package.swift to ios/clevertap_plugin/ for Flutter SPM detection with a Classes symlink --- ios/clevertap_plugin.podspec | 1 + ios/clevertap_plugin/Classes | 1 + ios/{ => clevertap_plugin}/Package.swift | 0 3 files changed, 2 insertions(+) create mode 120000 ios/clevertap_plugin/Classes rename ios/{ => clevertap_plugin}/Package.swift (100%) diff --git a/ios/clevertap_plugin.podspec b/ios/clevertap_plugin.podspec index 513fc75..f4887cb 100644 --- a/ios/clevertap_plugin.podspec +++ b/ios/clevertap_plugin.podspec @@ -11,6 +11,7 @@ Pod::Spec.new do |s| s.author = { "CleverTap" => "http://www.clevertap.com" } s.source = { :path => '.' } s.source_files = 'Classes/**/*' + s.exclude_files = 'Classes/include/**/*' s.public_header_files = 'Classes/*.h' s.dependency 'Flutter' s.dependency 'CleverTap-iOS-SDK', '7.6.0' diff --git a/ios/clevertap_plugin/Classes b/ios/clevertap_plugin/Classes new file mode 120000 index 0000000..3578bf8 --- /dev/null +++ b/ios/clevertap_plugin/Classes @@ -0,0 +1 @@ +../Classes \ No newline at end of file diff --git a/ios/Package.swift b/ios/clevertap_plugin/Package.swift similarity index 100% rename from ios/Package.swift rename to ios/clevertap_plugin/Package.swift From dfd2cf93b21abcfcc7942e176a8c3866398a6b3a Mon Sep 17 00:00:00 2001 From: ReshabCT Date: Tue, 19 May 2026 17:55:46 +0530 Subject: [PATCH 07/20] Add swift package name under ios in pubspec.yaml, added guards for the clevertap.h and clevertapPlugin.h in AppDelegate, remove locale parameter from StyledToast causing build failure --- example/ios/Runner/AppDelegate.m | 9 +++++++++ example/lib/main.dart | 1 - pubspec.yaml | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/example/ios/Runner/AppDelegate.m b/example/ios/Runner/AppDelegate.m index d76db9f..f9b28f8 100644 --- a/example/ios/Runner/AppDelegate.m +++ b/example/ios/Runner/AppDelegate.m @@ -2,9 +2,18 @@ #import "GeneratedPluginRegistrant.h" #import +#if __has_include() +#import +#else #import "CleverTap.h" +#endif +#if __has_include() +#import +#import +#else #import "CleverTapPlugin.h" #import "CleverTapPluginCustomTemplates.h" +#endif @implementation AppDelegate diff --git a/example/lib/main.dart b/example/lib/main.dart index 59daeec..cd138f1 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -563,7 +563,6 @@ class _MyAppState extends State { @override Widget build(BuildContext context) { return StyledToast( - locale: const Locale('en', 'US'), child: MaterialApp( home: Scaffold( appBar: AppBar( diff --git a/pubspec.yaml b/pubspec.yaml index 1e3a71a..fa5a6ac 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -28,6 +28,7 @@ flutter: pluginClass: CleverTapPlugin ios: pluginClass: CleverTapPlugin + swiftPackageName: clevertap_plugin web: pluginClass: CleverTapPluginWeb fileName: clevertap_plugin_web.dart From 52d2d8e982f9ddfdddcf9c34a5dd9704a9247ea1 Mon Sep 17 00:00:00 2001 From: ReshabCT Date: Tue, 23 Jun 2026 12:32:06 +0530 Subject: [PATCH 08/20] Fix Package.swift to use same version as podspec to ensure no drift --- ios/clevertap_plugin/Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/clevertap_plugin/Package.swift b/ios/clevertap_plugin/Package.swift index c16e5f2..2b17758 100644 --- a/ios/clevertap_plugin/Package.swift +++ b/ios/clevertap_plugin/Package.swift @@ -12,7 +12,7 @@ let package = Package( dependencies: [ .package( url: "https://github.com/CleverTap/clevertap-ios-sdk", - from: "7.6.0" + exact: "7.6.0" ) ], targets: [ From a7c16eea8a1045b279c355517bebb87975fab042 Mon Sep 17 00:00:00 2001 From: ReshabCT Date: Tue, 23 Jun 2026 17:15:43 +0530 Subject: [PATCH 09/20] Restructure folders and files as per the official flutter docs --- ios/.gitignore | 4 +++- ios/Classes/include/CleverTapPlugin.h | 1 - ios/Classes/include/CleverTapPluginAppFunctionPresenter.h | 1 - ios/Classes/include/CleverTapPluginCustomTemplates.h | 1 - ios/Classes/include/CleverTapPluginTemplatePresenter.h | 1 - ios/clevertap_plugin.podspec | 7 +++---- ios/clevertap_plugin/Classes | 1 - ios/clevertap_plugin/Package.swift | 8 +++----- .../Sources/clevertap_plugin}/CleverTapPlugin.m | 0 .../CleverTapPluginAppFunctionPresenter.m | 0 .../clevertap_plugin}/CleverTapPluginCustomTemplates.m | 0 .../clevertap_plugin}/CleverTapPluginTemplatePresenter.m | 0 .../include/clevertap_plugin}/CleverTapPlugin.h | 0 .../CleverTapPluginAppFunctionPresenter.h | 0 .../clevertap_plugin}/CleverTapPluginCustomTemplates.h | 0 .../clevertap_plugin}/CleverTapPluginTemplatePresenter.h | 0 pubspec.yaml | 2 +- 17 files changed, 10 insertions(+), 16 deletions(-) delete mode 120000 ios/Classes/include/CleverTapPlugin.h delete mode 120000 ios/Classes/include/CleverTapPluginAppFunctionPresenter.h delete mode 120000 ios/Classes/include/CleverTapPluginCustomTemplates.h delete mode 120000 ios/Classes/include/CleverTapPluginTemplatePresenter.h delete mode 120000 ios/clevertap_plugin/Classes rename ios/{Classes => clevertap_plugin/Sources/clevertap_plugin}/CleverTapPlugin.m (100%) rename ios/{Classes => clevertap_plugin/Sources/clevertap_plugin}/CleverTapPluginAppFunctionPresenter.m (100%) rename ios/{Classes => clevertap_plugin/Sources/clevertap_plugin}/CleverTapPluginCustomTemplates.m (100%) rename ios/{Classes => clevertap_plugin/Sources/clevertap_plugin}/CleverTapPluginTemplatePresenter.m (100%) rename ios/{Classes => clevertap_plugin/Sources/clevertap_plugin/include/clevertap_plugin}/CleverTapPlugin.h (100%) rename ios/{Classes => clevertap_plugin/Sources/clevertap_plugin/include/clevertap_plugin}/CleverTapPluginAppFunctionPresenter.h (100%) rename ios/{Classes => clevertap_plugin/Sources/clevertap_plugin/include/clevertap_plugin}/CleverTapPluginCustomTemplates.h (100%) rename ios/{Classes => clevertap_plugin/Sources/clevertap_plugin/include/clevertap_plugin}/CleverTapPluginTemplatePresenter.h (100%) diff --git a/ios/.gitignore b/ios/.gitignore index aa479fd..fe343d5 100644 --- a/ios/.gitignore +++ b/ios/.gitignore @@ -34,4 +34,6 @@ Icon? .tags* /Flutter/Generated.xcconfig -/Flutter/flutter_export_environment.sh \ No newline at end of file +/Flutter/flutter_export_environment.sh + +.swiftpm/ \ No newline at end of file diff --git a/ios/Classes/include/CleverTapPlugin.h b/ios/Classes/include/CleverTapPlugin.h deleted file mode 120000 index 66b90f0..0000000 --- a/ios/Classes/include/CleverTapPlugin.h +++ /dev/null @@ -1 +0,0 @@ -../CleverTapPlugin.h \ No newline at end of file diff --git a/ios/Classes/include/CleverTapPluginAppFunctionPresenter.h b/ios/Classes/include/CleverTapPluginAppFunctionPresenter.h deleted file mode 120000 index 9b84638..0000000 --- a/ios/Classes/include/CleverTapPluginAppFunctionPresenter.h +++ /dev/null @@ -1 +0,0 @@ -../CleverTapPluginAppFunctionPresenter.h \ No newline at end of file diff --git a/ios/Classes/include/CleverTapPluginCustomTemplates.h b/ios/Classes/include/CleverTapPluginCustomTemplates.h deleted file mode 120000 index 367fdec..0000000 --- a/ios/Classes/include/CleverTapPluginCustomTemplates.h +++ /dev/null @@ -1 +0,0 @@ -../CleverTapPluginCustomTemplates.h \ No newline at end of file diff --git a/ios/Classes/include/CleverTapPluginTemplatePresenter.h b/ios/Classes/include/CleverTapPluginTemplatePresenter.h deleted file mode 120000 index aff2c7c..0000000 --- a/ios/Classes/include/CleverTapPluginTemplatePresenter.h +++ /dev/null @@ -1 +0,0 @@ -../CleverTapPluginTemplatePresenter.h \ No newline at end of file diff --git a/ios/clevertap_plugin.podspec b/ios/clevertap_plugin.podspec index f4887cb..858a0fc 100644 --- a/ios/clevertap_plugin.podspec +++ b/ios/clevertap_plugin.podspec @@ -10,11 +10,10 @@ Pod::Spec.new do |s| s.license = { :file => '../LICENSE' } s.author = { "CleverTap" => "http://www.clevertap.com" } s.source = { :path => '.' } - s.source_files = 'Classes/**/*' - s.exclude_files = 'Classes/include/**/*' - s.public_header_files = 'Classes/*.h' + s.source_files = 'clevertap_plugin/Sources/clevertap_plugin/**/*.{h,m}' + s.public_header_files = 'clevertap_plugin/Sources/clevertap_plugin/include/clevertap_plugin/*.h' s.dependency 'Flutter' s.dependency 'CleverTap-iOS-SDK', '7.6.0' - s.ios.deployment_target = '9.0' + s.ios.deployment_target = '13.0' end diff --git a/ios/clevertap_plugin/Classes b/ios/clevertap_plugin/Classes deleted file mode 120000 index 3578bf8..0000000 --- a/ios/clevertap_plugin/Classes +++ /dev/null @@ -1 +0,0 @@ -../Classes \ No newline at end of file diff --git a/ios/clevertap_plugin/Package.swift b/ios/clevertap_plugin/Package.swift index 2b17758..476d9e1 100644 --- a/ios/clevertap_plugin/Package.swift +++ b/ios/clevertap_plugin/Package.swift @@ -4,7 +4,7 @@ import PackageDescription let package = Package( name: "clevertap_plugin", platforms: [ - .iOS("12.0") + .iOS("13.0") ], products: [ .library(name: "clevertap-plugin", targets: ["clevertap_plugin"]) @@ -21,11 +21,9 @@ let package = Package( dependencies: [ .product(name: "CleverTapSDK", package: "clevertap-ios-sdk") ], - path: "Classes", - publicHeadersPath: "include", + publicHeadersPath: "include/clevertap_plugin", cSettings: [ - .headerSearchPath("include"), - .headerSearchPath(".") + .headerSearchPath("include/clevertap_plugin") ] ) ] diff --git a/ios/Classes/CleverTapPlugin.m b/ios/clevertap_plugin/Sources/clevertap_plugin/CleverTapPlugin.m similarity index 100% rename from ios/Classes/CleverTapPlugin.m rename to ios/clevertap_plugin/Sources/clevertap_plugin/CleverTapPlugin.m diff --git a/ios/Classes/CleverTapPluginAppFunctionPresenter.m b/ios/clevertap_plugin/Sources/clevertap_plugin/CleverTapPluginAppFunctionPresenter.m similarity index 100% rename from ios/Classes/CleverTapPluginAppFunctionPresenter.m rename to ios/clevertap_plugin/Sources/clevertap_plugin/CleverTapPluginAppFunctionPresenter.m diff --git a/ios/Classes/CleverTapPluginCustomTemplates.m b/ios/clevertap_plugin/Sources/clevertap_plugin/CleverTapPluginCustomTemplates.m similarity index 100% rename from ios/Classes/CleverTapPluginCustomTemplates.m rename to ios/clevertap_plugin/Sources/clevertap_plugin/CleverTapPluginCustomTemplates.m diff --git a/ios/Classes/CleverTapPluginTemplatePresenter.m b/ios/clevertap_plugin/Sources/clevertap_plugin/CleverTapPluginTemplatePresenter.m similarity index 100% rename from ios/Classes/CleverTapPluginTemplatePresenter.m rename to ios/clevertap_plugin/Sources/clevertap_plugin/CleverTapPluginTemplatePresenter.m diff --git a/ios/Classes/CleverTapPlugin.h b/ios/clevertap_plugin/Sources/clevertap_plugin/include/clevertap_plugin/CleverTapPlugin.h similarity index 100% rename from ios/Classes/CleverTapPlugin.h rename to ios/clevertap_plugin/Sources/clevertap_plugin/include/clevertap_plugin/CleverTapPlugin.h diff --git a/ios/Classes/CleverTapPluginAppFunctionPresenter.h b/ios/clevertap_plugin/Sources/clevertap_plugin/include/clevertap_plugin/CleverTapPluginAppFunctionPresenter.h similarity index 100% rename from ios/Classes/CleverTapPluginAppFunctionPresenter.h rename to ios/clevertap_plugin/Sources/clevertap_plugin/include/clevertap_plugin/CleverTapPluginAppFunctionPresenter.h diff --git a/ios/Classes/CleverTapPluginCustomTemplates.h b/ios/clevertap_plugin/Sources/clevertap_plugin/include/clevertap_plugin/CleverTapPluginCustomTemplates.h similarity index 100% rename from ios/Classes/CleverTapPluginCustomTemplates.h rename to ios/clevertap_plugin/Sources/clevertap_plugin/include/clevertap_plugin/CleverTapPluginCustomTemplates.h diff --git a/ios/Classes/CleverTapPluginTemplatePresenter.h b/ios/clevertap_plugin/Sources/clevertap_plugin/include/clevertap_plugin/CleverTapPluginTemplatePresenter.h similarity index 100% rename from ios/Classes/CleverTapPluginTemplatePresenter.h rename to ios/clevertap_plugin/Sources/clevertap_plugin/include/clevertap_plugin/CleverTapPluginTemplatePresenter.h diff --git a/pubspec.yaml b/pubspec.yaml index fa5a6ac..50fe6b5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -5,7 +5,7 @@ homepage: https://github.com/CleverTap/clevertap-flutter environment: sdk: '>=2.12.0 <4.0.0' - flutter: ">=1.17.0" + flutter: ">=3.41.0" dependencies: flutter: From 9e9fdf6ff971839309a5cf772b2e8604add8f1b3 Mon Sep 17 00:00:00 2001 From: ReshabCT Date: Thu, 25 Jun 2026 13:24:21 +0530 Subject: [PATCH 10/20] Fix version in package.swift to match podspec for correct version resolution for sdk --- ios/clevertap_plugin/Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/clevertap_plugin/Package.swift b/ios/clevertap_plugin/Package.swift index 476d9e1..46a36e2 100644 --- a/ios/clevertap_plugin/Package.swift +++ b/ios/clevertap_plugin/Package.swift @@ -12,7 +12,7 @@ let package = Package( dependencies: [ .package( url: "https://github.com/CleverTap/clevertap-ios-sdk", - exact: "7.6.0" + exact: "7.7.1" ) ], targets: [ From 74ecaa996346db38da9590902b1a5e333be12493 Mon Sep 17 00:00:00 2001 From: ReshabCT Date: Thu, 25 Jun 2026 14:53:26 +0530 Subject: [PATCH 11/20] Add spm integration doc for flutter --- doc/Integrate-iOS-SPM.md | 104 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 doc/Integrate-iOS-SPM.md diff --git a/doc/Integrate-iOS-SPM.md b/doc/Integrate-iOS-SPM.md new file mode 100644 index 0000000..731b144 --- /dev/null +++ b/doc/Integrate-iOS-SPM.md @@ -0,0 +1,104 @@ +## πŸ“¦ iOS Integration via Swift Package Manager (SPM) + +Starting from Flutter 3.27, Flutter supports resolving plugin dependencies via Swift Package Manager in addition to CocoaPods. The CleverTap Flutter plugin ships a `Package.swift` alongside its podspec, so both package managers resolve the same native SDK version (`CleverTap-iOS-SDK 7.7.1`). + +> **Minimum requirements** +> - Flutter 3.27+ +> - Xcode 15+ +> - iOS deployment target: 13.0+ + +--- + +### How it works + +Flutter's SPM support detects plugins that declare a `swiftPackageName` in their `pubspec.yaml`. The CleverTap plugin sets: + +```yaml +# pubspec.yaml (inside the plugin) +ios: + pluginClass: CleverTapPlugin + swiftPackageName: clevertap_plugin +``` + +Flutter then looks for a `Package.swift` under `ios//` (`ios/clevertap_plugin/Package.swift`). That manifest pins the CleverTap iOS SDK: + +```swift +.package( + url: "https://github.com/CleverTap/clevertap-ios-sdk", + exact: "7.7.1" +) +``` + +When your app is built, Flutter resolves this package automatically β€” no manual entry in `Package.swift` of your app is required. + +--- + +### Enabling SPM in your Flutter app + +SPM support in Flutter is opt-in. Enable it by setting the `FLTEnableSwiftPackageManagerIntegration` flag in your iOS app's `Info.plist`: + +```xml +FLTEnableSwiftPackageManagerIntegration + +``` + +Or via the Flutter CLI environment variable when running or building: + +```bash +flutter run --enable-swift-package-manager +flutter build ios --enable-swift-package-manager +``` + +After enabling, run `flutter pub get` and then open your `.xcworkspace` in Xcode. Xcode will resolve the CleverTap iOS SDK via SPM automatically. + +--- + +### AppDelegate changes when using SPM + +When Flutter resolves the plugin via SPM, the module name changes. Use conditional imports in your `AppDelegate` to support both CocoaPods and SPM builds: + +###### Objective-C + +```objc +#if __has_include() +#import +#else +#import "CleverTap.h" +#endif + +#if __has_include() +#import +#else +#import "CleverTapPlugin.h" +#endif +``` + +###### Swift + +```swift +import CleverTapSDK +import clevertap_plugin +``` + +These guards ensure your app compiles correctly regardless of which package manager resolved the dependency. + +--- + +### CocoaPods vs SPM + +| | CocoaPods | SPM | +|---|---|---| +| Config file | `ios/clevertap_plugin.podspec` | `ios/clevertap_plugin/Package.swift` | +| SDK version pinned | `7.7.1` | `7.7.1` | +| Deployment target | `13.0` | `13.0` | +| Opt-in required | No (default) | Yes (see above) | + +Both package managers resolve the same CleverTap iOS SDK version to ensure no drift between the two integration paths. + +--- + +### Troubleshooting + +- **Xcode doesn't resolve the package**: Run `flutter pub get`, then in Xcode go to **File β†’ Packages β†’ Resolve Package Versions**. +- **Duplicate symbol errors**: Ensure you are not using both CocoaPods and SPM for the same plugin simultaneously. If you have a `Podfile` and SPM enabled, Flutter will prefer SPM for plugins that support it. +- **Build fails with missing headers**: Verify your deployment target is set to `13.0` or higher in both your Xcode project and `Podfile`/`Package.swift`. From c22b0dc1baf3374c642711cc20123b25390dec08 Mon Sep 17 00:00:00 2001 From: ReshabCT Date: Tue, 30 Jun 2026 21:30:56 +0530 Subject: [PATCH 12/20] Fix flutter version in pubspec to 1.1.7 and enable spm for supported version --- doc/Integrate-iOS-SPM.md | 4 +++- pubspec.yaml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/Integrate-iOS-SPM.md b/doc/Integrate-iOS-SPM.md index 731b144..448c3d4 100644 --- a/doc/Integrate-iOS-SPM.md +++ b/doc/Integrate-iOS-SPM.md @@ -2,10 +2,12 @@ Starting from Flutter 3.27, Flutter supports resolving plugin dependencies via Swift Package Manager in addition to CocoaPods. The CleverTap Flutter plugin ships a `Package.swift` alongside its podspec, so both package managers resolve the same native SDK version (`CleverTap-iOS-SDK 7.7.1`). -> **Minimum requirements** +> **Minimum requirements for SPM integration** > - Flutter 3.27+ > - Xcode 15+ > - iOS deployment target: 13.0+ +> +> If you are on Flutter < 3.27, the plugin continues to work via CocoaPods β€” no action required. --- diff --git a/pubspec.yaml b/pubspec.yaml index f5c4a58..a3cb56a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -5,7 +5,7 @@ homepage: https://github.com/CleverTap/clevertap-flutter environment: sdk: '>=2.12.0 <4.0.0' - flutter: ">=3.41.0" + flutter: ">=1.17.0" dependencies: flutter: From 8230f92af774cfa7cecdf75db74d8ca43e2da370 Mon Sep 17 00:00:00 2001 From: Akash Malhotra Date: Tue, 4 Aug 2026 15:42:19 +0530 Subject: [PATCH 13/20] correct and trim the ios spm integration doc, fixing the enabling steps and adding migration and troubleshooting guidance. --- doc/Integrate-iOS-SPM.md | 80 ++++++++++++++++++++++++---------------- 1 file changed, 49 insertions(+), 31 deletions(-) diff --git a/doc/Integrate-iOS-SPM.md b/doc/Integrate-iOS-SPM.md index 448c3d4..ea34154 100644 --- a/doc/Integrate-iOS-SPM.md +++ b/doc/Integrate-iOS-SPM.md @@ -1,57 +1,74 @@ ## πŸ“¦ iOS Integration via Swift Package Manager (SPM) -Starting from Flutter 3.27, Flutter supports resolving plugin dependencies via Swift Package Manager in addition to CocoaPods. The CleverTap Flutter plugin ships a `Package.swift` alongside its podspec, so both package managers resolve the same native SDK version (`CleverTap-iOS-SDK 7.7.1`). +Flutter introduced Swift Package Manager support as an **opt-in** feature in Flutter 3.24, and it became the **default** package manager in Flutter 3.44. The CleverTap Flutter plugin ships a `Package.swift` alongside its podspec, so both package managers resolve the same native SDK version (`CleverTap-iOS-SDK 7.7.1`). > **Minimum requirements for SPM integration** -> - Flutter 3.27+ -> - Xcode 15+ +> - Flutter 3.24+ (opt-in) - enabled by default from Flutter 3.44 +> - Xcode 15+ (required for `swift-tools-version: 5.9`) > - iOS deployment target: 13.0+ > -> If you are on Flutter < 3.27, the plugin continues to work via CocoaPods β€” no action required. +> If you are on Flutter < 3.24, the plugin continues to work via CocoaPods - no action required. --- ### How it works -Flutter's SPM support detects plugins that declare a `swiftPackageName` in their `pubspec.yaml`. The CleverTap plugin sets: +The plugin ships a Swift package that pins `CleverTap-iOS-SDK 7.7.1`. When your app is built with SPM enabled, Flutter resolves it automatically - you don't add anything to your app's own `Package.swift` or edit any plugin files. + +--- + +### Enabling SPM in your Flutter app + +SPM is opt-in on Flutter 3.24–3.43 (and on by default from 3.44). There is **no** `flutter run`/`flutter build` flag and **no** `Info.plist` key for this - you enable it through Flutter configuration. + +**Per project (recommended for testing)** - add to your app's `pubspec.yaml`: ```yaml -# pubspec.yaml (inside the plugin) -ios: - pluginClass: CleverTapPlugin - swiftPackageName: clevertap_plugin +flutter: + config: + enable-swift-package-manager: true ``` -Flutter then looks for a `Package.swift` under `ios//` (`ios/clevertap_plugin/Package.swift`). That manifest pins the CleverTap iOS SDK: +**Globally for your machine:** -```swift -.package( - url: "https://github.com/CleverTap/clevertap-ios-sdk", - exact: "7.7.1" -) +```bash +flutter config --enable-swift-package-manager ``` -When your app is built, Flutter resolves this package automatically β€” no manual entry in `Package.swift` of your app is required. +To turn it back off, use `enable-swift-package-manager: false` in `pubspec.yaml`, or `flutter config --no-enable-swift-package-manager` globally. --- -### Enabling SPM in your Flutter app +### Migrating an existing CocoaPods app to SPM + +Once SPM is enabled, Flutter migrates the Xcode project automatically the next time you build or run. To migrate cleanly on an app that already uses CocoaPods: + +**1. Enable SPM** (per-project block above, or global flag). -SPM support in Flutter is opt-in. Enable it by setting the `FLTEnableSwiftPackageManagerIntegration` flag in your iOS app's `Info.plist`: +**2. Clear the existing CocoaPods state** (run from your app root): -```xml -FLTEnableSwiftPackageManagerIntegration - +```bash +flutter clean +cd ios +rm -rf Pods Podfile.lock .symlinks build +rm -rf ~/Library/Developer/Xcode/DerivedData/Runner-* +cd .. ``` -Or via the Flutter CLI environment variable when running or building: +**3. Re-resolve and trigger the migration:** ```bash -flutter run --enable-swift-package-manager -flutter build ios --enable-swift-package-manager +flutter pub get +flutter build ios --config-only # or: flutter run ``` -After enabling, run `flutter pub get` and then open your `.xcworkspace` in Xcode. Xcode will resolve the CleverTap iOS SDK via SPM automatically. +On this build Flutter adds a `FlutterGeneratedPluginSwiftPackage` to the Xcode project and resolves every plugin that ships a `Package.swift` (including `clevertap_plugin`) via SPM. Plugins that only ship a podspec stay on CocoaPods - a hybrid setup is expected. + +**4. Verify SPM took over.** Open `ios/Runner.xcworkspace` and confirm: +- **Package Dependencies** lists `clevertap_plugin` and, transitively, `clevertap-ios-sdk` at `7.7.1`. +- The regenerated `Podfile.lock` no longer contains a `clevertap_plugin` pod entry. + +**5. Build and run** on a simulator/device and smoke-test CleverTap initialization plus a `recordEvent` to confirm native symbols link. --- @@ -59,7 +76,7 @@ After enabling, run `flutter pub get` and then open your `.xcworkspace` in Xcode When Flutter resolves the plugin via SPM, the module name changes. Use conditional imports in your `AppDelegate` to support both CocoaPods and SPM builds: -###### Objective-C +**Objective-C** ```objc #if __has_include() @@ -75,7 +92,7 @@ When Flutter resolves the plugin via SPM, the module name changes. Use condition #endif ``` -###### Swift +**Swift** ```swift import CleverTapSDK @@ -90,10 +107,9 @@ These guards ensure your app compiles correctly regardless of which package mana | | CocoaPods | SPM | |---|---|---| -| Config file | `ios/clevertap_plugin.podspec` | `ios/clevertap_plugin/Package.swift` | | SDK version pinned | `7.7.1` | `7.7.1` | | Deployment target | `13.0` | `13.0` | -| Opt-in required | No (default) | Yes (see above) | +| Opt-in required | No | Yes on Flutter 3.24–3.43; default from 3.44 | Both package managers resolve the same CleverTap iOS SDK version to ensure no drift between the two integration paths. @@ -102,5 +118,7 @@ Both package managers resolve the same CleverTap iOS SDK version to ensure no dr ### Troubleshooting - **Xcode doesn't resolve the package**: Run `flutter pub get`, then in Xcode go to **File β†’ Packages β†’ Resolve Package Versions**. -- **Duplicate symbol errors**: Ensure you are not using both CocoaPods and SPM for the same plugin simultaneously. If you have a `Podfile` and SPM enabled, Flutter will prefer SPM for plugins that support it. -- **Build fails with missing headers**: Verify your deployment target is set to `13.0` or higher in both your Xcode project and `Podfile`/`Package.swift`. +- **Automatic migration didn't add the package**: In Xcode, add it manually - **Package Dependencies β†’ Add Local…** β†’ select `ios/Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage` and add it to the `Runner` target. Then under **Product β†’ Scheme β†’ Edit Scheme β†’ Build β†’ Pre-actions**, add a Run Script (with build settings from `Runner`): `"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" prepare`. +- **Duplicate symbol errors**: Don't use both CocoaPods and SPM for the same plugin at once. If a `Podfile` exists and SPM is enabled, Flutter prefers SPM for plugins that support it. +- **Build fails with missing headers**: Verify your deployment target is `13.0` or higher in both your Xcode project and `Podfile`/`Package.swift`. +- **Stale CocoaPods references after migrating**: If the build still runs `[CP]` Pods build phases (or duplicate-embeds a framework) for a plugin that has moved to SPM, run `pod deintegrate` in your app's `ios/` directory, then `flutter clean && flutter build ios` so Flutter re-integrates cleanly. Use this only as a recovery step - it is not part of the normal migration flow. Flutter regenerates the CocoaPods integration on every build, so a manual `pod deintegrate` is otherwise undone on the next build. From 8922ed18ed83436b4a4eb62fa3635ccc1a0c770c Mon Sep 17 00:00:00 2001 From: Akash Malhotra Date: Tue, 4 Aug 2026 15:48:07 +0530 Subject: [PATCH 14/20] ignore flutter ephemeral, local claude settings, and generated sdk review reports. --- .gitignore | 6 ++++++ example/ios/.gitignore | 1 + 2 files changed, 7 insertions(+) diff --git a/.gitignore b/.gitignore index 93ace23..1e2d775 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,9 @@ example/pubspec.lock pubspec.lock example/android/app/property* +# Local Claude Code settings +.claude/settings.local.json + +# Generated SDK review reports +sdk-review-*.html + diff --git a/example/ios/.gitignore b/example/ios/.gitignore index e96ef60..61fa3c4 100644 --- a/example/ios/.gitignore +++ b/example/ios/.gitignore @@ -22,6 +22,7 @@ Flutter/app.flx Flutter/app.zip Flutter/flutter_assets/ Flutter/flutter_export_environment.sh +Flutter/ephemeral/ ServiceDefinitions.json Runner/GeneratedPluginRegistrant.* From 7fa5ea48ee6384651236bce7224c6002aace7385 Mon Sep 17 00:00:00 2001 From: ReshabCT Date: Sat, 15 Aug 2026 06:46:19 +0530 Subject: [PATCH 15/20] Fix pr comments and add flutter framework dependency for swift pm route as per docs, adds spm builds to gitignore --- .gitignore | 4 ++++ ios/Assets/.gitkeep | 0 ios/clevertap_plugin.podspec | 2 +- ios/clevertap_plugin/Package.swift | 4 +++- 4 files changed, 8 insertions(+), 2 deletions(-) delete mode 100644 ios/Assets/.gitkeep diff --git a/.gitignore b/.gitignore index 1e2d775..720555f 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,7 @@ example/android/app/property* # Generated SDK review reports sdk-review-*.html +# SPM build artifacts +.build/ +.swiftpm/ + diff --git a/ios/Assets/.gitkeep b/ios/Assets/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/ios/clevertap_plugin.podspec b/ios/clevertap_plugin.podspec index 63368ab..85dd589 100644 --- a/ios/clevertap_plugin.podspec +++ b/ios/clevertap_plugin.podspec @@ -14,6 +14,6 @@ Pod::Spec.new do |s| s.public_header_files = 'clevertap_plugin/Sources/clevertap_plugin/include/clevertap_plugin/*.h' s.dependency 'Flutter' s.dependency 'CleverTap-iOS-SDK', '7.7.1' - s.ios.deployment_target = '13.0' + s.ios.deployment_target = '9.0' end diff --git a/ios/clevertap_plugin/Package.swift b/ios/clevertap_plugin/Package.swift index 46a36e2..800f4dd 100644 --- a/ios/clevertap_plugin/Package.swift +++ b/ios/clevertap_plugin/Package.swift @@ -10,15 +10,17 @@ let package = Package( .library(name: "clevertap-plugin", targets: ["clevertap_plugin"]) ], dependencies: [ + .package(name: "FlutterFramework", path: "../FlutterFramework"), .package( url: "https://github.com/CleverTap/clevertap-ios-sdk", - exact: "7.7.1" + exact: "7.8.1" ) ], targets: [ .target( name: "clevertap_plugin", dependencies: [ + .product(name: "FlutterFramework", package: "FlutterFramework"), .product(name: "CleverTapSDK", package: "clevertap-ios-sdk") ], publicHeadersPath: "include/clevertap_plugin", From 25a953a21a74852792b37a8e64d8a68d4ecf9f2b Mon Sep 17 00:00:00 2001 From: ReshabCT Date: Thu, 20 Aug 2026 20:56:35 +0530 Subject: [PATCH 16/20] update integration doc for ct plugin v4.2.0 and core ios sdk verison 7.8.1 --- doc/Integrate-iOS-SPM.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/Integrate-iOS-SPM.md b/doc/Integrate-iOS-SPM.md index ea34154..7c3b1d0 100644 --- a/doc/Integrate-iOS-SPM.md +++ b/doc/Integrate-iOS-SPM.md @@ -1,6 +1,6 @@ ## πŸ“¦ iOS Integration via Swift Package Manager (SPM) -Flutter introduced Swift Package Manager support as an **opt-in** feature in Flutter 3.24, and it became the **default** package manager in Flutter 3.44. The CleverTap Flutter plugin ships a `Package.swift` alongside its podspec, so both package managers resolve the same native SDK version (`CleverTap-iOS-SDK 7.7.1`). +Flutter introduced Swift Package Manager support as an **opt-in** feature in Flutter 3.24, and it became the **default** package manager in Flutter 3.44. The CleverTap Flutter plugin from v4.2.0 ships a `Package.swift` alongside its podspec, so both package managers resolve the same native SDK version (`CleverTap-iOS-SDK 7.8.1`). > **Minimum requirements for SPM integration** > - Flutter 3.24+ (opt-in) - enabled by default from Flutter 3.44 @@ -13,7 +13,7 @@ Flutter introduced Swift Package Manager support as an **opt-in** feature in Flu ### How it works -The plugin ships a Swift package that pins `CleverTap-iOS-SDK 7.7.1`. When your app is built with SPM enabled, Flutter resolves it automatically - you don't add anything to your app's own `Package.swift` or edit any plugin files. +The plugin ships a Swift package that pins `CleverTap-iOS-SDK 7.8.1`. When your app is built with SPM enabled, Flutter resolves it automatically - you don't add anything to your app's own `Package.swift` or edit any plugin files. --- @@ -65,7 +65,7 @@ flutter build ios --config-only # or: flutter run On this build Flutter adds a `FlutterGeneratedPluginSwiftPackage` to the Xcode project and resolves every plugin that ships a `Package.swift` (including `clevertap_plugin`) via SPM. Plugins that only ship a podspec stay on CocoaPods - a hybrid setup is expected. **4. Verify SPM took over.** Open `ios/Runner.xcworkspace` and confirm: -- **Package Dependencies** lists `clevertap_plugin` and, transitively, `clevertap-ios-sdk` at `7.7.1`. +- **Package Dependencies** lists `clevertap_plugin` and, transitively, `clevertap-ios-sdk` at `7.8.1`. - The regenerated `Podfile.lock` no longer contains a `clevertap_plugin` pod entry. **5. Build and run** on a simulator/device and smoke-test CleverTap initialization plus a `recordEvent` to confirm native symbols link. @@ -107,8 +107,8 @@ These guards ensure your app compiles correctly regardless of which package mana | | CocoaPods | SPM | |---|---|---| -| SDK version pinned | `7.7.1` | `7.7.1` | -| Deployment target | `13.0` | `13.0` | +| SDK version pinned | `7.8.1` | `7.8.1` | +| Deployment target | `9.0` | `13.0` | | Opt-in required | No | Yes on Flutter 3.24–3.43; default from 3.44 | Both package managers resolve the same CleverTap iOS SDK version to ensure no drift between the two integration paths. From da297b1537ea2464d378cc3651e661c9481a4c0a Mon Sep 17 00:00:00 2001 From: ReshabCT Date: Wed, 26 Aug 2026 10:26:45 +0530 Subject: [PATCH 17/20] remove publicHeadersPath from Package.swift after docs review --- ios/clevertap_plugin/Package.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/ios/clevertap_plugin/Package.swift b/ios/clevertap_plugin/Package.swift index 800f4dd..1039c4d 100644 --- a/ios/clevertap_plugin/Package.swift +++ b/ios/clevertap_plugin/Package.swift @@ -23,7 +23,6 @@ let package = Package( .product(name: "FlutterFramework", package: "FlutterFramework"), .product(name: "CleverTapSDK", package: "clevertap-ios-sdk") ], - publicHeadersPath: "include/clevertap_plugin", cSettings: [ .headerSearchPath("include/clevertap_plugin") ] From d6b8acbbba86e3750f20826b5cc7db8b86f2783d Mon Sep 17 00:00:00 2001 From: ReshabCT Date: Wed, 26 Aug 2026 10:44:24 +0530 Subject: [PATCH 18/20] port getAppLaunchNotification implementation to spm source path. --- .../clevertap_plugin/CleverTapPlugin.m | 20 +++++++++++++++++-- .../clevertap_plugin/CleverTapPlugin.h | 1 + 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ios/clevertap_plugin/Sources/clevertap_plugin/CleverTapPlugin.m b/ios/clevertap_plugin/Sources/clevertap_plugin/CleverTapPlugin.m index b03a196..6642e0d 100644 --- a/ios/clevertap_plugin/Sources/clevertap_plugin/CleverTapPlugin.m +++ b/ios/clevertap_plugin/Sources/clevertap_plugin/CleverTapPlugin.m @@ -153,12 +153,15 @@ - (instancetype)init { } - (void)applicationDidLaunchWithOptions:(NSDictionary *)options { - + NSDictionary *notification = [options valueForKey:UIApplicationLaunchOptionsRemoteNotificationKey]; if (notification && notification[@"wzrk_dl"]) { self.launchDeepLink = notification[@"wzrk_dl"]; NSLog(@"CleverTapFlutter: setting launch deeplink: %@", self.launchDeepLink); } + if (notification && [[CleverTap sharedInstance] isCleverTapNotification:notification]) { + self.launchNotification = notification; + } } - (void)sceneWillConnectWithOptions:(UISceneConnectionOptions *)connectionOptions API_AVAILABLE(ios(13.0)) { @@ -421,6 +424,8 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result { [self getUserEventLogHistory:call withResult:result]; else if ([@"getUserAppLaunchCount" isEqualToString:call.method]) [self getUserAppLaunchCount:call withResult:result]; + else if ([@"getAppLaunchNotification" isEqualToString:call.method]) + [self getAppLaunchNotification:call withResult:result]; else if ([@"getUserLastVisitTs" isEqualToString:call.method]) [self getUserLastVisitTs:call withResult:result]; else if ([@"unmute" isEqualToString:call.method]) @@ -719,11 +724,22 @@ - (void)sessionGetTotalVisits:(FlutterMethodCall *)call withResult:(FlutterResul } - (void)getUserAppLaunchCount:(FlutterMethodCall *)call withResult:(FlutterResult)result { - + int res = [[CleverTap sharedInstance] getUserAppLaunchCount]; result(@(res)); } +- (void)getAppLaunchNotification:(FlutterMethodCall *)call withResult:(FlutterResult)result { + + NSMutableDictionary *res = [NSMutableDictionary new]; + BOOL launched = (self.launchNotification != nil); + res[@"notificationLaunchedApp"] = @(launched); + if (launched) { + res[@"notificationPayload"] = self.launchNotification; + } + result(res); +} + - (void)sessionGetScreenCount:(FlutterMethodCall *)call withResult:(FlutterResult)result { int res = [[CleverTap sharedInstance] userGetScreenCount]; diff --git a/ios/clevertap_plugin/Sources/clevertap_plugin/include/clevertap_plugin/CleverTapPlugin.h b/ios/clevertap_plugin/Sources/clevertap_plugin/include/clevertap_plugin/CleverTapPlugin.h index 3997b1b..e8f0d66 100644 --- a/ios/clevertap_plugin/Sources/clevertap_plugin/include/clevertap_plugin/CleverTapPlugin.h +++ b/ios/clevertap_plugin/Sources/clevertap_plugin/include/clevertap_plugin/CleverTapPlugin.h @@ -36,5 +36,6 @@ static NSString *const kCleverTapCustomTemplateClose = @"c - (void)postNotificationWithName:(NSString *)name andBody:(NSDictionary *)body; @property NSString *launchDeepLink; +@property (strong, nonatomic) NSDictionary *launchNotification; @end From 5dd7d9fd76bfae10ce78d5752ab24d3da5a13677 Mon Sep 17 00:00:00 2001 From: ReshabCT Date: Thu, 27 Aug 2026 10:35:39 +0530 Subject: [PATCH 19/20] remove flutterframework dependency from package.swift to support lower flutter sdk versions --- ios/clevertap_plugin/Package.swift | 2 -- 1 file changed, 2 deletions(-) diff --git a/ios/clevertap_plugin/Package.swift b/ios/clevertap_plugin/Package.swift index 1039c4d..ca8ccc2 100644 --- a/ios/clevertap_plugin/Package.swift +++ b/ios/clevertap_plugin/Package.swift @@ -10,7 +10,6 @@ let package = Package( .library(name: "clevertap-plugin", targets: ["clevertap_plugin"]) ], dependencies: [ - .package(name: "FlutterFramework", path: "../FlutterFramework"), .package( url: "https://github.com/CleverTap/clevertap-ios-sdk", exact: "7.8.1" @@ -20,7 +19,6 @@ let package = Package( .target( name: "clevertap_plugin", dependencies: [ - .product(name: "FlutterFramework", package: "FlutterFramework"), .product(name: "CleverTapSDK", package: "clevertap-ios-sdk") ], cSettings: [ From d65e9acc3d57fa50fc0bd5cdb355b75a6065ff91 Mon Sep 17 00:00:00 2001 From: ReshabCT Date: Thu, 27 Aug 2026 13:52:44 +0530 Subject: [PATCH 20/20] add flutterframework warning to ios spm troubleshooting docs. --- doc/Integrate-iOS-SPM.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/Integrate-iOS-SPM.md b/doc/Integrate-iOS-SPM.md index 7c3b1d0..4650fa2 100644 --- a/doc/Integrate-iOS-SPM.md +++ b/doc/Integrate-iOS-SPM.md @@ -122,3 +122,4 @@ Both package managers resolve the same CleverTap iOS SDK version to ensure no dr - **Duplicate symbol errors**: Don't use both CocoaPods and SPM for the same plugin at once. If a `Podfile` exists and SPM is enabled, Flutter prefers SPM for plugins that support it. - **Build fails with missing headers**: Verify your deployment target is `13.0` or higher in both your Xcode project and `Podfile`/`Package.swift`. - **Stale CocoaPods references after migrating**: If the build still runs `[CP]` Pods build phases (or duplicate-embeds a framework) for a plugin that has moved to SPM, run `pod deintegrate` in your app's `ios/` directory, then `flutter clean && flutter build ios` so Flutter re-integrates cleanly. Use this only as a recovery step - it is not part of the normal migration flow. Flutter regenerates the CocoaPods integration on every build, so a manual `pod deintegrate` is otherwise undone on the next build. +- **"Plugin clevertap_plugin has a Package.swift but is missing a dependency on FlutterFramework"**: This warning appears on Flutter 3.44 and later, which generates a `FlutterFramework` SPM package and expects plugins to declare an explicit dependency on it. The current `Package.swift` omits this dependency for compatibility with Flutter 3.24-3.43, where `FlutterFramework` is not generated. The build still succeeds because Flutter headers are resolved via framework search paths at build time.