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

Testing

  1. cd into the example dir and run:
    yarn install
    watchman watch-del-all
    yarn start --reset-cache
  2. In a separate terminal, cd into example then either run ios (yarn ios) or android (yarn android)
  3. Click on the "Embedded" tab. You should see the following:
    Does embedded class exist? Yes
    Is embedded manager enabled? Yes
    Placement ids: []
  4. Click the "Get placement ids" button
  5. The array with Placement ids: [] should now contain all your placement ids
Screenshot_1763534396

@github-actions
Copy link

github-actions bot commented Oct 11, 2025

Lines Statements Branches Functions
Coverage: 58%
58.49% (334/571) 33.18% (76/229) 56.45% (118/209)

@qltysh
Copy link

qltysh bot commented Oct 11, 2025

1 new issue

Tool Category Rule Count
qlty Structure Function with many returns (count = 10): 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.32%.

File Coverage Changes
Path File Coverage Δ Indirect
src/core/classes/IterableApi.ts -2.6
src/embedded/classes/IterableEmbeddedManager.ts -25.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
Contributor

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.

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
…edded-manager-class' into loren/embedded/MOB-12263-android-add-ability-to-sync-embedded-messages
@lposen lposen marked this pull request as ready for review November 19, 2025 05:06
lposen and others added 4 commits November 18, 2025 21:13
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…to loren/embedded/MOB-12263-android-add-ability-to-sync-embedded-messages
…to loren/embedded/MOB-12263-android-add-ability-to-sync-embedded-messages
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.

2 participants