Skip to content

W-21080629: Upgrade to cordova-ios 8.1.0 — Swift AppDelegate, CDVPluginNotifications import#309

Merged
wmathurin merged 9 commits into
forcedotcom:devfrom
wmathurin:W-21080629-cordova-ios-8
Jun 9, 2026
Merged

W-21080629: Upgrade to cordova-ios 8.1.0 — Swift AppDelegate, CDVPluginNotifications import#309
wmathurin merged 9 commits into
forcedotcom:devfrom
wmathurin:W-21080629-cordova-ios-8

Conversation

@wmathurin

Copy link
Copy Markdown
Contributor

Summary

Upgrades hybrid iOS support from cordova-ios 7.1.1 to 8.1.0.

Changes

  • shared/hybrid/AppDelegate.swift (new) — Swift port of AppDelegate.m. Uses @main @objc @implementation extension AppDelegate pattern required by cordova-ios 8.x. Initializes SalesforceHybridSDKManager, sets up URL cache, handles login flow, push notifications, and user-change notifications.
  • shared/hybrid/AppDelegate.m (deleted) — replaced by Swift version above.
  • libs/SalesforceHybridSDK/.../SFHybridViewController.m — adds #import <Cordova/CDVPluginNotifications.h> (cordova-ios 8.x moved notification constants to a separate header).
  • SalesforceHybridSDK.podspec — Cordova dependency 7.1.18.1.0.

Notes

  • AppDelegate.h is kept unchanged (declares @interface AppDelegate : CDVAppDelegate). The Bridging-Header generated by cordova-ios 8.x imports this header so the Swift implementation can extend the ObjC class.
  • AppDelegate.swift is not declared as a <source-file> in plugin.xml because cordova-ios 8.x routes <source-file> entries to the CordovaPlugins SPM target which cannot link CocoaPods frameworks. The postinstall-ios.js hook in CordovaPlugin copies it and redirects the app target reference instead.

Test plan

  • iOS-Hybrid unit tests pass (SalesforceHybridSDKTestAppTests) — verified locally ✅
  • Hybrid templates build via test_force.js --cli=forcehybrid --os=ios — verified locally ✅

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
TestsPassed ✅SkippedFailed
SalesforceFileLogger iOS ^26 Test Results15 ran15 ✅
TestResult
No test annotations available

@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.62%. Comparing base (bdbb5d0) to head (53973d3).
⚠️ Report is 1 commits behind head on dev.

Additional details and impacted files
@@             Coverage Diff             @@
##              dev     #309       +/-   ##
===========================================
+ Coverage   29.37%   62.62%   +33.25%     
===========================================
  Files          21       21               
  Lines        1699     1699               
===========================================
+ Hits          499     1064      +565     
+ Misses       1200      635      -565     
Flag Coverage Δ
SalesforceFileLogger 70.55% <ø> (ø)
SalesforceHybridSDK 60.74% <ø> (+41.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...lesforceHybridSDK/Classes/SFHybridViewController.m 41.87% <ø> (+6.87%) ⬆️

... and 10 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

wmathurin added 2 commits June 8, 2026 19:06
…/cordova submodule

external/cordova: 7.1.1 → 8.1.0

Both sample apps (AccountEditor, MobileSyncExplorerHybrid):
- AppDelegate.m → AppDelegate.swift (path update in project.pbxproj)
- main.m: removed (no main.m in cordova-ios 8.x, replaced by @main in AppDelegate.swift)
- AppDelegate.h, MainViewController.h paths: __PROJECT_NAME__/ → App/
- MainViewController.m/.xib: removed (replaced by ViewController.swift in 8.x)
- ViewController.swift: added (from external/cordova/templates/project/App/)
- SWIFT_VERSION = 5.0: added (required for Swift sources)
- SWIFT_OBJC_BRIDGING_HEADER: added, points to shared/hybrid/SampleApp-Bridging-Header.h

shared/hybrid/SampleApp-Bridging-Header.h (new): imports Cordova, AppDelegate.h,
MainViewController.h (with deprecation silencing), and InitialViewController.h
so all ObjC types are visible from AppDelegate.swift and ViewController.swift.

Build verified: AccountEditor and MobileSyncExplorerHybrid both BUILD SUCCEEDED.
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
TestsPassed ✅SkippedFailed
SalesforceHybridSDK iOS ^26 Test Results150 ran150 ✅
TestResult
No test annotations available

@wmathurin wmathurin merged commit 1b4cb61 into forcedotcom:dev Jun 9, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants