-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Task/sdk 4425/support corev7.2.2 #294
Conversation
- Adds support for core android v7.2.2 - Updates changelog and versions - Upgrades AGP to 8.6.0 as recommended for Android 15 - Fixes gradle deprecation warnings
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThis update advances the CleverTap SDK to version 3.2.0 across multiple platforms. The changes include version bumps in documentation and configuration files, updates to Android build settings (including Gradle and SDK versions), and a shift in application architecture (e.g. using Application instead of FlutterApplication). The plugin now implements new user-level event log APIs while deprecating older device-level ones. Additionally, the native Android code registration and push notification handling have been modernized, and the Flutter example has been restructured to incorporate these updates. Changes
Sequence Diagram(s)sequenceDiagram
participant App
participant FlutterPlugin
participant NativeComm
participant CleverTapAPI
App->>FlutterPlugin: Call getUserEventLog("eventName")
FlutterPlugin->>NativeComm: Method channel call
NativeComm->>CleverTapAPI: Retrieve event log data
CleverTapAPI-->>NativeComm: Return event data
NativeComm-->>FlutterPlugin: Deliver result via channel
FlutterPlugin-->>App: Return event log data
sequenceDiagram
participant User
participant FlutterUI
participant CleverTapPlugin
participant NotificationHandler
User->>FlutterUI: Receives push notification
FlutterUI->>CleverTapPlugin: Call pushClickedPayloadReceived(payload)
CleverTapPlugin->>NotificationHandler: Process notification payload
NotificationHandler-->>CleverTapPlugin: Notification processed
CleverTapPlugin-->>FlutterUI: Update UI/Status
Possibly related PRs
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (10)
example/lib/main.dart (1)
559-716
: Main UI structure.
This large block organizes numerous example actions with expansion tiles. While it’s quite extensive, it follows a clear pattern. For production code, consider factoring out sections into separate widgets or pages for maintainability.example/android/settings.gradle (1)
23-23
: Activate Kotlin Plugin DeclarationEnabling the Kotlin plugin with
id "org.jetbrains.kotlin.android" version "2.0.20" apply false
is correct for projects that leverage Kotlin. For consistency and readability, you might consider using the parenthesized syntax (e.g.,id("org.jetbrains.kotlin.android")
) throughout the file.example/pubspec.yaml (1)
27-31
: Workmanager Dependency Upgrade via GitReplacing the version constraint for
workmanager
with a Git-based dependency:
- This change—declaring the dependency via a Git repository (URL, path, and
ref: main
)—ensures you’re tracking the latest changes which may include important fixes or improvements.- Just verify that using the
main
branch does not introduce instability into the project.CHANGELOG.md (7)
3-3
: Consistent Header Format for New Version Entry
The version header “Version 3.2.0 (xx February 2025)” is currently styled as plain text. For better consistency and readability, please consider converting it to an atx heading. For example:-Version 3.2.0 *(xx February 2025)* +## Version 3.2.0 *(xx February 2025)*🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
3-3: Heading style
Expected: atx; Actual: setext(MD003, heading-style)
8-8
: Convert Emphasized 'What’s new' to a Heading
Using bold text (“What's new”) here may reduce clarity in the document outline. Consider converting it into an atx heading. For example:-**What's new** +## What's new🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
8-8: Emphasis used instead of a heading
null(MD036, no-emphasis-as-heading)
12-12
: Fix Spacing Around Code Snippet
There is a missing space between the inline code snippet and the following text in this bullet. This affects readability. For example, change:-Uses `AndroidKeyStore`for securely backing up encryption key on API levels 23+. +Uses `AndroidKeyStore` for securely backing up encryption key on API levels 23+.
28-35
: Unordered List Styling in Nested Items
The nested list under the “[Android and iOS Platform]” section is using dashes (“-”) instead of asterisks, which is inconsistent with the expected markdown style. Please update these list markers to asterisks. For example:- - Adds support for triggering InApps based on first-time event filtering in multiple triggers. Now you can create campaign triggers that combine recurring and first-time events. For example: Trigger a campaign when "Charged" occurs (every time) OR "App Launched" occurs (first time only). + * Adds support for triggering InApps based on first-time event filtering in multiple triggers. Now you can create campaign triggers that combine recurring and first-time events. For example: Trigger a campaign when "Charged" occurs (every time) OR "App Launched" occurs (first time only).And similarly for the nested API list items:
- - `getUserEventLog(<eventName>)`: Get details about a specific event + * `getUserEventLog(<eventName>)`: Get details about a specific event🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
28-28: Unordered list style
Expected: asterisk; Actual: dash(MD004, ul-style)
29-29: Unordered list style
Expected: asterisk; Actual: dash(MD004, ul-style)
30-30: Unordered list style
Expected: asterisk; Actual: dash(MD004, ul-style)
31-31: Unordered list style
Expected: asterisk; Actual: dash(MD004, ul-style)
32-32: Unordered list style
Expected: asterisk; Actual: dash(MD004, ul-style)
33-33: Unordered list style
Expected: asterisk; Actual: dash(MD004, ul-style)
34-34: Unordered list style
Expected: asterisk; Actual: dash(MD004, ul-style)
36-45
: Consistent List Marker in API Changes Block
In the “API Changes” block, the deprecation list is also using dashes. For consistency with markdownlint guidelines, please change these to asterisks. For instance:- - **API Changes** + * **API Changes**And update the nested items accordingly. This small adjustment will improve the overall consistency of the changelog formatting.
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
36-36: Unordered list style
Expected: asterisk; Actual: dash(MD004, ul-style)
37-37: Unordered list style
Expected: asterisk; Actual: dash(MD004, ul-style)
38-38: Unordered list style
Expected: asterisk; Actual: dash(MD004, ul-style)
39-39: Unordered list style
Expected: asterisk; Actual: dash(MD004, ul-style)
40-40: Unordered list style
Expected: asterisk; Actual: dash(MD004, ul-style)
41-41: Unordered list style
Expected: asterisk; Actual: dash(MD004, ul-style)
42-42: Unordered list style
Expected: asterisk; Actual: dash(MD004, ul-style)
43-43: Unordered list style
Expected: asterisk; Actual: dash(MD004, ul-style)
44-44: Unordered list style
Expected: asterisk; Actual: dash(MD004, ul-style)
16-16
: Consistent Header Format for Previous Version Entry
The header for “Version 3.1.0 (xx February 2025)” should also follow the atx heading style. Consider updating it as follows:-Version 3.1.0 *(xx February 2025)* +## Version 3.1.0 *(xx February 2025)*🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
16-16: Heading style
Expected: atx; Actual: setext(MD003, heading-style)
18-18
: Standardize 'What’s new' Section Heading
Similarly to version 3.2.0, the “What's new” text in the Version 3.1.0 block should be promoted to a proper heading (e.g., "## What's new") to maintain a clear document structure.-**What's new** +## What's new🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
18-18: Emphasis used instead of a heading
null(MD036, no-emphasis-as-heading)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (18)
CHANGELOG.md
(1 hunks)README.md
(1 hunks)android/build.gradle
(4 hunks)android/src/main/java/com/clevertap/clevertap_plugin/CleverTapApplication.java
(1 hunks)android/src/main/java/com/clevertap/clevertap_plugin/CleverTapPlugin.java
(3 hunks)android/src/main/java/com/clevertap/clevertap_plugin/DartToNativePlatformCommunicator.kt
(10 hunks)android/src/main/java/com/clevertap/clevertap_plugin/Utils.java
(3 hunks)doc/Integrate-Android.md
(1 hunks)example/android/app/src/main/AndroidManifest.xml
(0 hunks)example/android/app/src/main/java/com/example/clevertap_plugin_example/EmbeddingV1Activity.java
(0 hunks)example/android/gradle.properties
(1 hunks)example/android/gradle/wrapper/gradle-wrapper.properties
(1 hunks)example/android/settings.gradle
(1 hunks)example/lib/main.dart
(14 hunks)example/pubspec.yaml
(1 hunks)ios/clevertap_plugin.podspec
(1 hunks)lib/clevertap_plugin.dart
(5 hunks)pubspec.yaml
(1 hunks)
💤 Files with no reviewable changes (2)
- example/android/app/src/main/AndroidManifest.xml
- example/android/app/src/main/java/com/example/clevertap_plugin_example/EmbeddingV1Activity.java
✅ Files skipped from review due to trivial changes (3)
- pubspec.yaml
- ios/clevertap_plugin.podspec
- example/android/gradle/wrapper/gradle-wrapper.properties
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
CHANGELOG.md
3-3: Heading style
Expected: atx; Actual: setext
(MD003, heading-style)
8-8: Emphasis used instead of a heading
null
(MD036, no-emphasis-as-heading)
16-16: Heading style
Expected: atx; Actual: setext
(MD003, heading-style)
18-18: Emphasis used instead of a heading
null
(MD036, no-emphasis-as-heading)
28-28: Unordered list style
Expected: asterisk; Actual: dash
(MD004, ul-style)
29-29: Unordered list style
Expected: asterisk; Actual: dash
(MD004, ul-style)
30-30: Unordered list style
Expected: asterisk; Actual: dash
(MD004, ul-style)
31-31: Unordered list style
Expected: asterisk; Actual: dash
(MD004, ul-style)
32-32: Unordered list style
Expected: asterisk; Actual: dash
(MD004, ul-style)
33-33: Unordered list style
Expected: asterisk; Actual: dash
(MD004, ul-style)
34-34: Unordered list style
Expected: asterisk; Actual: dash
(MD004, ul-style)
36-36: Unordered list style
Expected: asterisk; Actual: dash
(MD004, ul-style)
37-37: Unordered list style
Expected: asterisk; Actual: dash
(MD004, ul-style)
38-38: Unordered list style
Expected: asterisk; Actual: dash
(MD004, ul-style)
39-39: Unordered list style
Expected: asterisk; Actual: dash
(MD004, ul-style)
40-40: Unordered list style
Expected: asterisk; Actual: dash
(MD004, ul-style)
41-41: Unordered list style
Expected: asterisk; Actual: dash
(MD004, ul-style)
42-42: Unordered list style
Expected: asterisk; Actual: dash
(MD004, ul-style)
43-43: Unordered list style
Expected: asterisk; Actual: dash
(MD004, ul-style)
44-44: Unordered list style
Expected: asterisk; Actual: dash
(MD004, ul-style)
🔇 Additional comments (45)
android/src/main/java/com/clevertap/clevertap_plugin/CleverTapPlugin.java (4)
84-84
: Looks good.
CallingsetupPlugin
from withinonAttachedToEngine
correctly implements the Flutter plugin architecture.
99-99
: Method signature update is appropriate.
Removing theRegistrar
parameter aligns with the modern plugin registration approach.
101-105
: Channel setup logic confirmed.
Initializing method channels with the updated signatures is valid. No issues found.
120-123
: Method channel creation updated.
The newMethodChannel
constructor invocation without aRegistrar
parameter is consistent with Flutter v2+ plugins.example/lib/main.dart (18)
4-4
: Dependency usage note.
The import fordart:math
is clear and is used for generating random values in user logins. No issues.
241-242
: Toast usage check.
UsingshowToast(filePath)
here is fine. Ensure no sensitive data is exposed inadvertently in a production build.
428-435
: Push AMP payload handling.
Properly decodes and logs the AMP payload, then creates a notification. Looks correct. Confirm that potential null or malformed data is handled gracefully upstream.
437-441
: Push-click callback.
Deeplink handling appears straightforward. No concerns identified.
443-446
: Push permission response logging.
Simple logging is acceptable. Confirm that subsequent flows handle acceptance or rejection properly.
449-457
: Encapsulated widget:_buildExpansionTile
.
Good approach to maintain code clarity by extracting the expansion tile to a helper function.
459-471
: Encapsulated widget:_buildListTile
.
Keeping each list tile in its own helper function is a clean design choice for better readability.
473-506
: Dialog for single input.
Implementation is neat and straightforward. Fields and error handling for empty inputs are managed.
508-554
: Dialog for multiple inputs.
Similar structure to single input. Good approach reusing the pattern.
919-922
: Custom event method.
Recording events with theCleverTapPlugin
is straightforward. No issues.
988-994
: Custom user profile creation.
Allows for dynamic attribute setting using a map. Correct usage ofprofileSet
.
1299-1305
: Retrieving event first time.
Uses\getUserEventLog
and checksfirstTime
. Implementation looks good.
1312-1317
: Retrieving event last time.
Similarly uses\getUserEventLog
to fetchlastTime
. No concerns.
1325-1332
: Retrieving event log count.
InvokesgetUserEventLogCount
and handles the result. No issues.
1339-1357
: Fetching the entire event log.
Properly retrieves event logs with athen
/catchError
pattern.
1418-1429
: Random user login.
UtilizingRandom
for distinct Identity is valid for testing.
1492-1499
: Obtaining app launch count.
No concerns. The error handling pattern is consistent.
1520-1527
: User last visit retrieval.
Handles returned timestamp with a toast. Looks correct.android/src/main/java/com/clevertap/clevertap_plugin/CleverTapApplication.java (1)
11-13
: Switch from FlutterApplication to Application.
This is valid if the plugin initialization is now fully handled inCleverTapPlugin
, and you are not relying on Flutter-specific context in the Application class. Ensure no side-effects in code that previously expectedFlutterApplication
.android/src/main/java/com/clevertap/clevertap_plugin/Utils.java (4)
12-12
: Import added for new user-level event logging.The addition of
UserEventLog
import supports the new user-level event tracking functionality.
83-94
: Method deprecated in favor of user-level event tracking.The
eventDetailToMap
method is correctly marked as deprecated, with a corresponding replacement methodeventLogToMap
available.
96-109
: New method added for user-level event tracking.The
eventLogToMap
method is well-implemented with comprehensive event data mapping including device ID.
111-119
: New method added for handling user event log history.The
historyEventLogToMap
method provides a clean implementation for mapping event history data.lib/clevertap_plugin.dart (3)
76-77
: Library version updated to 30200.Version number format follows X0X0X pattern (3.2.0 → 30200).
688-693
: New user-level event tracking methods added.Comprehensive set of new methods added for user-level event tracking:
getUserEventLog
getUserEventLogCount
getUserEventLogHistory
getUserAppLaunchCount
getUserLastVisitTs
The implementation is consistent and includes proper error handling.
Also applies to: 695-707, 709-716, 726-731, 733-737, 739-744, 746-750, 752-756
918-923
: Methods deprecated with clear migration paths.The deprecated methods include clear guidance to use the new user-level event tracking methods:
sessionGetTotalVisits
→getUserAppLaunchCount
sessionGetPreviousVisitTime
→getUserLastVisitTs
Also applies to: 931-936
android/src/main/java/com/clevertap/clevertap_plugin/DartToNativePlatformCommunicator.kt (3)
68-68
: New constant added for event name key.The
KEY_EVENT_NAME
constant improves code maintainability by centralizing the event name key.
1217-1256
: New user-level event tracking methods added.Well-implemented set of methods for user-level event tracking with proper null checks and error handling:
getUserEventLog
getUserEventLogCount
getUserEventLogHistory
getUserAppLaunchCount
getUserLastVisitTs
1258-1297
: Methods deprecated with proper annotations.The deprecated methods are properly annotated with
@Deprecated
and include deprecation messages.example/android/gradle.properties (1)
1-1
: JVM arguments updated to remove deprecated setting.Removed
-XX:MaxPermSize=512m
as it's no longer needed in modern Java versions. The remaining memory and encoding settings are appropriate.example/android/settings.gradle (1)
21-22
: Android Application Plugin Version UpdateThe update to use
id("com.android.application").version("8.6.1").apply(false)
ensures that your Android build configuration aligns with the latest Gradle Plugin requirements. This change appears well integrated with the rest of the build settings.android/build.gradle (5)
2-3
: Project Version UpdateChanging the project version from
'3.0.0'
to'3.2.0'
is consistent with the release notes and version bump described in your PR. Ensure that this version is consistently referenced across all modules.
11-13
: Gradle Plugin Classpath UpgradeUpdating the Gradle tools dependency with
classpath("com.android.tools.build:gradle:8.6.1")
is a required change for supporting Android 15 and the related encryption updates. Make sure to run a full build to confirm there are no compatibility issues.
38-41
: Enable BuildConfig via Build FeaturesThe addition of the
buildFeatures { buildConfig = true }
block improves your configuration by allowing for generated build configuration fields. This can facilitate feature flagging or conditional compilation.
46-47
: Compile SDK Level IncrementRaising
compileSdk
from 34 to 35 properly reflects support for Android 15. Double-check that all dependencies are compatible with this SDK level.
62-66
: CleverTap Android SDK Dependency UpgradeUpdating the CleverTap Android SDK dependency to
api 'com.clevertap.android:clevertap-android-sdk:7.2.2'
is an important change for improved encryption and feature support. Validate that any API changes in the SDK have been addressed in your integration code.README.md (1)
22-25
: Documentation Version BumpUpdating the
clevertap_plugin
dependency version in the README to3.2.0
ensures that developers are guided to use the latest SDK release. This update is consistent with the other version changes in the project.example/pubspec.yaml (2)
19-26
: Dependency Cleanup: Removal ofopen_file
The removal of the
open_file
dependency streamlines the dependency list. Ensure that any functionality previously provided byopen_file
is either no longer required or has been replaced.
39-41
: Local Plugin Dependency Reference CheckThe example specifies
clevertap_plugin
as a local dependency (withpath: ../
). Confirm that this local project’s version aligns with the upgraded version (3.2.0) as communicated in the release notes.doc/Integrate-Android.md (1)
55-62
: Update Application Inheritance in MyApplicationChanging the application class from extending
FlutterApplication
to extendingApplication
is a significant architectural update that aligns with current Android best practices. The addition ofActivityLifecycleCallback.register(this)
beforesuper.onCreate()
should be verified to ensure that any Flutter-specific initialization is handled appropriately elsewhere if needed.CHANGELOG.md (1)
5-7
: Clear Emphasis for Important Note
The note block is displayed correctly with blockquote formatting. Just ensure that the content remains clearly separated from the headings. No changes required here, but keep an eye on consistency with similar sections.
- Addresses comments by coderabbit
…SDK-4425/support_corev7.2.2
- Comments out workmanager - targetSDKVersion = 35
example/android/app/src/main/java/com/example/clevertap_plugin_example/EmbeddingV1Activity.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some comments.
@nishant-clevertap we will also be adding changes for 7.2.2 for android Can you check the versions of the flutter-sdk on iOS side |
https://wizrocket.atlassian.net/browse/SDK-4425
Android 15
Encryption Upgrade
Summary by CodeRabbit
New Features
Refactor
Chores & Documentation
Enjoy the enhanced functionality and improved performance in version 3.2.0!