Skip to content

Conversation

@lposen
Copy link
Contributor

@lposen lposen commented Oct 11, 2025

🔹 JIRA Ticket(s) if any

✏️ Description

Adds the ability to get placements

@github-actions
Copy link

github-actions bot commented Oct 11, 2025

Lines Statements Branches Functions
Coverage: 51%
52% (286/550) 27.14% (57/210) 49.75% (101/203)

@qltysh
Copy link

qltysh bot commented Oct 11, 2025

4 new issues

Tool Category Rule Count
qlty Structure Function with high complexity (count = 6): initializeWithApiKey 2
qlty Structure High total complexity (count = 55) 1
qlty Structure Function with many returns (count = 8): IterableAppProvider 1

This is from Qlty Cloud, the successor to Code Climate Quality. Learn more.

@qltysh
Copy link

qltysh bot commented Oct 11, 2025

Diff Coverage: The code coverage on the diff in this pull request is 25.0%.

Total Coverage: This PR will decrease coverage by 0.29%.

File Coverage Changes
Path File Coverage Δ Indirect
src/core/classes/IterableApi.ts -2.2
src/embedded/classes/IterableEmbeddedManager.ts -50.0
🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

This is from Qlty Cloud, the successor to Code Climate Quality. Learn more.

@lposen lposen requested a review from Copilot October 14, 2025 20:23
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds embedded messaging placement functionality to the React Native Iterable SDK, allowing developers to retrieve placement IDs for embedded messages.

  • Adds getPlacementIds() method to the embedded manager for fetching placement IDs
  • Renames configuration property from embeddedMessagingEnabled to enableEmbeddedMessaging
  • Implements native Android support for embedded placement retrieval

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/embedded/classes/IterableEmbeddedManager.ts Adds getPlacementIds method and imports IterableApi
src/core/classes/IterableConfig.ts Renames embeddedMessagingEnabled to enableEmbeddedMessaging
src/core/classes/IterableApi.ts Adds getEmbeddedPlacementIds static method with logging
src/api/NativeRNIterableAPI.ts Defines native interface for getEmbeddedPlacementIds
example/src/hooks/useIterableApp.tsx Enables embedded messaging in example app
example/src/components/Embedded/Embedded.tsx Adds UI to test placement ID retrieval
android/src/oldarch/java/com/RNIterableAPIModule.java Implements React method for old architecture
android/src/newarch/java/com/RNIterableAPIModule.java Implements React method for new architecture
android/src/main/java/com/iterable/reactnative/Serialization.java Adds config serialization for enableEmbeddedMessaging
android/src/main/java/com/iterable/reactnative/RNIterableAPIModuleImpl.java Implements placement ID retrieval logic and embedded manager initialization

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +31 to +34
// import com.iterable.iterableapi.IterableEmbeddedManager;
import com.iterable.iterableapi.IterableEmbeddedMessage;
// import com.iterable.iterableapi.IterableEmbeddedSession;
// import com.iterable.iterableapi.IterableEmbeddedUpdateHandler;
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

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

Remove commented-out import statements. These unused imports add clutter and should be cleaned up.

Suggested change
// import com.iterable.iterableapi.IterableEmbeddedManager;
import com.iterable.iterableapi.IterableEmbeddedMessage;
// import com.iterable.iterableapi.IterableEmbeddedSession;
// import com.iterable.iterableapi.IterableEmbeddedUpdateHandler;
import com.iterable.iterableapi.IterableEmbeddedMessage;

Copilot uses AI. Check for mistakes.
Comment on lines +133 to +134
configBuilder.setEnableEmbeddedMessaging(configReadableMap.getBoolean("enableEmbeddedMessaging"));
}
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

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

Inconsistent indentation. The closing brace should align with the if statement (2 spaces instead of 6).

Suggested change
configBuilder.setEnableEmbeddedMessaging(configReadableMap.getBoolean("enableEmbeddedMessaging"));
}
configBuilder.setEnableEmbeddedMessaging(configReadableMap.getBoolean("enableEmbeddedMessaging"));
}

Copilot uses AI. Check for mistakes.
WritableArray writableArray = Arguments.createArray();
if (placementIds != null) {
for (Long placementId : placementIds) {
writableArray.pushDouble(placementId.doubleValue());
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

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

Converting Long placement IDs to double may cause precision loss for large values. Consider using pushString() or ensure the native interface expects numbers instead of longs.

Suggested change
writableArray.pushDouble(placementId.doubleValue());
writableArray.pushString(placementId.toString());

Copilot uses AI. Check for mistakes.
@lposen lposen added the embedded Issues/PRs related to Embedded Messages label Oct 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

embedded Issues/PRs related to Embedded Messages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant