Skip to content

[@capacitor/app] iOS: 'Expression implicitly coerced from String? to Any' warning in getAppLanguage #2604

Description

@dkalo97

With @capacitor/app 8.1.1 on Xcode 27.0 (Swift 6.4), ios/Sources/AppPlugin/AppPlugin.swift produces:

Expression implicitly coerced from 'String?' to 'Any'

at getAppLanguage:

call.resolve([
    "value": Bundle.main.preferredLocalizations.first
])

preferredLocalizations.first is String?. Unwrapping it (e.g. ?? "en", or as Any if nil is intended) would silence the warning without changing behavior. Happy to send a PR.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions