Viewing version 0.3.8. Open the latest package page.

android_intent_plus

0.3.8

Flutter plugin for launching Android Intents. Not supported on iOS.

Download archive

Readme

Flutter Community: android_intent_plus

pub package Flutter Unit Tests

Android Intent Plugin for Flutter

This plugin allows Flutter apps to launch arbitrary intents when the platform is Android. If the plugin is invoked on iOS, it will crash your app. In checked mode, we assert that the platform should be Android.

Use it by specifying action, category, data and extra arguments for the intent. It does not support returning the result of the launched activity. Sample usage:

if (platform.isAndroid) {
  AndroidIntent intent = AndroidIntent(
      action: 'action_view',
      data: 'https://play.google.com/store/apps/details?'
          'id=com.google.android.apps.myapp',
      arguments: {'authAccount': currentUserEmail},
  );
  await intent.launch();
}

See documentation on the AndroidIntent class for details on each parameter.

Action parameter can be any action including a custom class name to be invoked. If a standard android action is required, the recommendation is to add support for it in the plugin and use an action constant to refer to it. For instance:

'action_view' translates to android.os.Intent.ACTION_VIEW

'action_location_source_settings' translates to android.settings.LOCATION_SOURCE_SETTINGS

'action_application_details_settings' translates to android.settings.ACTION_APPLICATION_DETAILS_SETTINGS

if (platform.isAndroid) {
  final AndroidIntent intent = AndroidIntent(
    action: 'action_application_details_settings',
    data: 'package:com.example.app', // replace com.example.app with your applicationId
  );
  await intent.launch();
}

Feel free to add support for additional Android intents.

The Dart values supported for the arguments parameter, and their corresponding Android values, are listed here. On the Android side, the arguments are used to populate an Android Bundle instance. This process currently restricts the use of lists to homogeneous lists of integers or strings.

Note that a similar method does not currently exist for iOS. Instead, the url_launcher plugin can be used for deep linking. Url launcher can also be used for creating ACTION_VIEW intents for Android, however this intent plugin also allows clients to set extra parameters for the intent.

Getting Started

For help getting started with Flutter, view our online documentation.

For help on editing plugin code, view the documentation.

Changelog

0.3.8

  • Transfer package to Flutter Community under new name android_intent_plus.

0.3.7+2

0.3.7+1

  • Fix CocoaPods podspec lint warnings.

0.3.7

  • Add a Future<bool> canResolveActivity method to the AndroidIntent class. It can be used to determine whether a device supports a particular intent or has an app installed that can resolve it. It is based on PackageManager resolveActivity.

0.3.6+1

  • Bump the minimum Flutter version to 1.12.13+hotfix.5.
  • Bump the minimum Dart version to 2.3.0.
  • Uses Darts spread operator to build plugin arguments internally.
  • Remove deprecated API usage warning in AndroidIntentPlugin.java.
  • Migrates the Android example to V2 embedding.

0.3.6

  • Marks the action parameter as optional
  • Adds an assertion to ensure the intent receives an action, component or both.

0.3.5+1

  • Make the pedantic dev_dependency explicit.

0.3.5

0.3.4+8

  • Remove the deprecated author: field from pubspec.yaml
  • Migrate the plugin to the pubspec platforms manifest.
  • Require Flutter SDK 1.10.0 or greater.

0.3.4+7

  • Fix pedantic linter errors.

0.3.4+6

  • Add missing DartDocs for public members.

0.3.4+5

  • Remove AndroidX warning.

0.3.4+4

  • Include lifecycle dependency as a compileOnly one on Android to resolve potential version conflicts with other transitive libraries.

0.3.4+3

  • Android: Use android.arch.lifecycle instead of androidx.lifecycle:lifecycle in build.gradle to support apps that has not been migrated to AndroidX.

0.3.4+2

  • Fix resolveActivity not respecting the provided componentName.

0.3.4+1

  • Fix minor lints in the Java platform code.
  • Add smoke e2e tests for the V2 embedding.
  • Fully migrate the example app to AndroidX.

0.3.4

  • Migrate the plugin to use the V2 Android engine embedding. This shouldn't affect existing functionality. Plugin authors who use the V2 embedding can now instantiate the plugin and expect that it correctly responds to app lifecycle changes.

0.3.3+3

  • Define clang module for iOS.

0.3.3+2

  • Update and migrate iOS example project.

0.3.3+1

  • Added "action_application_details_settings" action to open application info settings .

0.3.3

  • Added "flags" option to call intent.addFlags(int) in native.

0.3.2

  • Added "action_location_source_settings" action to start Location Settings Activity.

0.3.1+1

  • Fix Gradle version.

0.3.1

  • Add a new componentName parameter to help the intent resolution.

0.3.0+2

  • Bump the minimum Flutter version to 1.2.0.
  • Add template type parameter to invokeMethod calls.

0.3.0+1

  • Log a more detailed warning at build time about the previous AndroidX migration.

0.3.0

  • Breaking change. Migrate from the deprecated original Android Support Library to AndroidX. This shouldn't result in any functional changes, but it requires any Android apps using this plugin to also migrate if they're using the original support library.

0.2.1

  • Updated Gradle tooling to match Android Studio 3.1.2.

0.2.0

  • Breaking change. Set SDK constraints to match the Flutter beta release.

0.1.1

  • Simplified and upgraded Android project template to Android SDK 27.
  • Updated package description.

