Skip to content

[connectivity] Define clang module for iOS #41883

@jmagman

Description

@jmagman

Define clang modules in connectivity plugin to:

  1. Allow it to be imported into Swift apps as libraries without use_frameworks!.
  2. Allow it to be module imported @import into Objective-C apps.

See further details in #41007

Steps to Reproduce

Import into Swift app as a library

  1. flutter create test_create_app
  2. Add connectivity to the pubspec.
dependencies:
  flutter:
    sdk: flutter
  connectivity: any
  1. In generated ios/Podfile remove use_frameworks!
  2. flutter build ios
  3. In AppDelegate.swift add import connectivity at the top.
  4. Build.

Compilation error: no such module 'connectivity'

Module import (@import) into Objective-C app

  1. flutter create -i objc test_create_app
  2. Add connectivity.
dependencies:
  flutter:
    sdk: flutter
  connectivity: any
  1. flutter build ios
  2. In AppDelegate.m add @import connectivity; at the top.
  3. Build.

Compilation error: no such module 'connectivity'

Metadata

Metadata

Assignees

Labels

a: existing-appsIntegration with existing apps via the add-to-app flowp: connectivityThe connectivity pluginpackageflutter/packages repository. See also p: labels.platform-iosiOS applications specifically

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions