Skip to content

Conversation

@lposen
Copy link
Contributor

@lposen lposen commented Oct 13, 2025

🔹 JIRA Ticket(s) if any

✏️ Description

Adds the ability to start and end an embedded session

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 yarn android
  3. Click on the "Embedded" tab.
  4. Open Android Studio and navigate to LogCat
  5. Click "Start embedded session"
  6. You should see the following in logcat: 💚 startEmbeddedSession
  7. Click "End embedded session"
  8. You should see the following in logcat: 💚 endEmbeddedSession

@github-actions
Copy link

github-actions bot commented Oct 13, 2025

Lines Statements Branches Functions
Coverage: 59%
59.44% (343/577) 33.18% (76/229) 58.21% (124/213)

@qltysh
Copy link

qltysh bot commented Oct 13, 2025

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

Total Coverage: This PR will increase coverage by 0.97%.

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.

@qltysh
Copy link

qltysh bot commented Oct 13, 2025

2 new issues

Tool Category Rule Count
qlty Structure High total complexity (count = 55) 1
qlty Structure Function with many returns (count = 10): IterableAppProvider 1

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

static log(message?: unknown, ...optionalParams: unknown[]) {
if (!IterableLogger.loggingEnabled) return;

console.log(message, ...optionalParams);

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

This logs sensitive data returned by
an access to apiKey
as clear text.
This logs sensitive data returned by
an access to apiKey
as clear text.
@lposen lposen changed the base branch from master to loren/embedded/MOB-12263-android-add-ability-to-sync-embedded-messages October 13, 2025 17:32
@lposen lposen added the embedded Issues/PRs related to Embedded Messages label Oct 14, 2025
…bedded-messages' into loren/embedded/MOB-12265-start-end-session
@lposen lposen requested a review from Copilot November 19, 2025 06:46
@lposen lposen marked this pull request as ready for review November 19, 2025 06:47
Copilot finished reviewing on behalf of lposen November 19, 2025 06:50
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 session management methods (startSession() and endSession()) to the embedded messaging functionality, enabling tracking of user sessions when viewing screens with embedded messages.

  • Adds startSession() and endSession() methods to IterableEmbeddedManager
  • Implements corresponding methods in IterableApi and native bridge layer
  • Provides Android implementation in both old and new architecture modules

Reviewed Changes

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

Show a summary per file
File Description
src/embedded/classes/IterableEmbeddedManager.ts Adds startSession() and endSession() public methods with JSDoc documentation
src/core/classes/IterableApi.ts Adds startEmbeddedSession() and endEmbeddedSession() static methods to API layer
src/api/NativeRNIterableAPI.ts Extends native module interface with session management methods
example/src/components/Embedded/Embedded.tsx Adds UI buttons and handlers to demonstrate session management in example app
android/src/oldarch/java/com/RNIterableAPIModule.java Implements React methods for old architecture Android bridge
android/src/newarch/java/com/RNIterableAPIModule.java Implements React methods for new architecture Android bridge
android/src/main/java/com/iterable/reactnative/RNIterableAPIModuleImpl.java Implements session management by delegating to native Android SDK's EmbeddedSessionManager

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 57 to 60
* @example
* ```typescript
* IterableEmbeddedManager.startSession();
* ```
Copy link

Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

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

The example shows static method call IterableEmbeddedManager.startSession(), but this should be an instance method call via Iterable.embeddedManager.startSession() to match the actual usage pattern in the SDK.

Copilot uses AI. Check for mistakes.
Comment on lines +60 to +63
* ```
*/
startSession() {
return IterableApi.startEmbeddedSession();
Copy link

Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

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

The example shows static method call IterableEmbeddedManager.endSession(), but this should be an instance method call via Iterable.embeddedManager.endSession() to match the actual usage pattern in the SDK.

Copilot uses AI. Check for mistakes.
/**
* Starts a session.
*
* As session is a period of time when a user is on a screen or page that can
Copy link

Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

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

Typo in documentation: "As session" should be "A session".

Suggested change
* As session is a period of time when a user is on a screen or page that can
* A session is a period of time when a user is on a screen or page that can

Copilot uses AI. Check for mistakes.
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