0.1.0

  • Breaking change. Upgraded to Gradle 4.1 and Android Studio Gradle plugin 3.0.1. Older Flutter projects need to upgrade their Gradle setup as well in order to use this version of the plugin. Instructions can be found here.

0.0.3

  • Add FLT prefix to iOS types.

0.0.2

  • Add support for transferring structured Dart values into Android Intent instances as extra Bundle data.

0.0.1

  • Initial release

Installing

export PUB_HOSTED_URL=https://pub.mirror.p-hatan.com
flutter pub add 'android_intent_plus:0.3.8'
pubspec.yaml
name: android_intent_plus
description: Flutter plugin for launching Android Intents. Not supported on iOS.
version: 0.3.8
homepage: https://github.com/fluttercommunity/android_intent_plus
documentation: https://github.com/fluttercommunity/android_intent_plus
maintainer: Miguel Beltran (@miquelbeltran)
authors:
  - Flutter Community <community@flutter.zone>
  - Miguel Beltran <m@beltran.work>

flutter:
  plugin:
    platforms:
      android:
        package: io.flutter.plugins.androidintent
        pluginClass: AndroidIntentPlugin

dependencies:
  flutter:
    sdk: flutter
  platform: ^2.0.0
  meta: ^1.0.5
dev_dependencies:
  test: ^1.3.0
  mockito: ^3.0.0
  flutter_test:
    sdk: flutter
  pedantic: ^1.9.0

environment:
  sdk: ">=2.3.0 <3.0.0"
  flutter: ">=1.12.13+hotfix.5 <2.0.0"

Version history

VersionPublishedArchiveSHA-256
0.0.1Cached · Upstream SHA-256 matchedDownloadb7489ce2…b6b798
0.3.8Cached · Upstream SHA-256 matchedDownloadf8192b87…e8f475
0.4.0Cached · Upstream SHA-256 matchedDownload807ad491…38749b
0.4.1Cached · Upstream SHA-256 matchedDownload5c82e1d7…6d1e4a
0.4.2Cached · Upstream SHA-256 matchedDownloadfe19cf48…fe32f0
0.5.0-nullsafety.1Cached · Upstream SHA-256 matchedDownload414c5b5f…27b2a9
1.0.0Cached · Upstream SHA-256 matchedDownload384782cd…a8b8ef
1.0.1Cached · Upstream SHA-256 matchedDownload4337b1a9…26c837
1.0.2Cached · Upstream SHA-256 matchedDownloade49b4d9e…7cc0ec
2.0.0Cached · Upstream SHA-256 matchedDownload04a637d5…60782d
2.1.0Cached · Upstream SHA-256 matchedDownload4ccbb774…18a5a6
3.0.0Cached · Upstream SHA-256 matchedDownloadca54790d…94c2c4
3.0.1Cached · Upstream SHA-256 matchedDownloadd5f5bdb6…f9fb8a
3.0.2Cached · Upstream SHA-256 matchedDownload0d0eeb73…d380ed
3.1.0Cached · Upstream SHA-256 matchedDownloada4152542…191d00
3.1.1Cached · Upstream SHA-256 matchedDownloadd696e390…e56fff
3.1.1+1Cached · Upstream SHA-256 matchedDownload7e99de04…15e1f6
3.1.2Cached · Upstream SHA-256 matchedDownloadac19c05a…dfefc5
3.1.3Cached · Upstream SHA-256 matchedDownload2218670d…e3298b
3.1.4Cached · Upstream SHA-256 matchedDownload36d225cd…6e20b4
3.1.5Cached · Upstream SHA-256 matchedDownloadebd110b6…636e31
3.1.6Cached · Upstream SHA-256 matchedDownload54810cb3…45a6af
3.1.7Cached · Upstream SHA-256 matchedDownload6bcdcd20…6690be
3.1.8Cached · Upstream SHA-256 matchedDownload28a665a6…9cfca3
3.1.9Cached · Upstream SHA-256 matchedDownload04cbc7c3…c22603
4.0.0Cached · Upstream SHA-256 matchedDownloadf79fbb8c…43f8aa
4.0.1Cached · Upstream SHA-256 matchedDownload2c87d833…0a9d4e
4.0.2Cached · Upstream SHA-256 matchedDownloadf72ae20b…5abfe6
4.0.3Cached · Upstream SHA-256 matchedDownloade1c62bb4…bfb4d9
5.0.0Cached · Upstream SHA-256 matchedDownloadbfb29839…dd3cdb
5.0.1Cached · Upstream SHA-256 matchedDownloade92d1400…5af2cb
5.0.2Cached · Upstream SHA-256 matchedDownload2bfdbee8…04b074
5.1.0Cached · Upstream SHA-256 matchedDownload007703c1…39cdf6
5.2.0Cached · Upstream SHA-256 matchedDownload38921ec2…b47db3
5.2.1Cached · Upstream SHA-256 matchedDownload53136214…1757c1
5.2.2Cached · Upstream SHA-256 matchedDownload884b0136…cc0add
5.3.0Cached · Upstream SHA-256 matchedDownloaddfc1fd3a…d6aae3
5.3.1Cached · Upstream SHA-256 matchedDownload2329378a…8cce11
6.0.0Cached · Upstream SHA-256 matchedDownload14a9f94c…f48feb
6.1.0Cached · Upstream SHA-256 matchedDownload4d4bbd61…bd5bec

Dependencies

flutter { "sdk": "flutter" }

meta "^1.0.5"

platform "^2.0.0"