Android 14 Sharesheet custom actions and improved ranking
日付:2023/04/18
URL:https://developer.android.com/about/versions/14/features#sharesheet-improvements
調査者:chigichan24
カテゴリ:Android 14
一言で表すと
Android14 では sharesheet が更新され、custom app actions がサポートされた。ユーザにとってより有益なプレビューを出せるようになった。
概要
Add custom actions
custom action を渡すことができる。
custom action を作るには、ChooserActionBuilder でChooserActionを作る必要がある
https://developer.android.com/reference/android/service/chooser/ChooserAction.Builder
Builderには、icon: Icon、label: CharSequenece 、action: PendingIntent を渡す感じっぽい
ChooserActionをIntent.EXTRA_CHOOSER_CUSTOM_ACTIONS と一緒に渡して、intent をつくればよいっぽい。
demo : https://github.com/chigichan24/custom-actions-demo
Improve ranking of Direct Share targets
よりユーザにとって有益なpreviewをだすために、アプリ側が以下のメソッドを呼ぶことで、効果的なpreviewに寄与できるかも?と書いているように見える。
To provide the most useful signal for ranking, report the shortcut usage by calling pushDynamicShortcut
and attach the corresponding capability "actions.intent.SEND_MESSAGE" to that shortcut by calling ShortcutInfoCompat.Builder#addCapabilityBinding("actions.intent.SEND_MESSAGE").
気になるポイント
メモ
コメント