Skip to content

Commit

Permalink
Fixes #16. Fix to allow sharing .txt files to app in Android. Updated…
Browse files Browse the repository at this point in the history
… gradle plugin and kotlin version in example project.
  • Loading branch information
JoshJuncker committed Jul 7, 2022
1 parent ff9374e commit 8d7a5b6
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 7 deletions.
2 changes: 2 additions & 0 deletions share_handler/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# 0.0.11
Fix for receiving shared .txt files on Android
# 0.0.10
Update example to use the latest README instructions
# 0.0.9
Expand Down
4 changes: 2 additions & 2 deletions share_handler/example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
buildscript {
ext.kotlin_version = '1.6.21'
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.2.0'
classpath 'com.android.tools.build:gradle:7.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand Down
6 changes: 3 additions & 3 deletions share_handler/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: share_handler
description: A Flutter plugin to handle incoming shared text/media, as well as add share to suggestions/shortcuts.
repository: https://github.com/AboutShout/share_handler/tree/main/share_handler
version: 0.0.10
version: 0.0.11

environment:
sdk: ">=2.14.0 <3.0.0"
Expand All @@ -26,9 +26,9 @@ flutter:
dependencies:
flutter:
sdk: flutter
share_handler_android: ^0.0.5
share_handler_android: ^0.0.6
# share_handler_android:
# path: ../share_handler_android
# path: ../share_handler_android
share_handler_ios: ^0.0.6
# share_handler_ios:
# path: ../share_handler_ios
Expand Down
2 changes: 2 additions & 0 deletions share_handler_android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# 0.0.6
Fix for receiving shared .txt files
# 0.0.5
Fix to decode file paths in case of platform encoded paths
Added documentation to model attributes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,12 @@ class ShareHandlerPlugin: FlutterPlugin, Messages.ShareHandlerApi, EventChannel.
}
(intent.type == null || intent.type?.startsWith("text") == true)
&& intent.action == Intent.ACTION_SEND -> { // Sharing text
attachments = null
text = intent.getStringExtra(Intent.EXTRA_TEXT)
attachments = if (text == null) {
attachmentsFromIntent(intent)
} else {
null
}
}
intent.action == Intent.ACTION_VIEW -> { // Opening URL
attachments = null
Expand Down
2 changes: 1 addition & 1 deletion share_handler_android/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: share_handler_android
description: An implementation for the Android platform of the Flutter share_handler plugin.
repository: https://github.com/AboutShout/share_handler/tree/main/share_handler_android
version: 0.0.5
version: 0.0.6

environment:
sdk: ">=2.14.0 <3.0.0"
Expand Down

0 comments on commit 8d7a5b6

Please sign in to comment.