-
Notifications
You must be signed in to change notification settings - Fork 33
[MOB-10592] Add mobile network Info to register token request #866
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
[MOB-10592] Add mobile network Info to register token request #866
Conversation
…le SDK- Implement `IterableMobileFrameworkDetector` for detecting mobile frameworks (Flutter, React Native, Native).- Introduce `IterableMobileFrameworkInfo` to store framework type and SDK version.- Update `IterableConfig` to include mobile framework info.- Enhance device registration to include mobile framework data.- Add unit tests for framework detection and device registration.
…orkDetector• Combine framework class checks for improved detection accuracy.• Use BuildConfig.APPLICATION_ID for reliable package name verification.• Update comments for clarity.
…nd clarity- Introduced thread-safe caching for framework type detection.- Added `initialize` method for context setup and initial cache.- Separated detection logic into `detectFrameworkInternal`.- Enhanced framework class and metadata checks with lists.- Improved error handling and logging for unexpected scenarios.
…erableAPIMobileFrameworkType with IterableMobileFrameworkType.• Add @JvmStatic annotation to detectFramework method.• Use getPackageInfo instead of getApplicationInfo for metadata retrieval.• Update test cases to handle API level differences in PackageManager.• Improve error handling in framework detection logic.
…ed a lambda for class detection to improve flexibility.• Removed redundant hasClass method.• Updated tests to use reflection for modifying class detection.• Enhanced test setup with mock context initialization.• Simplified test cases for framework detection and caching logic.
…erableMobileFramework- Renamed `IterableMobileFrameworkInfo` to `IterableAPIMobileFrameworkInfo`- Renamed `IterableMobileFrameworkType` to `IterableAPIMobileFrameworkType`- Updated constructor and variable names accordingly
…framework identification
5d686f4 to
8200a6d
Compare
…PIMobileFrameworkType- Updated class and variable names for consistency across the codebase.- Adjusted method signatures and test cases to reflect the new naming convention.
…ged hardcoded JSON keys to string literals for mobileFrameworkInfo.• Updated assertions to use direct string values for frameworkType and iterableSdkVersion.
…ged JSON key access from constants to string literals for `mobileFrameworkInfo`.- Updated assertions to use string literals for `frameworkType` and `iterableSdkVersion`.
…nfo handling- Updated `populateDeviceDetails` to accept `IterableAPIMobileFrameworkInfo` as an optional parameter.- Adjusted framework detection logic in `IterableApiClient` to handle null `mobileFrameworkInfo`.- Moved notification enabled check after framework info setup.- Renamed and reorganized constants in `IterableConstants`.- Enhanced `DeviceInfoUtils` to include framework info in device details if available.
…Update IterableApiClient to use IterableAPIMobileFrameworkType for framework detection.• Modify DeviceInfoUtils.populateDeviceDetails to include frameworkInfo.• Remove redundant mobile framework JSON construction in IterableApiClient.• Add import for IterableAPIMobileFrameworkInfo in DeviceInfoUtils.
… and DeviceInfoUtils- Cleaned up trailing whitespace in IterableApiClient.java and DeviceInfoUtils.java.- Ensured consistent formatting for better readability and maintainability.
…ace `println` with `IterableLogger.d` for consistent debug logging.- Use `IterableLogger.e` for error logging to improve error tracking.
…- Updated logging calls to use separate arguments for TAG and message.- Improved code readability and consistency in logging format.
…t comments and streamline code for clarity.
Ayyanchira
left a comment
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.
LGTM
| ## Unreleased | ||
|
|
||
| ### Added | ||
| - Added `mobileFrameworkInfo` configuration option to `IterableConfig` to identify the mobile framework (Flutter, React Native, or Native) being used with the SDK. | ||
|
|
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.
Appreciating this! It usually was a task to figure out all changes and write it in one go at the end before release. This will definitely make release task lighter 👍🏼
| targetSdkVersion 31 | ||
|
|
||
| buildConfigField "String", "ITERABLE_SDK_VERSION", "\"3.5.7\"" | ||
| buildConfigField "String", "ITERABLE_SDK_VERSION", "\"3.5.9\"" |
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.
This should be taken care by rebasing to master branch. This version is already out there.
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.
In the master branch this is not set correctly @Ayyanchira
🔹 Jira Ticket(s) if any
✏️ Description
This PR adds mobile framework info support to the Android SDK, enabling tracking of framework usage in apps. The implementation includes:
Core Components:
IterableAPIMobileFrameworkTypeenum (FLUTTER, REACT_NATIVE, NATIVE)IterablAPIMobileFrameworkInfoclass for framework metadataIterableConfigfor setting framework infoDevice Registration:
Testing:
E2E Test
To test this PR just run the sdk with a native android app and then verify if the mobile framework info has been sent to the user device