Skip to content

fix(ios): fix deprecation warnings for iOS 12+#169

Merged
GitToTheHub merged 4 commits intomasterfrom
pr-ios-fix-deprecation-warnings
Mar 31, 2026
Merged

fix(ios): fix deprecation warnings for iOS 12+#169
GitToTheHub merged 4 commits intomasterfrom
pr-ios-fix-deprecation-warnings

Conversation

@GitToTheHub
Copy link
Copy Markdown
Contributor

@GitToTheHub GitToTheHub commented Mar 26, 2026

Platforms affected

iOS

Motivation and Context

  • Fixes all deprecation warnings with XCode 26.4 and cordova-ios 8

Description

Testing

  • Tested with the Hello World app and XCode 26.4

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

- `currentRadioAccessTechnology` is deprecated since iOS 12: https://developer.apple.com/documentation/coretelephony/cttelephonynetworkinfo/currentradioaccesstechnology?language=objc.`serviceCurrentRadioAccessTechnology` should be used.
- Add method `currentRadioAccessTechnology` which uses `serviceCurrentRadioAccessTechnology` on iOS 12 and newer and `currentRadioAccessTechnology` on iOS 11 and older
- `CTRadioAccessTechnologyDidChangeNotification` is deprecated since iOS 12: https://developer.apple.com/documentation/coretelephony/ctradioaccesstechnologydidchangenotification?language=objc. Instead `CTServiceRadioAccessTechnologyDidChangeNotification` should be used.
Copilot AI review requested due to automatic review settings March 26, 2026 17:02
Copy link
Copy Markdown

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

Updates the iOS implementation of the network-information plugin to avoid CoreTelephony deprecation warnings on iOS 12+ while preserving legacy behavior on older iOS versions.

Changes:

  • Replace direct use of deprecated currentRadioAccessTechnology with an internal helper that uses serviceCurrentRadioAccessTechnology on iOS 12+.
  • Switch CoreTelephony radio technology change observation to CTServiceRadioAccessTechnologyDidChangeNotification on iOS 12+ with a deprecated fallback on older iOS versions.

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

- serviceCurrentRadioAccessTechnology is a dictionary (multi‑SIM). Using allValues.firstObject is non-deterministic and can report the wrong Radio Access Technology when multiple services exist. Prefer selecting the Radio Access Technology for the active data service (e.g., via dataServiceIdentifier when available) and fall back deterministically when it’s not.
- Generated-By: GitHub Copilot AI
@GitToTheHub
Copy link
Copy Markdown
Contributor Author

If evertyhing ok with this? I would like to merge it and start to make a release to make this plugin work again with XCode 26.4

@GitToTheHub
Copy link
Copy Markdown
Contributor Author

I merged the 5G change into it and adjusted it

@breautek
Copy link
Copy Markdown
Contributor

If evertyhing ok with this? I would like to merge it and start to make a release to make this plugin work again with XCode 26.4

Yah I think this repo has a lot of fixes that have been sitting in master that should be pushed to an actual release.

Once a patch is released, I think we should consider doing a major bump to then clean up some of the code, requiring cordova-ios@8, which is a min iOS 13 support... we can then clean up some of the backwards compatibility stuff.

Not sure if there any anything worth cleaning on the android side, but a 4.x target would be the time to do it.

@GitToTheHub
Copy link
Copy Markdown
Contributor Author

Once a patch is released, I think we should consider doing a major bump to then clean up some of the code, requiring cordova-ios@8, which is a min iOS 13 support... we can then clean up some of the backwards compatibility stuff.

Not sure if there any anything worth cleaning on the android side, but a 4.x target would be the time to do it.

Yes this sounds good.

@GitToTheHub GitToTheHub merged commit a76687b into master Mar 31, 2026
29 of 32 checks passed
@GitToTheHub GitToTheHub deleted the pr-ios-fix-deprecation-warnings branch March 31, 2026 12:57
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.

3 participants