Skip to content

Conversation

@joaodordio
Copy link
Member

@joaodordio joaodordio commented Oct 23, 2025

🔹 Jira Ticket(s)

✏️ Description

CleanShot 2025-10-24 at 13 25 16

⚠️ Eligibility Silent Push trigger is not working ATM.

needs further investigation on why Silent Push with "notificationType": "UpdateEmbedded" is not being sent to user.

@joaodordio joaodordio added the BCIT Run Business Critical Integration Tests label Oct 23, 2025
@codecov
Copy link

codecov bot commented Oct 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.63%. Comparing base (6e2fdec) to head (99ee30e).
⚠️ Report is 894 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #965       +/-   ##
===========================================
- Coverage   85.19%   69.63%   -15.57%     
===========================================
  Files          91      109       +18     
  Lines        6301     8907     +2606     
===========================================
+ Hits         5368     6202      +834     
- Misses        933     2705     +1772     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@joaodordio joaodordio added BCIT-EMBEDDED Run business critical embedded messages integration test and removed BCIT-EMBED labels Oct 23, 2025
@joaodordio joaodordio marked this pull request as ready for review October 24, 2025 14:11
@joaodordio joaodordio requested a review from Ayyanchira October 24, 2025 14:11
@joaodordio joaodordio changed the title 🧪 Embedded Messaging integration tests SDK-15 🧪 Embedded Messaging integration tests Oct 24, 2025
Base automatically changed from feature/MOB-11464-in-app-tests to master October 25, 2025 17:15
@joaodordio joaodordio force-pushed the feature/SDK-15-BCIT-Embedded-Messages branch from f3924ff to 822de29 Compare October 25, 2025 17:28
Comment on lines +232 to +248
struct EmbeddedMessagesModalView: UIViewControllerRepresentable {
let messages: [IterableEmbeddedMessage]

func makeUIViewController(context: Context) -> UINavigationController {
let vc = EmbeddedMessagesViewController(messages: messages)
let nav = UINavigationController(rootViewController: vc)
return nav
}

func updateUIViewController(_ uiViewController: UINavigationController, context: Context) {
if let vc = uiViewController.viewControllers.first as? EmbeddedMessagesViewController {
vc.updateMessages(messages)
}
}
}

class EmbeddedMessagesViewController: UIViewController {
Copy link
Member Author

Choose a reason for hiding this comment

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

This UIViewController is used to render the SDK OOTB embedded views

joaodordio and others added 3 commits October 25, 2025 19:25
…in permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…erable/iterable-swift-sdk into feature/SDK-15-BCIT-Embedded-Messages
Copy link
Member

@Ayyanchira Ayyanchira left a comment

Choose a reason for hiding this comment

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

Made some optional nit pick which can be added before merging or can be kept for later.
Have tested on device with an active Embedded campaign and worked wonderfully. Even a deeplink to external website

Comment on lines 499 to 560
func createEmbeddedCampaign(
name: String,
placementId: Int,
userListId: String? = nil,
userSegmentId: String? = nil,
dataFieldCriteria: [String: Any]? = nil,
messageContent: [String: Any],
completion: @escaping (Bool, String?) -> Void
) {
let endpoint = "/api/embedded-messaging/campaigns/create"
recordAPICall(endpoint: endpoint)

var payload: [String: Any] = [
"name": name,
"placementId": placementId,
"messageContent": messageContent,
"state": "Active"
]

// Add targeting criteria
var targeting: [String: Any] = [:]
if let userListId = userListId {
targeting["listIds"] = [userListId]
}
if let userSegmentId = userSegmentId {
targeting["segmentIds"] = [userSegmentId]
}
if let dataFieldCriteria = dataFieldCriteria {
targeting["dataFields"] = dataFieldCriteria
}

if !targeting.isEmpty {
payload["targeting"] = targeting
}

performAPIRequest(
endpoint: endpoint,
method: "POST",
body: payload,
useServerKey: true
) { result in
switch result {
case .success(let data):
do {
let json = try JSONSerialization.jsonObject(with: data) as? [String: Any]
if let campaignId = json?["campaignId"] as? String {
completion(true, campaignId)
} else if let campaignId = json?["campaignId"] as? Int {
completion(true, String(campaignId))
} else {
completion(false, nil)
}
} catch {
print("❌ Error parsing embedded campaign creation response: \(error)")
completion(false, nil)
}
case .failure(let error):
print("❌ Error creating embedded campaign: \(error)")
completion(false, nil)
}
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Nit pick - May not need creating campaign
I think its just better to create firs the placement id and one campaign on Iterable itself right?
I tested it with an already active campaign.

}
}

func deleteEmbeddedCampaign(campaignId: String, completion: @escaping (Bool) -> Void) {
Copy link
Member

Choose a reason for hiding this comment

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

Same like above, if creation is removed, deletion can be removed too

XCTAssertTrue(retrySuccessIndicator.waitForExistence(timeout: networkTimeout))

screenshotCapture.captureScreenshot(named: "embedded-network-retry-success")
func testEmbeddedMessage() {
Copy link
Member

Choose a reason for hiding this comment

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

Optional - I realized we should have a comment section right above this primary method which tells whats expected for it to run.
Like a proper project with placement already created and a campaign which works for a dynamic list which looks for isPremium flag under user fields.

@Ayyanchira Ayyanchira self-requested a review October 28, 2025 12:03
Copy link
Member

@Ayyanchira Ayyanchira left a comment

Choose a reason for hiding this comment

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

LGTM

@joaodordio joaodordio merged commit faf43dc into master Oct 28, 2025
10 of 13 checks passed
@joaodordio joaodordio deleted the feature/SDK-15-BCIT-Embedded-Messages branch October 28, 2025 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BCIT Run Business Critical Integration Tests BCIT-EMBEDDED Run business critical embedded messages integration test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants