pub repository
mirror.p-hatan.irandroid_intent_plus
5.3.0Flutter plugin for launching Android Intents. Not supported on iOS.
Readme
android_intent_plus
pub package pub points android_intent_plus
This plugin allows Flutter apps to launch arbitrary intents when the platform is Android.
Platform Support
| Android |
|---|
| โ |
Requirements
- Flutter >=3.12.0
- Dart >=3.1.0 <4.0.0
- Android
compileSDK34 - Java 17
- Android Gradle Plugin >=8.3.0
- Gradle wrapper >=8.4
Usage
Warning
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
There is no similar method 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.
Querying activities
canResolveActivity() and getResolvedActivity() can be used to query whether an activity can handle an intent,
or get the details of the activity that can handle the intent.
final intent = AndroidIntent(
action: 'action_view',
data: Uri.encodeFull('http://'),
);
// can this intent be handled by an activity
final canHandleIntent = await intent.canResolveActivity();
// get the details of the activity that will handle this intent
final details = await intent.getResolvedActivity();
print(details.packageName); // prints com.google.chrome
Android 11 package visibility
Android 11 introduced new permissions for package visibility.
If you plan to use canResolveActivity() method, you need to specify queries in AndroidManifest.xml with specific package names:
https://developer.android.com/training/package-visibility/declaring
you can read more about package visibility on Android on Android Developers blog:
https://medium.com/androiddevelopers/package-visibility-in-android-11-cc857f221cd9
or Official Documentation
https://developer.android.com/training/package-visibility
please note that some packages are visible automatically and you don't have to specify queries:
https://developer.android.com/training/package-visibility/automatic
Learn more
Changelog
5.3.0
- FIX(android_intent_plus): adds error catching and forwarding (#3452). (37f533c7)
- FEAT(android_intent_plus): adds sendService method (#3410). (ea72b632)
5.2.2
5.2.1
5.2.0
5.1.0
- FIX(android_intent_plus): remove package name from AndroidManifest (#3033). (af2f4afa)
- FEAT(android_intent_plus): support for intent as URI (#2970). (e4530870)
- REFACTOR(all): Remove website files, configs, mentions (#3018). (ecc57146)
- FIX(all): changed homepage url in pubspec.yaml (#3099). (66613656)
5.0.2
- REFACTOR(android_intent_plus): Migrate Android example to use the new plugins declaration (#2773). (7c2de04d)
5.0.1
Plugin now requires the following:
-
compileSDK 34
-
Java 17
-
Gradle 8.4
-
BREAKING BUILD(android_intent_plus): Target Java 17 (#2724). (c66a67d)
-
BREAKING BUILD(android_intent_plus): Update to target and compile SDK 34 (#2711). (fd48920)
5.0.0
Note: This release was retracted due to (#2251).
4.0.3
- FIX(android_intent_plus): Fix annotation dependency declaration (#2237). (795a3dd8)
- FIX(android_intent_plus): Revert bump compileSDK to 34 (#2236). (38bba0eb)
4.0.2
4.0.1
4.0.0
Note: This release has breaking changes.
- CHORE(android_intent_plus): Update Flutter dependencies, set Flutter >=3.3.0 and Dart to >=2.18.0 <4.0.0
- BREAKING FIX(all): Add support of namespace property to support Android Gradle Plugin (AGP) 8 (#1727). Projects with AGP < 4.2 are not supported anymore. It is highly recommended to update at least to AGP 7.0 or newer.
- BREAKING CHORE(android_intent_plus): Bump min Android version to 4.4 (API 19) (#1784).
- REFACTOR(android_intent_plus): Update example app to use Material 3.
3.1.9
- FIX(all): Revert addition of namespace to avoid build fails on old AGPs (#1725).
3.1.8
- FIX(android_intent_plus): Add compatibility with AGP 8 (Android Gradle Plugin) (#1699).
3.1.7
- REFACTOR(all): Remove all manual dependency_overrides (#1628).
- FIX(all): Fix depreciations for flutter 3.7 and 2.19 dart (#1529).
3.1.6
- DOCS: Updates for READMEs and website pages (#1389).
3.1.5
- FIX: lint warnings - add missing dependency for tests (#1233).
3.1.4
- DOCS: Add documentation for canResolveActivity.
3.1.3
- CHORE: Version tagging using melos.
3.1.2
- Fix explicit intent fallback to implicit
- Update Android Gradle plugin and Gradle verion
3.1.1+1
- Add issue_tracker link.
3.1.1
- Fix embedding issue in example
- Update Platform dependency to not use deprecated function
3.1.0
- Added
arrayArgumentsto explicitly pass array values to an intent
3.0.2
- Fixed the buildIntent method to do not set the pacakage to null if it's not resolvable
- Updated the example of resolving intent with explicitly defined package name
3.0.1
- Upgrade dependencies and Android compile version
- Remove some leftover code of Android v1 embedding
3.0.0
- Remove deprecated method
registerWith(of Android v1 embedding)
2.1.0
- migrate integration_test to flutter sdk
2.0.0
- increase flutter SDK version to 1.20.0
1.0.3
- clean up ios folder
- rename channel name to dev.fluttercommunity.plus in java tests
1.0.2
- Android: migrate to mavenCentral
1.0.1
- Improve documentation
1.0.0
- Null safety support.
0.4.2
- Add launchChooser method, which uses Intent.createChooser internally.
- Add sendBroadcast method, which uses context.sendBroadcast() internally.
0.4.1
- Renamed Method Channel and changed Java package to avoid collision with android_intent
0.4.0
- Transfer to plus-plugins monorepo
0.3.8
- Transfer package to Flutter Community under new name
android_intent_plus.
0.3.7+2
- Declare API stability and compatibility with
1.0.0(more details at: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0).
0.3.7+1
- Fix CocoaPods podspec lint warnings.
0.3.7
- Add a
Future<bool> canResolveActivitymethod 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
actionparameter 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
- Add support for setType and setDataAndType parameters.
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.gradleto 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
invokeMethodcalls.
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.ir
flutter pub add android_intent_pluspubspec.yaml
name: android_intent_plus
description: Flutter plugin for launching Android Intents. Not supported on iOS.
version: 5.3.0
homepage: https://github.com/fluttercommunity/plus_plugins
repository: https://github.com/fluttercommunity/plus_plugins/tree/main/packages/android_intent_plus
issue_tracker: https://github.com/fluttercommunity/plus_plugins/labels/android_intent_plus
topics:
- android
- intent
- utils
environment:
sdk: ">=3.1.0 <4.0.0"
flutter: ">=3.12.0"
flutter:
plugin:
platforms:
android:
package: dev.fluttercommunity.plus.androidintent
pluginClass: AndroidIntentPlugin
dependencies:
flutter:
sdk: flutter
platform: ^3.1.0
meta: ^1.8.0
dev_dependencies:
flutter_test:
sdk: flutter
test: ^1.12.0
mockito: ^5.4.0
flutter_lints: ">=4.0.0 <6.0.0"
Version history
| Version | Published | Archive | SHA-256 |
|---|---|---|---|
| 0.0.1 | 2020-04-20T18:01:16.690994Z | Download | b7489ce2b3274f14a8d6257bf578e65c42bbaa2ae551a601d4e3437232b6b798 |
| 0.3.8 | 2020-07-19T16:42:46.681232Z | Download | f8192b874e5588422a4e87d6eb980f1ecebef2caf5961482cb1056b5cae8f475 |
| 0.4.0 | 2020-10-12T19:51:30.901536Z | Download | 807ad491d4d10a164cf973c067b6498285079364a8c8877eee4fcab6f538749b |
| 0.4.1 | 2020-12-08T09:38:38.337860Z | Download | 5c82e1d7cecfe45365b73b1ff700c1e1ee36fd2b02c548bf3915b929a16d1e4a |
| 0.4.2 | 2021-01-03T09:24:38.835830Z | Download | fe19cf4877d3c04f82e8ed7061eaba70d44390cc153bc56c3003b8a4c0fe32f0 |
| 0.5.0-nullsafety.1 | 2021-02-02T09:23:50.172542Z | Download | 414c5b5f7170d89d17a2082ba6850f39f925ee2218bf1b52e5da93a06a27b2a9 |
| 1.0.0 | 2021-03-02T11:04:38.268392Z | Download | 384782cd7ece906e3c1fcbf03d41d579698377962041dd60bdb28041c1a8b8ef |
| 1.0.1 | 2021-04-28T18:06:09.764430Z | Download | 4337b1a91de952e77d66c6ddc114284a77a15dff25321256a572dd098d26c837 |
| 1.0.2 | 2021-06-15T09:12:48.788671Z | Download | e49b4d9e26135dd7ef83606aac56bd3105345e8243de903939a15c5aa07cc0ec |
| 2.0.0 | 2021-08-20T06:31:11.454923Z | Download | 04a637d52550321b9a080987e27dccf197740b4c653f7a600b053a0ff060782d |
| 2.1.0 | 2021-10-01T18:34:57.312165Z | Download | 4ccbb7742de09159a0d22d57c3d59fa46806382a5c27dcfdb95e447ceb18a5a6 |
| 3.0.0 | 2021-10-05T08:31:25.864008Z | Download | ca54790dde0cce7fbbfabce350e96a72a70adc7467cc064ddba22ff9f994c2c4 |
| 3.0.1 | 2021-10-05T15:36:16.001456Z | Download | d5f5bdb6565c998b8e4baf0d941fd9e46a8f6a0ef470eb6a661d917abbf9fb8a |
| 3.0.2 | 2021-11-01T12:37:26.726627Z | Download | 0d0eeb73667714c692ca59e69cef66a1fbb9dd63d31cc0f6efeaf31277d380ed |
| 3.1.0 | 2022-01-21T13:37:18.674035Z | Download | a4152542ca450762cc3057d9873fee8a3483dd19203a69af614cb2fb46191d00 |
| 3.1.1 | 2022-02-16T10:47:53.350489Z | Download | d696e3909f41b1e89e3e361c7b06281bbf18694beb731e7669246bfdd2e56fff |
| 3.1.1+1 | 2022-08-10T05:45:53.918201Z | Download | 7e99de047c050ef76ef81e6776de6afaf12a823e8c013845474f25357015e1f6 |
| 3.1.2 | 2022-10-03T08:18:23.530962Z | Download | ac19c05a6489cbd592c136e0b656fc12870bacdb01f82955a023edcaeadfefc5 |
| 3.1.3 | 2022-10-07T06:14:54.834146Z | Download | 2218670da5af8acc20db5b809d4ebbf773ca80d07a623785664e496999e3298b |
| 3.1.4 | 2022-10-10T14:37:21.185288Z | Download | 36d225cd050db0de62903acbe0661cb25f9e08fc02bec0b931c325e67f6e20b4 |
| 3.1.5 | 2022-10-18T05:59:26.140620Z | Download | ebd110b60723334bdc6eeb373116d6c52e9bed8feb9dcbd9f034531f56636e31 |
| 3.1.6 | 2023-02-09T14:14:32.525240Z | Download | 54810cb33945c2c10742cd746ea994822c115e9dbe189919bc63cb436e45a6af |
| 3.1.7 | 2023-04-10T19:36:05.420778Z | Download | 6bcdcd20461ac7a0c785f6298cdda96ad275d5bcbc1ecf28829cbe03ec6690be |
| 3.1.8 | 2023-04-26T07:16:15.379539Z | Download | 28a665a6cd505a03ba480d78a36a1959c24de0c32083dd1e82766c99299cfca3 |
| 3.1.9 | 2023-04-27T15:05:27.871107Z | Download | 04cbc7c332a6f0bba88fed354de78813e9d24049c1800aaf10f449c7adc22603 |
| 4.0.0 | 2023-05-09T12:46:12.556606Z | Download | f79fbb8ccb64b5584d19caa9c3d15613bf21cfbd829a6ca7f089fb5dfd43f8aa |
| 4.0.1 | 2023-05-19T06:36:27.568337Z | Download | 2c87d8330ba5deef5fe20e77f4d178190b3b24531dce08368030ab4be40a9d4e |
| 4.0.2 | 2023-08-02T12:08:49.834430Z | Download | f72ae20bb37108694f442e7ae6acbd28b453ca62ce86842f6787b784355abfe6 |
| 4.0.3 | 2023-10-10T21:58:27.629255Z | Download | e1c62bb41c90e15083b7fb84dc327fe90396cc9c1445b55ff1082144fabfb4d9 |
| 5.0.0 | 2023-10-09T08:41:41.713019Z | Download | bfb29839be3886fa48faa631aa0123cd8531205df1abb80ee804935c75dd3cdb |
| 5.0.1 | 2024-03-20T11:16:30.612587Z | Download | e92d14009f3f6ebafca6a601958aaebb793559fb03a1961fe3c5596db95af2cb |
| 5.0.2 | 2024-04-08T19:52:58.267309Z | Download | 2bfdbee8d65e7c26f88b66f0a91f2863da4d3596d8a658b4162c8de5cf04b074 |
| 5.1.0 | 2024-07-29T10:41:30.623080Z | Download | 007703c1b2cac7ca98add3336b98cffa4baa11d5133cc463293dba9daa39cdf6 |
| 5.2.0 | 2024-10-17T14:48:38.739923Z | Download | 38921ec22ebb3b9a7eb678792cf6fab0b6f458b61b9d327688573449c9b47db3 |
| 5.2.1 | 2024-12-12T15:24:30.334352Z | Download | 53136214d506d3128c9f4e5bfce3d026abe7e8038958629811a8d3223b1757c1 |
| 5.2.2 | 2025-01-14T08:09:53.569921Z | Download | 884b01361fe3756c4abbb56a382a00b16a2519079794a585afa7019a73cc0add |
| 5.3.0 | 2025-02-03T19:02:01.818249Z | Download | dfc1fd3a577205ae8f11e990fb4ece8c90cceabbee56fcf48e463ecf0bd6aae3 |
| 5.3.1 | 2025-08-11T20:20:33.808148Z | Download | 2329378af63f49b985cb2e110ac784d08374f1e2b1984be77ba9325b1c8cce11 |
| 6.0.0 | 2025-09-11T10:39:29.927362Z | Download | 14a9f94c5825a528e8c38ee89a33dbeba947efbbf76f066c174f4f3ae4f48feb |
| 6.1.0 | 2026-07-23T21:33:07.172267Z | Download | 4d4bbd619d698cbee3c400ba89246ecb0f525146b0ae05389f62ede47abd5bec |
Dependencies
flutter {
"sdk": "flutter"
}
meta "^1.8.0"
platform "^3.1.0"