Skip to content

Conversation

@lposen
Copy link
Contributor

@lposen lposen commented Jan 11, 2026

🔹 JIRA Ticket(s) if any

✏️ Description

  • Adds start impression and end impression

Testing

  • Run the setup
  • Login and then click on the "Embedded" tab
  • Click "Sync messages"
  • Click "Start session"
  • Click "Get messages"
  • On an individual message, click "start impression"
    • In the Xcode console, you should see:
       💛 18:00:11.9120:0x6000017a5ac0:ReactIterableAPI:startEmbeddedImpression(messageId:placementId:):541
      
  • On an individual message, click "pause impression"
    • In the Xcode console, you should see:
       💛 18:01:04.6450:0x6000017a5ac0:ReactIterableAPI:pauseEmbeddedImpression(messageId:):547
      

Setup

  • cd into root and run yarn install
  • cd into example and run yarn install
  • cd into ios and run bundle exec pod install
  • open two separate terminals.
  • In Terminal 1
    • run watchman watch-del-all
    • run yarn start --reset-cache
  • In Terminal 2
    • cd into ios
    • run open ReactNativeSdkExample.xcworkspace
    • Once Xcode opens the project, choose an emulator then click the play button to run it.

@github-actions
Copy link

Lines Statements Branches Functions
Coverage: 62%
62.72% (392/625) 38.64% (97/251) 61.5% (139/226)

@qltysh
Copy link

qltysh bot commented Jan 11, 2026

Qlty

Coverage Impact

This PR will not change total coverage.

🚦 See full report on Qlty Cloud »

🛟 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.

@lposen lposen requested a review from Copilot January 12, 2026 01:58
@lposen lposen added the embedded Issues/PRs related to Embedded Messages label Jan 12, 2026
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 pull request adds support for embedded message impression tracking to the iOS native bridge of the React Native SDK. The methods startEmbeddedImpression and pauseEmbeddedImpression enable tracking when embedded messages are displayed and when they are no longer visible.

Changes:

  • Added iOS native bridge methods for starting and pausing embedded message impressions
  • Implemented both New Architecture (TurboModule) and Legacy Architecture (RCTBridgeModule) support
  • Methods integrate with the existing EmbeddedSessionManager from the Iterable iOS SDK

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
ios/RNIterableAPI/ReactIterableAPI.swift Added Swift implementations of startEmbeddedImpression and pauseEmbeddedImpression methods that call the native SDK's EmbeddedSessionManager
ios/RNIterableAPI/RNIterableAPI.mm Added Objective-C bridge methods for both New and Legacy React Native architectures, forwarding calls to the Swift implementation

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

@objc(startEmbeddedImpression:placementId:)
public func startEmbeddedImpression(messageId: String, placementId: Double) {
ITBInfo()
EmbeddedSessionManager.shared.startImpression(messageId: messageId, placementId: placementId)
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

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

The placementId parameter is passed as Double directly to the EmbeddedSessionManager, but based on the Android implementation and the existing getEmbeddedMessages method in this file (line 527), placementId should be converted to Int before passing to the native SDK. The Android bridge explicitly casts double to int, and getEmbeddedMessages uses placementId.intValue when calling the SDK. Consider converting the Double to Int: Int(placementId) or verify that the EmbeddedSessionManager.startImpression method accepts Double.

Suggested change
EmbeddedSessionManager.shared.startImpression(messageId: messageId, placementId: placementId)
EmbeddedSessionManager.shared.startImpression(messageId: messageId, placementId: Int(placementId))

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