Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/tizen_app_control/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

* Update minimum Flutter and Dart version to 3.13 and 3.1.
* Update code format.
* Add YouTube app launch to the example.

## 0.2.3

Expand Down
18 changes: 18 additions & 0 deletions packages/tizen_app_control/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,19 @@ class _MyAppState extends State<MyApp> {
_localPort?.unregister();
}

Future<void> _launchYoutube() async {
const String videoId = 'N7J4hdrvsZA';
final AppControl request = AppControl(
appId: 'com.samsung.tv.cobalt-yt',
operation: 'http://tizen.org/appcontrol/operation/default',
extraData: <String, dynamic>{
'PAYLOAD': '#watch?v=$videoId&launch=launcher',
},
);

await request.sendLaunchRequest();
}

Future<void> _sendSms() async {
final AppControl request = AppControl(
operation: 'http://tizen.org/appcontrol/operation/share_text',
Expand Down Expand Up @@ -183,6 +196,11 @@ class _MyAppState extends State<MyApp> {
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
ElevatedButton(
onPressed: _launchYoutube,
child: const Text('Launch Youtube App (Only TV)'),
),
const SizedBox(height: 10),
ElevatedButton(
onPressed: _sendSms,
child: const Text('Send SMS (No TV)'),
Expand Down
Loading