Skip to content

Conversation

@lposen
Copy link
Contributor

@lposen lposen commented Jan 11, 2026

🔹 JIRA Ticket(s) if any

✏️ Description

  • Adds ability to enable embedded from iOS
  • Adds entitlements needed for webview to example
  • Added workaround for weird iOS login issue

Testing

  • Run the setup
  • Login and then click on the "Embedded" tab
  • The app should successfully log in the the embedded tab should successfully show.
    • IMPORTANT: None of the buttons in there will work correctly at this point.

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.

@qltysh
Copy link

qltysh bot commented Jan 11, 2026

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

@lposen lposen added the embedded Issues/PRs related to Embedded Messages label Jan 12, 2026
@lposen lposen requested review from Ayyanchira and Copilot January 12, 2026 01:21
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 support for iOS in the React Native SDK. The changes enable the enableEmbeddedMessaging configuration flag on iOS to match the existing Android implementation, add necessary WebView entitlements to the example app, and include a workaround for an iOS login initialization issue.

Changes:

  • Added iOS support for the enableEmbeddedMessaging configuration flag in the native Swift code
  • Added web-browser entitlements to the example iOS app to support WebView functionality
  • Implemented a workaround in the example app for an iOS initialization issue

Reviewed changes

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

File Description
ios/RNIterableAPI/Serialization.swift Added deserialization of enableEmbeddedMessaging flag from config dictionary
example/src/hooks/useIterableApp.tsx Added Platform import and iOS-specific error handling workaround for initialization
example/ios/ReactNativeSdkExample/ReactNativeSdkExample.entitlements Created new entitlements file with web-browser capability
example/ios/ReactNativeSdkExample.xcodeproj/project.pbxproj Added entitlements file reference and build configuration, plus formatting changes

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

Comment on lines +256 to +259
if (Platform.OS === 'ios' && getUserId()) {
setIsInitialized(true);
return login();
}
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.

This workaround silently swallows initialization errors on iOS and proceeds with login regardless of the actual error. This could mask legitimate initialization failures (such as network issues, invalid configuration, or API key problems) and lead to unpredictable behavior in production.

Instead of catching all errors and assuming initialization succeeded, consider:

  1. Logging the specific error for debugging purposes
  2. Only applying this workaround for the specific iOS initialization issue mentioned in the PR description
  3. Adding a comment explaining what "weird iOS login issue" this addresses
  4. Investigating and properly fixing the underlying iOS initialization issue rather than working around it

Copilot uses AI. Check for mistakes.
OTHER_LDFLAGS = "$(inherited) ";
OTHER_LDFLAGS = (
"$(inherited)",
" ",
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 change from a string to an array with just a space character seems unusual. This formatting change appears to be converting OTHER_LDFLAGS = "$(inherited) "; to an array format with a space element.

Consider verifying if this change is intentional and necessary, or if it's an artifact from Xcode auto-formatting. If the space is not needed for linking, it would be cleaner to use just "$(inherited)" without the extra space element.

Suggested change
" ",

Copilot uses AI. Check for mistakes.
OTHER_LDFLAGS = "$(inherited) ";
OTHER_LDFLAGS = (
"$(inherited)",
" ",
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 change from a string to an array with just a space character seems unusual. This formatting change appears to be converting OTHER_LDFLAGS = "$(inherited) "; to an array format with a space element.

Consider verifying if this change is intentional and necessary, or if it's an artifact from Xcode auto-formatting. If the space is not needed for linking, it would be cleaner to use just "$(inherited)" without the extra space element.

Suggested change
" ",

Copilot uses AI. Check for mistakes.
Comment on lines +256 to +259
if (Platform.OS === 'ios' && getUserId()) {
setIsInitialized(true);
return login();
}
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.

This change adds a missing documentation comment explaining what the workaround addresses. The PR description mentions "weird iOS login issue" but doesn't provide specifics about what the issue is or why this workaround is needed.

Add a comment here explaining:

  1. What specific iOS initialization issue this addresses
  2. Whether this is a known bug in the Iterable iOS SDK or a React Native bridge issue
  3. Any relevant ticket numbers or references for tracking the root cause

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