Skip to content

Commit

Permalink
Added support for android view intent action
Browse files Browse the repository at this point in the history
  • Loading branch information
Liloupar committed Jan 8, 2024
1 parent 28e1ed9 commit 3ed33f2
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,20 @@ class ShareHandlerPlugin: FlutterPlugin, Messages.ShareHandlerApi, EventChannel.
null
}
}
(intent.type?.startsWith("text") != true)
&& intent.action == Intent.ACTION_VIEW -> { // Opening URL
attachments = attachmentsFromIntent(intent)
text = null
}
(intent.type == null || intent.type?.startsWith("text") == true)
&& intent.action == Intent.ACTION_VIEW -> { // Sharing text
text = intent.getStringExtra(Intent.EXTRA_TEXT)
attachments = if (text == null) {
attachmentsFromIntent(intent)
} else {
null
}
}
intent.action == Intent.ACTION_VIEW -> { // Opening URL
attachments = null
text = intent.dataString
Expand Down

0 comments on commit 3ed33f2

Please sign in to comment.