Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions example/ios/Runner/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,18 @@
#import "GeneratedPluginRegistrant.h"
#import <UserNotifications/UserNotifications.h>

#if __has_include(<CleverTapSDK/CleverTap.h>)
#import <CleverTapSDK/CleverTap.h>
#else
#import "CleverTap.h"
#endif
#if __has_include(<clevertap_plugin/CleverTapPlugin.h>)
#import <clevertap_plugin/CleverTapPlugin.h>
#import <clevertap_plugin/CleverTapPluginCustomTemplates.h>
#else
#import "CleverTapPlugin.h"
#import "CleverTapPluginCustomTemplates.h"
#endif

@implementation AppDelegate

Expand Down
1 change: 0 additions & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,6 @@ class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return StyledToast(
locale: const Locale('en', 'US'),
child: MaterialApp(
home: Scaffold(
appBar: AppBar(
Expand Down
80 changes: 80 additions & 0 deletions ios/Classes/CleverTapPlugin.m
Original file line number Diff line number Diff line change
@@ -1,21 +1,101 @@

#if __has_include(<CleverTapSDK/CleverTap.h>)
#import <CleverTapSDK/CleverTap.h>
#else
#import "CleverTap.h"
#endif

#import "CleverTapPlugin.h"

#if __has_include(<CleverTapSDK/CleverTap+Inbox.h>)
#import <CleverTapSDK/CleverTap+Inbox.h>
#else
#import "CleverTap+Inbox.h"
#endif

#if __has_include(<CleverTapSDK/CleverTapUTMDetail.h>)
#import <CleverTapSDK/CleverTapUTMDetail.h>
#else
#import "CleverTapUTMDetail.h"
#endif

#if __has_include(<CleverTapSDK/CleverTapEventDetail.h>)
#import <CleverTapSDK/CleverTapEventDetail.h>
#else
#import "CleverTapEventDetail.h"
#endif

#if __has_include(<CleverTapSDK/CleverTapSyncDelegate.h>)
#import <CleverTapSDK/CleverTapSyncDelegate.h>
#else
#import "CleverTapSyncDelegate.h"
#endif

#if __has_include(<CleverTapSDK/CleverTap+DisplayUnit.h>)
#import <CleverTapSDK/CleverTap+DisplayUnit.h>
#else
#import "CleverTap+DisplayUnit.h"
#endif

#if __has_include(<CleverTapSDK/CleverTap+FeatureFlags.h>)
#import <CleverTapSDK/CleverTap+FeatureFlags.h>
#else
#import "CleverTap+FeatureFlags.h"
#endif

#if __has_include(<CleverTapSDK/CleverTap+ProductConfig.h>)
#import <CleverTapSDK/CleverTap+ProductConfig.h>
#else
#import "CleverTap+ProductConfig.h"
#endif

#if __has_include(<CleverTapSDK/CleverTapPushNotificationDelegate.h>)
#import <CleverTapSDK/CleverTapPushNotificationDelegate.h>
#else
#import "CleverTapPushNotificationDelegate.h"
#endif

#if __has_include(<CleverTapSDK/CleverTapInAppNotificationDelegate.h>)
#import <CleverTapSDK/CleverTapInAppNotificationDelegate.h>
#else
#import "CleverTapInAppNotificationDelegate.h"
#endif

#if __has_include(<CleverTapSDK/CleverTap+InAppNotifications.h>)
#import <CleverTapSDK/CleverTap+InAppNotifications.h>
#else
#import "CleverTap+InAppNotifications.h"
#endif

#if __has_include(<CleverTapSDK/CleverTap+PushPermission.h>)
#import <CleverTapSDK/CleverTap+PushPermission.h>
#else
#import "CleverTap+PushPermission.h"
#endif

#if __has_include(<CleverTapSDK/CTLocalInApp.h>)
#import <CleverTapSDK/CTLocalInApp.h>
#else
#import "CTLocalInApp.h"
#endif

#if __has_include(<CleverTapSDK/CleverTap+CTVar.h>)
#import <CleverTapSDK/CleverTap+CTVar.h>
#else
#import "CleverTap+CTVar.h"
#endif

#if __has_include(<CleverTapSDK/CTVar.h>)
#import <CleverTapSDK/CTVar.h>
#else
#import "CTVar.h"
#endif

#if __has_include(<CleverTapSDK/CTTemplateContext.h>)
#import <CleverTapSDK/CTTemplateContext.h>
#else
#import "CTTemplateContext.h"
#endif

@interface CleverTapPlugin () <CleverTapSyncDelegate, CleverTapInAppNotificationDelegate, CleverTapDisplayUnitDelegate, CleverTapInboxViewControllerDelegate, CleverTapProductConfigDelegate, CleverTapFeatureFlagsDelegate, CleverTapPushNotificationDelegate, CleverTapPushPermissionDelegate>

Expand Down
10 changes: 10 additions & 0 deletions ios/Classes/CleverTapPluginCustomTemplates.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,18 @@
#import "CleverTapPluginCustomTemplates.h"
#import "CleverTapPluginTemplatePresenter.h"
#import "CleverTapPluginAppFunctionPresenter.h"

#if __has_include(<CleverTapSDK/CTJsonTemplateProducer.h>)
#import <CleverTapSDK/CTJsonTemplateProducer.h>
#else
#import "CTJsonTemplateProducer.h"
#endif

#if __has_include(<CleverTapSDK/CTCustomTemplatesManager.h>)
#import <CleverTapSDK/CTCustomTemplatesManager.h>
#else
#import "CTCustomTemplatesManager.h"
#endif

@implementation CleverTapPluginCustomTemplates

Expand Down
1 change: 1 addition & 0 deletions ios/Classes/include/CleverTapPlugin.h
1 change: 1 addition & 0 deletions ios/Classes/include/CleverTapPluginAppFunctionPresenter.h
1 change: 1 addition & 0 deletions ios/Classes/include/CleverTapPluginCustomTemplates.h
1 change: 1 addition & 0 deletions ios/Classes/include/CleverTapPluginTemplatePresenter.h
3 changes: 2 additions & 1 deletion ios/clevertap_plugin.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ 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.exclude_files = 'Classes/include/**/*'
s.public_header_files = 'Classes/*.h'
s.dependency 'Flutter'
s.dependency 'CleverTap-iOS-SDK', '7.6.0'
Comment on lines +14 to 17

@coderabbitai coderabbitai Bot Jun 2, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== podspec dependency =="
sed -n '13,18p' ios/clevertap_plugin.podspec

echo
echo "== SwiftPM dependency =="
sed -n '1,220p' ios/clevertap_plugin/Package.swift | rg -n "CleverTap|from:|upToNext|exact|branch|revision"

echo
echo "Expected:"
echo "- Both package managers should enforce the same native SDK version policy."
echo "- If SwiftPM uses a 7.x range, CocoaPods should use an equivalent constraint."
echo "- If reproducibility matters more, pin both sides to the same exact version."

Repository: CleverTap/clevertap-flutter

Length of output: 821


Align the CleverTap iOS SDK version constraints across CocoaPods and SwiftPM.

ios/clevertap_plugin.podspec pins CleverTap-iOS-SDK to exact 7.6.0, while ios/clevertap_plugin/Package.swift uses SwiftPM from: "7.6.0" for clevertap-ios-sdk—so the same Flutter plugin can build against different CleverTapSDK versions depending on whether CocoaPods or SwiftPM is used. Make both package managers follow the same version policy (pin both sides to the same exact version, or use equivalent ranges).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ios/clevertap_plugin.podspec` around lines 14 - 17, The podspec currently
pins the CleverTap iOS SDK exactly (s.dependency 'CleverTap-iOS-SDK', '7.6.0')
while Package.swift uses SwiftPM's from: "7.6.0" range; update the version
policy so both package managers match—either change the podspec dependency to a
matching range (e.g., '>= 7.6.0' or a compatible '~> 7.6.0') to mirror SwiftPM's
semantics, or change Package.swift to pin exactly "7.6.0"; modify the
s.dependency line in ios/clevertap_plugin.podspec or the Package.swift from:
entry accordingly so both use the same constraint.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@reshab-code for cocoapods, we pin an exact version of the core-sdk. For SPM, do the same, using "from" in Package.swift will make the flutter sdk support all future versions. Look for the equivalent mechanism in SPM

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure @akashvercetti , should we keep 7.6.0 which is the same for CocoaPods or the latest one ?

s.ios.deployment_target = '9.0'
Expand Down
1 change: 1 addition & 0 deletions ios/clevertap_plugin/Classes
32 changes: 32 additions & 0 deletions ios/clevertap_plugin/Package.swift
Original file line number Diff line number Diff line change
@@ -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(".")
]
)
]
)
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ flutter:
pluginClass: CleverTapPlugin
ios:
pluginClass: CleverTapPlugin
swiftPackageName: clevertap_plugin
web:
pluginClass: CleverTapPluginWeb
fileName: clevertap_plugin_web.dart