diff --git a/.github/labeler.yml b/.github/labeler.yml
index 6b1a79cd4..61ee87b3f 100644
--- a/.github/labeler.yml
+++ b/.github/labeler.yml
@@ -9,6 +9,8 @@
- packages/connectivity_plus/**/*
"p: device_info_plus":
- packages/device_info_plus/**/*
+"p: flutter_app_badger":
+ - packages/flutter_app_badger/**/*
"p: flutter_secure_storage":
- packages/flutter_secure_storage/**/*
"p: flutter_tts":
@@ -65,6 +67,8 @@
- packages/wearable_rotary/**/*
"p: webview_flutter":
- packages/webview_flutter/**/*
+"p: webview_flutter_lwe":
+ - packages/webview_flutter_lwe/**/*
# Tools
"tools":
diff --git a/.github/recipe.yaml b/.github/recipe.yaml
index 8c93c41b8..e26a107fe 100644
--- a/.github/recipe.yaml
+++ b/.github/recipe.yaml
@@ -3,9 +3,9 @@ plugins:
battery_plus: ["wearable-5.5"]
connectivity_plus: ["wearable-5.5", "tv-6.5"]
device_info_plus: ["wearable-5.5", "tv-6.5"]
+ flutter_app_badger: ["wearable-5.5"]
flutter_secure_storage: ["wearable-5.5", "tv-6.5"]
flutter_tts: ["wearable-5.5", "tv-6.5"]
- google_sign_in: ["wearable-5.5", "tv-6.5"]
integration_test: ["wearable-5.5", "tv-6.5"]
messageport: ["wearable-5.5", "tv-6.5"]
package_info_plus: ["wearable-5.5", "tv-6.5"]
@@ -26,8 +26,10 @@ plugins:
google_maps_flutter: []
network_info_plus: []
webview_flutter: []
+ webview_flutter_lwe: []
# No tests.
+ google_sign_in: []
image_picker: []
tizen_log: []
tizen_notification: []
diff --git a/README.md b/README.md
index 3a3062e28..5049dacf8 100644
--- a/README.md
+++ b/README.md
@@ -16,23 +16,24 @@ The _"non-endorsed"_ status means that the plugin is not endorsed by the origina
|-|-|:-:|:-:|
| [**audioplayers_tizen**](packages/audioplayers) | [audioplayers](https://github.com/luanpotter/audioplayers) (3rd-party) | [](https://pub.dev/packages/audioplayers_tizen) | No |
| [**battery_plus_tizen**](packages/battery_plus) | [battery_plus](https://github.com/fluttercommunity/plus_plugins/tree/main/packages/battery_plus) (1st-party) | [](https://pub.dev/packages/battery_plus_tizen) | No |
-| [**camera_tizen**](packages/camera) | [camera](https://github.com/flutter/plugins/tree/master/packages/camera) (1st-party) | [](https://pub.dev/packages/camera_tizen) | No |
+| [**camera_tizen**](packages/camera) | [camera](https://github.com/flutter/plugins/tree/main/packages/camera) (1st-party) | [](https://pub.dev/packages/camera_tizen) | No |
| [**connectivity_plus_tizen**](packages/connectivity_plus) | [connectivity_plus](https://github.com/fluttercommunity/plus_plugins/tree/main/packages/connectivity_plus) (1st-party) | [](https://pub.dev/packages/connectivity_plus_tizen) | No |
| [**device_info_plus_tizen**](packages/device_info_plus) | [device_info_plus](https://github.com/fluttercommunity/plus_plugins/tree/main/packages/device_info_plus) (1st-party) | [](https://pub.dev/packages/device_info_plus_tizen) | No |
+| [**flutter_app_badger_tizen**](packages/flutter_app_badger) | [flutter_app_badger](https://github.com/g123k/flutter_app_badger) (3rd-party) | [](https://pub.dev/packages/flutter_app_badger_tizen) | No |
| [**flutter_secure_storage_tizen**](packages/flutter_secure_storage) | [flutter_secure_storage](https://github.com/mogol/flutter_secure_storage) (3rd-party) | [](https://pub.dev/packages/flutter_secure_storage_tizen) | No |
| [**flutter_tts_tizen**](packages/flutter_tts) | [flutter_tts](https://github.com/dlutton/flutter_tts) (3rd-party) | [](https://pub.dev/packages/flutter_tts_tizen) | No |
| [**geolocator_tizen**](packages/geolocator) | [geolocator](https://github.com/Baseflow/flutter-geolocator/tree/master/geolocator) (3rd-party) | [](https://pub.dev/packages/geolocator_tizen) | No |
-| [**google_maps_flutter_tizen**](packages/google_maps_flutter) | [google_maps_flutter](https://github.com/flutter/plugins/tree/master/packages/google_maps_flutter) (1st-party) | [](https://pub.dev/packages/google_maps_flutter_tizen) | No |
-| [**google_sign_in_tizen**](packages/google_sign_in) | [google_sign_in](https://github.com/flutter/plugins/tree/master/packages/google_sign_in) (1st-party) | [](https://pub.dev/packages/google_sign_in_tizen) | No |
-| [**image_picker_tizen**](packages/image_picker) | [image_picker](https://github.com/flutter/plugins/tree/master/packages/image_picker) (1st-party) | [](https://pub.dev/packages/image_picker_tizen) | No |
-| [**integration_test_tizen**](packages/integration_test) | [integration_test](https://github.com/flutter/flutter/tree/master/packages/integration_test) (1st-party) | [](https://pub.dev/packages/integration_test_tizen) | No |
+| [**google_maps_flutter_tizen**](packages/google_maps_flutter) | [google_maps_flutter](https://github.com/flutter/plugins/tree/main/packages/google_maps_flutter) (1st-party) | [](https://pub.dev/packages/google_maps_flutter_tizen) | No |
+| [**google_sign_in_tizen**](packages/google_sign_in) | [google_sign_in](https://github.com/flutter/plugins/tree/main/packages/google_sign_in) (1st-party) | [](https://pub.dev/packages/google_sign_in_tizen) | No |
+| [**image_picker_tizen**](packages/image_picker) | [image_picker](https://github.com/flutter/plugins/tree/main/packages/image_picker) (1st-party) | [](https://pub.dev/packages/image_picker_tizen) | No |
+| [**integration_test_tizen**](packages/integration_test) | [integration_test](https://github.com/flutter/flutter/tree/main/packages/integration_test) (1st-party) | [](https://pub.dev/packages/integration_test_tizen) | No |
| [**messageport_tizen**](packages/messageport) | (Tizen-only) | [](https://pub.dev/packages/messageport_tizen) | N/A |
| [**network_info_plus_tizen**](packages/network_info_plus) | [network_info_plus](https://github.com/fluttercommunity/plus_plugins/tree/main/packages/network_info_plus) (1st-party) | [](https://pub.dev/packages/network_info_plus_tizen) | No |
| [**package_info_plus_tizen**](packages/package_info_plus) | [package_info_plus](https://github.com/fluttercommunity/plus_plugins/tree/main/packages/package_info_plus) (1st-party) | [](https://pub.dev/packages/package_info_plus_tizen) | No |
-| [**path_provider_tizen**](packages/path_provider) | [path_provider](https://github.com/flutter/plugins/tree/master/packages/path_provider) (1st-party) | [](https://pub.dev/packages/path_provider_tizen) | No |
+| [**path_provider_tizen**](packages/path_provider) | [path_provider](https://github.com/flutter/plugins/tree/main/packages/path_provider) (1st-party) | [](https://pub.dev/packages/path_provider_tizen) | No |
| [**permission_handler_tizen**](packages/permission_handler) | [permission_handler](https://github.com/Baseflow/flutter-permission-handler) (3rd-party) | [](https://pub.dev/packages/permission_handler_tizen) | No |
| [**sensors_plus_tizen**](packages/sensors_plus) | [sensors_plus](https://github.com/fluttercommunity/plus_plugins/tree/main/packages/sensors_plus) (1st-party) | [](https://pub.dev/packages/sensors_plus_tizen) | No |
-| [**shared_preferences_tizen**](packages/shared_preferences) | [shared_preferences](https://github.com/flutter/plugins/tree/master/packages/shared_preferences) (1st-party) | [](https://pub.dev/packages/shared_preferences_tizen) | No |
+| [**shared_preferences_tizen**](packages/shared_preferences) | [shared_preferences](https://github.com/flutter/plugins/tree/main/packages/shared_preferences) (1st-party) | [](https://pub.dev/packages/shared_preferences_tizen) | No |
| [**sqflite_tizen**](packages/sqflite) | [sqflite](https://github.com/tekartik/sqflite) (3rd-party) | [](https://pub.dev/packages/sqflite_tizen) | No |
| [**tizen_app_control**](packages/tizen_app_control) | (Tizen-only) | [](https://pub.dev/packages/tizen_app_control) | N/A |
| [**tizen_app_manager**](packages/tizen_app_manager) | (Tizen-only) | [](https://pub.dev/packages/tizen_app_manager) | N/A |
@@ -42,11 +43,12 @@ The _"non-endorsed"_ status means that the plugin is not endorsed by the origina
| [**tizen_notification**](packages/tizen_notification) | (Tizen-only) | [](https://pub.dev/packages/tizen_notification) | N/A |
| [**tizen_package_manager**](packages/tizen_package_manager) | (Tizen-only) | [](https://pub.dev/packages/tizen_package_manager) | N/A |
| [**tizen_rpc_port**](packages/tizen_rpc_port) | (Tizen-only) | [](https://pub.dev/packages/tizen_rpc_port) | N/A |
-| [**url_launcher_tizen**](packages/url_launcher) | [url_launcher](https://github.com/flutter/plugins/tree/master/packages/url_launcher) (1st-party) | [](https://pub.dev/packages/url_launcher_tizen) | No |
-| [**video_player_tizen**](packages/video_player) | [video_player](https://github.com/flutter/plugins/tree/master/packages/video_player) (1st-party) | [](https://pub.dev/packages/video_player_tizen) | No |
+| [**url_launcher_tizen**](packages/url_launcher) | [url_launcher](https://github.com/flutter/plugins/tree/main/packages/url_launcher) (1st-party) | [](https://pub.dev/packages/url_launcher_tizen) | No |
+| [**video_player_tizen**](packages/video_player) | [video_player](https://github.com/flutter/plugins/tree/main/packages/video_player) (1st-party) | [](https://pub.dev/packages/video_player_tizen) | No |
| [**wakelock_tizen**](packages/wakelock) | [wakelock](https://github.com/creativecreatorormaybenot/wakelock) (3rd-party) | [](https://pub.dev/packages/wakelock_tizen) | No |
| [**wearable_rotary**](packages/wearable_rotary) | (Tizen-only) | [](https://pub.dev/packages/wearable_rotary) | N/A |
-| [**webview_flutter_tizen**](packages/webview_flutter) | [webview_flutter](https://github.com/flutter/plugins/tree/master/packages/webview_flutter) (1st-party) | [](https://pub.dev/packages/webview_flutter_tizen) | No |
+| [**webview_flutter_lwe**](packages/webview_flutter_lwe) | [webview_flutter](https://github.com/flutter/plugins/tree/main/packages/webview_flutter) (1st-party) | [](https://pub.dev/packages/webview_flutter_lwe) | No |
+| [**webview_flutter_tizen**](packages/webview_flutter) | [webview_flutter](https://github.com/flutter/plugins/tree/main/packages/webview_flutter) (1st-party) | [](https://pub.dev/packages/webview_flutter_tizen) | No |
## Device limitations
@@ -57,6 +59,7 @@ The _"non-endorsed"_ status means that the plugin is not endorsed by the origina
| [**camera_tizen**](packages/camera) | 4.0 | ❌ | ❌ | ❌ | ❌ | No camera |
| [**connectivity_plus_tizen**](packages/connectivity_plus) | 4.0 | ✔️ | ⚠️ | ✔️ | ✔️ | Returns incorrect connection status |
| [**device_info_plus_tizen**](packages/device_info_plus) | 4.0 | ✔️ | ✔️ | ✔️ | ✔️ |
+| [**flutter_app_badger_tizen**](packages/flutter_app_badger) | 4.0 | ✔️ | ✔️ | ❌ | ❌ | API not supported |
| [**flutter_secure_storage_tizen**](packages/flutter_secure_storage) | 4.0 | ✔️ | ✔️ | ✔️ | ✔️ |
| [**flutter_tts_tizen**](packages/flutter_tts) | 4.0 | ✔️ | ✔️ | ✔️ | ✔️ |
| [**geolocator_tizen**](packages/geolocator) | 4.0 | ✔️ | ✔️ | ❌ | ❌ | Not applicable for TV |
@@ -84,4 +87,6 @@ The _"non-endorsed"_ status means that the plugin is not endorsed by the origina
| [**video_player_tizen**](packages/video_player) | 4.0 | ✔️ | ✔️ | ⚠️ | ❌ | Functional limitations, TV emulator issue |
| [**wakelock_tizen**](packages/wakelock) | 4.0 | ✔️ | ✔️ | ❌ | ❌ | Cannot override system settings |
| [**wearable_rotary**](packages/wearable_rotary) | 4.0 | ✔️ | ✔️ | ❌ | ❌ | Not applicable for TV |
-| [**webview_flutter_tizen**](packages/webview_flutter) | 5.5 | ✔️ | ✔️ | ✔️ | ✔️ | Not for production use |
+| [**webview_flutter_lwe**](packages/webview_flutter_lwe) | 5.5 | ✔️ | ✔️ | ✔️ | ✔️ | Not for production use |
+| [**webview_flutter_tizen**](packages/webview_flutter) | 5.5 | ❌ | ❌ | ✔️ | ✔️ | API not supported |
+
diff --git a/packages/camera/README.md b/packages/camera/README.md
index b66275d00..8e2747413 100644
--- a/packages/camera/README.md
+++ b/packages/camera/README.md
@@ -2,7 +2,7 @@
[](https://pub.dev/packages/camera_tizen)
-The Tizen implementation of [`camera`](https://github.com/flutter/plugins/tree/master/packages/camera).
+The Tizen implementation of [`camera`](https://github.com/flutter/plugins/tree/main/packages/camera).
## Supported devices
diff --git a/packages/flutter_app_badger/.gitignore b/packages/flutter_app_badger/.gitignore
new file mode 100644
index 000000000..96486fd93
--- /dev/null
+++ b/packages/flutter_app_badger/.gitignore
@@ -0,0 +1,30 @@
+# Miscellaneous
+*.class
+*.log
+*.pyc
+*.swp
+.DS_Store
+.atom/
+.buildlog/
+.history
+.svn/
+migrate_working_dir/
+
+# IntelliJ related
+*.iml
+*.ipr
+*.iws
+.idea/
+
+# The .vscode folder contains launch configuration and tasks you configure in
+# VS Code which you may wish to be included in version control, so this line
+# is commented out by default.
+#.vscode/
+
+# Flutter/Dart/Pub related
+# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
+/pubspec.lock
+**/doc/api/
+.dart_tool/
+.packages
+build/
diff --git a/packages/flutter_app_badger/CHANGELOG.md b/packages/flutter_app_badger/CHANGELOG.md
new file mode 100644
index 000000000..607323422
--- /dev/null
+++ b/packages/flutter_app_badger/CHANGELOG.md
@@ -0,0 +1,3 @@
+## 0.1.0
+
+* Initial release.
diff --git a/packages/flutter_app_badger/LICENSE b/packages/flutter_app_badger/LICENSE
new file mode 100644
index 000000000..487f7b1dc
--- /dev/null
+++ b/packages/flutter_app_badger/LICENSE
@@ -0,0 +1,25 @@
+Copyright (c) 2022 Samsung Electronics Co., Ltd. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the names of the copyright holders nor the names of the
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/packages/flutter_app_badger/README.md b/packages/flutter_app_badger/README.md
new file mode 100644
index 000000000..0a3d8cc29
--- /dev/null
+++ b/packages/flutter_app_badger/README.md
@@ -0,0 +1,45 @@
+# flutter_app_badger_tizen
+
+[](https://pub.dev/packages/flutter_app_badger_tizen)
+
+The Tizen implementation of [`flutter_app_badger`](https://github.com/g123k/flutter_app_badger).
+
+## Usage
+
+ This package is not an _endorsed_ implementation of `flutter_app_badger`. Therefore, you have to include `flutter_app_badger_tizen` alongside `flutter_app_badger` as dependencies in your `pubspec.yaml` file.
+
+ ```yaml
+dependencies:
+ flutter_app_badger: ^1.5.0
+ flutter_app_badger_tizen: ^0.1.0
+```
+
+Then you can import `flutter_app_badger` in your Dart code:
+
+```dart
+import 'package:flutter_app_badger/flutter_app_badger.dart';
+```
+
+For detailed usage, see https://pub.dev/packages/flutter_app_badger#getting-started.
+
+## Required privileges
+
+To use this plugin, you need to declare privileges in `tizen-manifest.xml` of your application.
+
+``` xml
+
+ http://tizen.org/privilege/notification
+
+```
+
+## Supported devices
+
+- Galaxy Watch series (running Tizen 4.0 or later)
+
+## Notes
+
+You need to declare the following feature in your `tizen-manifest.xml` if you plan to release your app on the app store (to enable [feature-based filtering](https://docs.tizen.org/application/native/tutorials/details/app-filtering)).
+
+```xml
+
+```
diff --git a/packages/flutter_app_badger/example/.gitignore b/packages/flutter_app_badger/example/.gitignore
new file mode 100644
index 000000000..ad3c2ca04
--- /dev/null
+++ b/packages/flutter_app_badger/example/.gitignore
@@ -0,0 +1,42 @@
+# Miscellaneous
+*.class
+*.log
+*.pyc
+*.swp
+.DS_Store
+.atom/
+.buildlog/
+.history
+.svn/
+migrate_working_dir/
+
+# IntelliJ related
+*.iml
+*.ipr
+*.iws
+.idea/
+
+# VS Code related
+.vscode/
+
+# Flutter/Dart/Pub related
+**/doc/api/
+**/ios/Flutter/.last_build_id
+.dart_tool/
+.flutter-plugins
+.flutter-plugins-dependencies
+.packages
+.pub-cache/
+.pub/
+/build/
+
+# Symbolication related
+app.*.symbols
+
+# Obfuscation related
+app.*.map.json
+
+# Android Studio will place build artifacts here
+/android/app/debug
+/android/app/profile
+/android/app/release
diff --git a/packages/flutter_app_badger/example/LICENSE b/packages/flutter_app_badger/example/LICENSE
new file mode 100644
index 000000000..e72929ee9
--- /dev/null
+++ b/packages/flutter_app_badger/example/LICENSE
@@ -0,0 +1,202 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
\ No newline at end of file
diff --git a/packages/flutter_app_badger/example/README.md b/packages/flutter_app_badger/example/README.md
new file mode 100644
index 000000000..6de52f167
--- /dev/null
+++ b/packages/flutter_app_badger/example/README.md
@@ -0,0 +1,7 @@
+# flutter_app_badger_tizen_example
+
+Demonstrates how to use the flutter_app_badger_tizen plugin.
+
+## Getting Started
+
+To run this app on your Tizen device, use [flutter-tizen](https://github.com/flutter-tizen/flutter-tizen).
diff --git a/packages/flutter_app_badger/example/analysis_options.yaml b/packages/flutter_app_badger/example/analysis_options.yaml
new file mode 100644
index 000000000..f9b303465
--- /dev/null
+++ b/packages/flutter_app_badger/example/analysis_options.yaml
@@ -0,0 +1 @@
+include: package:flutter_lints/flutter.yaml
diff --git a/packages/flutter_app_badger/example/integration_test/flutter_app_badger_test.dart b/packages/flutter_app_badger/example/integration_test/flutter_app_badger_test.dart
new file mode 100644
index 000000000..04fb84475
--- /dev/null
+++ b/packages/flutter_app_badger/example/integration_test/flutter_app_badger_test.dart
@@ -0,0 +1,23 @@
+// Copyright 2022 Samsung Electronics Co., Ltd. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import 'package:flutter_test/flutter_test.dart';
+import 'package:integration_test/integration_test.dart';
+import 'package:flutter_app_badger/flutter_app_badger.dart';
+
+void main() {
+ IntegrationTestWidgetsFlutterBinding.ensureInitialized();
+
+ testWidgets('get supported', (tester) async {
+ expect(await FlutterAppBadger.isAppBadgeSupported(), true);
+ });
+
+ testWidgets('update badge count', (tester) async {
+ await expectLater(FlutterAppBadger.updateBadgeCount(1), completes);
+ });
+
+ testWidgets('remove badge count', (tester) async {
+ await expectLater(FlutterAppBadger.removeBadge(), completes);
+ });
+}
diff --git a/packages/flutter_app_badger/example/lib/main.dart b/packages/flutter_app_badger/example/lib/main.dart
new file mode 100644
index 000000000..cbec33c2a
--- /dev/null
+++ b/packages/flutter_app_badger/example/lib/main.dart
@@ -0,0 +1,78 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_app_badger/flutter_app_badger.dart';
+
+void main() => runApp(const MyApp());
+
+class MyApp extends StatefulWidget {
+ const MyApp({super.key});
+
+ @override
+ State createState() => _MyAppState();
+}
+
+class _MyAppState extends State {
+ String _appBadgeSupported = 'Unknown';
+
+ @override
+ initState() {
+ super.initState();
+ initPlatformState();
+ }
+
+ initPlatformState() async {
+ String appBadgeSupported;
+ try {
+ bool res = await FlutterAppBadger.isAppBadgeSupported();
+ if (res) {
+ appBadgeSupported = 'Supported';
+ } else {
+ appBadgeSupported = 'Not supported';
+ }
+ } on Exception {
+ appBadgeSupported = 'Failed to get badge support.';
+ }
+
+ setState(() {
+ _appBadgeSupported = appBadgeSupported;
+ });
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return MaterialApp(
+ home: Scaffold(
+ appBar: AppBar(
+ title: const Text('Plugin example app'),
+ ),
+ body: SizedBox.expand(
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ Text('Badge supported: $_appBadgeSupported\n'),
+ ElevatedButton(
+ child: const Text('Add badge'),
+ onPressed: () {
+ _addBadge();
+ },
+ ),
+ ElevatedButton(
+ child: const Text('Remove badge'),
+ onPressed: () {
+ _removeBadge();
+ }),
+ ],
+ ),
+ ),
+ ),
+ );
+ }
+
+ void _addBadge() {
+ FlutterAppBadger.updateBadgeCount(1);
+ }
+
+ void _removeBadge() {
+ FlutterAppBadger.removeBadge();
+ }
+}
diff --git a/packages/flutter_app_badger/example/pubspec.yaml b/packages/flutter_app_badger/example/pubspec.yaml
new file mode 100644
index 000000000..955965eb4
--- /dev/null
+++ b/packages/flutter_app_badger/example/pubspec.yaml
@@ -0,0 +1,26 @@
+name: flutter_app_badger_tizen_example
+description: Demonstrates how to use the flutter_app_badger_tizen plugin.
+publish_to: "none"
+
+dependencies:
+ flutter:
+ sdk: flutter
+ flutter_app_badger: ^1.5.0
+ flutter_app_badger_tizen:
+ path: ../
+
+dev_dependencies:
+ flutter_test:
+ sdk: flutter
+ flutter_lints: ^2.0.0
+ integration_test:
+ sdk: flutter
+ integration_test_tizen:
+ path: ../../integration_test/
+
+flutter:
+ uses-material-design: true
+
+environment:
+ sdk: ">=2.17.0 <3.0.0"
+ flutter: ">=2.0.0"
diff --git a/packages/flutter_app_badger/example/tizen/.gitignore b/packages/flutter_app_badger/example/tizen/.gitignore
new file mode 100644
index 000000000..750f3af1b
--- /dev/null
+++ b/packages/flutter_app_badger/example/tizen/.gitignore
@@ -0,0 +1,5 @@
+flutter/
+.vs/
+*.user
+bin/
+obj/
diff --git a/packages/flutter_app_badger/example/tizen/App.cs b/packages/flutter_app_badger/example/tizen/App.cs
new file mode 100644
index 000000000..6dd4a6356
--- /dev/null
+++ b/packages/flutter_app_badger/example/tizen/App.cs
@@ -0,0 +1,20 @@
+using Tizen.Flutter.Embedding;
+
+namespace Runner
+{
+ public class App : FlutterApplication
+ {
+ protected override void OnCreate()
+ {
+ base.OnCreate();
+
+ GeneratedPluginRegistrant.RegisterPlugins(this);
+ }
+
+ static void Main(string[] args)
+ {
+ var app = new App();
+ app.Run(args);
+ }
+ }
+}
diff --git a/packages/flutter_app_badger/example/tizen/Runner.csproj b/packages/flutter_app_badger/example/tizen/Runner.csproj
new file mode 100644
index 000000000..f4e369d0c
--- /dev/null
+++ b/packages/flutter_app_badger/example/tizen/Runner.csproj
@@ -0,0 +1,19 @@
+
+
+
+ Exe
+ tizen40
+
+
+
+
+
+
+
+
+
+ %(RecursiveDir)
+
+
+
+
diff --git a/packages/flutter_app_badger/example/tizen/shared/res/ic_launcher.png b/packages/flutter_app_badger/example/tizen/shared/res/ic_launcher.png
new file mode 100644
index 000000000..4d6372eeb
Binary files /dev/null and b/packages/flutter_app_badger/example/tizen/shared/res/ic_launcher.png differ
diff --git a/packages/flutter_app_badger/example/tizen/tizen-manifest.xml b/packages/flutter_app_badger/example/tizen/tizen-manifest.xml
new file mode 100644
index 000000000..cc1a70e7a
--- /dev/null
+++ b/packages/flutter_app_badger/example/tizen/tizen-manifest.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+ ic_launcher.png
+
+
+
+
+
+ http://tizen.org/privilege/notification
+
+
diff --git a/packages/flutter_app_badger/pubspec.yaml b/packages/flutter_app_badger/pubspec.yaml
new file mode 100644
index 000000000..364ad8be8
--- /dev/null
+++ b/packages/flutter_app_badger/pubspec.yaml
@@ -0,0 +1,20 @@
+name: flutter_app_badger_tizen
+description: Tizen implementation of the flutter_app_badger plugin
+homepage: https://github.com/flutter-tizen/plugins
+repository: https://github.com/flutter-tizen/plugins/tree/master/packages/flutter_app_badger_tizen
+version: 0.1.0
+
+flutter:
+ plugin:
+ platforms:
+ tizen:
+ pluginClass: FlutterAppBadgerTizenPlugin
+ fileName: flutter_app_badger_tizen_plugin.h
+
+dependencies:
+ flutter:
+ sdk: flutter
+
+environment:
+ sdk: ">=2.12.0 <3.0.0"
+ flutter: ">=2.5.0"
diff --git a/packages/google_sign_in/tizen/.gitignore b/packages/flutter_app_badger/tizen/.gitignore
similarity index 100%
rename from packages/google_sign_in/tizen/.gitignore
rename to packages/flutter_app_badger/tizen/.gitignore
diff --git a/packages/flutter_app_badger/tizen/inc/flutter_app_badger_tizen_plugin.h b/packages/flutter_app_badger/tizen/inc/flutter_app_badger_tizen_plugin.h
new file mode 100644
index 000000000..9e74f5382
--- /dev/null
+++ b/packages/flutter_app_badger/tizen/inc/flutter_app_badger_tizen_plugin.h
@@ -0,0 +1,23 @@
+#ifndef FLUTTER_PLUGIN_FLUTTER_APP_BADGER_TIZEN_PLUGIN_H_
+#define FLUTTER_PLUGIN_FLUTTER_APP_BADGER_TIZEN_PLUGIN_H_
+
+#include
+
+#ifdef FLUTTER_PLUGIN_IMPL
+#define FLUTTER_PLUGIN_EXPORT __attribute__((visibility("default")))
+#else
+#define FLUTTER_PLUGIN_EXPORT
+#endif
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+FLUTTER_PLUGIN_EXPORT void FlutterAppBadgerTizenPluginRegisterWithRegistrar(
+ FlutterDesktopPluginRegistrarRef registrar);
+
+#if defined(__cplusplus)
+} // extern "C"
+#endif
+
+#endif // FLUTTER_PLUGIN_FLUTTER_APP_BADGER_TIZEN_PLUGIN_H_
diff --git a/packages/flutter_app_badger/tizen/project_def.prop b/packages/flutter_app_badger/tizen/project_def.prop
new file mode 100644
index 000000000..cf0d42916
--- /dev/null
+++ b/packages/flutter_app_badger/tizen/project_def.prop
@@ -0,0 +1,24 @@
+# See https://docs.tizen.org/application/tizen-studio/native-tools/project-conversion
+# for details.
+
+APPNAME = flutter_app_badger_tizen_plugin
+type = staticLib
+profile = common-4.0
+
+# Source files
+USER_SRCS += src/*.cc
+
+# User defines
+USER_DEFS =
+USER_UNDEFS =
+USER_CPP_DEFS = FLUTTER_PLUGIN_IMPL
+USER_CPP_UNDEFS =
+
+# Compiler flags
+USER_CFLAGS_MISC =
+USER_CPPFLAGS_MISC =
+
+# User includes
+USER_INC_DIRS = inc src
+USER_INC_FILES =
+USER_CPP_INC_FILES =
diff --git a/packages/flutter_app_badger/tizen/src/flutter_app_badger_tizen_plugin.cc b/packages/flutter_app_badger/tizen/src/flutter_app_badger_tizen_plugin.cc
new file mode 100644
index 000000000..8d69346f1
--- /dev/null
+++ b/packages/flutter_app_badger/tizen/src/flutter_app_badger_tizen_plugin.cc
@@ -0,0 +1,118 @@
+// Copyright 2022 Samsung Electronics Co., Ltd. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "flutter_app_badger_tizen_plugin.h"
+
+#include
+#include
+#include
+
+#include
+#include
+
+#include "log.h"
+#include "tizen_badge.h"
+
+namespace {
+
+typedef flutter::MethodChannel FlMethodChannel;
+typedef flutter::MethodResult FlMethodResult;
+
+template
+static bool GetValueFromEncodableMap(const flutter::EncodableMap *map,
+ const char *key, T &out) {
+ auto iter = map->find(flutter::EncodableValue(key));
+ if (iter != map->end() && !iter->second.IsNull()) {
+ if (auto *value = std::get_if(&iter->second)) {
+ out = *value;
+ return true;
+ }
+ }
+ return false;
+}
+
+class FlutterAppBadgerTizenPlugin : public flutter::Plugin {
+ public:
+ static void RegisterWithRegistrar(flutter::PluginRegistrar *registrar) {
+ auto plugin = std::make_unique(registrar);
+ registrar->AddPlugin(std::move(plugin));
+ }
+
+ FlutterAppBadgerTizenPlugin(flutter::PluginRegistrar *registrar) {
+ // FlutterAppBadgerPlugin : https://pub.dev/packages/flutter_app_badger
+ channel_ = std::make_unique(
+ registrar->messenger(), "g123k/flutter_app_badger",
+ &flutter::StandardMethodCodec::GetInstance());
+ channel_->SetMethodCallHandler([this](const auto &call, auto result) {
+ this->HandleMethodCall(call, std::move(result));
+ });
+
+ badge_ = std::make_unique();
+ if (!badge_->Initialize()) {
+ badge_ = nullptr;
+ }
+ }
+
+ virtual ~FlutterAppBadgerTizenPlugin() {}
+
+ private:
+ void HandleMethodCall(
+ const flutter::MethodCall &method_call,
+ std::unique_ptr result) {
+ const auto &method_name = method_call.method_name();
+
+ if (!badge_) {
+ result->Error(std::to_string(badge_->GetLastError()),
+ badge_->GetLastErrorString());
+ return;
+ }
+
+ if (method_name == "isAppBadgeSupported") {
+ if (badge_) {
+ result->Success(flutter::EncodableValue(true));
+ } else {
+ result->Success(flutter::EncodableValue(false));
+ }
+ } else if (method_name == "updateBadgeCount") {
+ const auto *arguments =
+ std::get_if(method_call.arguments());
+ if (!arguments) {
+ result->Error("Invalid arguments", "Invalid arguments.");
+ return;
+ }
+ int32_t count = 0;
+ if (GetValueFromEncodableMap(arguments, "count", count)) {
+ if (badge_->UpdateBadgeCount(count)) {
+ result->Success(flutter::EncodableValue(true));
+ } else {
+ result->Error(std::to_string(badge_->GetLastError()),
+ badge_->GetLastErrorString());
+ }
+ } else {
+ result->Error("Invalid arguments", "No count provided.");
+ }
+ } else if (method_name == "removeBadge") {
+ if (badge_->RemoveBadge()) {
+ result->Success(flutter::EncodableValue(true));
+ } else {
+ result->Error(std::to_string(badge_->GetLastError()),
+ badge_->GetLastErrorString());
+ }
+ } else {
+ result->NotImplemented();
+ }
+ }
+
+ std::unique_ptr badge_;
+ std::unique_ptr channel_;
+};
+
+} // namespace
+
+void FlutterAppBadgerTizenPluginRegisterWithRegistrar(
+ FlutterDesktopPluginRegistrarRef registrar) {
+ FlutterAppBadgerTizenPlugin::RegisterWithRegistrar(
+ flutter::PluginRegistrarManager::GetInstance()
+ ->GetRegistrar(registrar));
+}
diff --git a/packages/flutter_app_badger/tizen/src/log.h b/packages/flutter_app_badger/tizen/src/log.h
new file mode 100644
index 000000000..c0b5b3ede
--- /dev/null
+++ b/packages/flutter_app_badger/tizen/src/log.h
@@ -0,0 +1,24 @@
+#ifndef __LOG_H__
+#define __LOG_H__
+
+#include
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "FlutterAppBadgerTizenPlugin"
+
+#ifndef __MODULE__
+#define __MODULE__ strrchr("/" __FILE__, '/') + 1
+#endif
+
+#define LOG(prio, fmt, arg...) \
+ dlog_print(prio, LOG_TAG, "%s: %s(%d) > " fmt, __MODULE__, __func__, \
+ __LINE__, ##arg)
+
+#define LOG_DEBUG(fmt, args...) LOG(DLOG_DEBUG, fmt, ##args)
+#define LOG_INFO(fmt, args...) LOG(DLOG_INFO, fmt, ##args)
+#define LOG_WARN(fmt, args...) LOG(DLOG_WARN, fmt, ##args)
+#define LOG_ERROR(fmt, args...) LOG(DLOG_ERROR, fmt, ##args)
+
+#endif // __LOG_H__
diff --git a/packages/flutter_app_badger/tizen/src/tizen_badge.cc b/packages/flutter_app_badger/tizen/src/tizen_badge.cc
new file mode 100644
index 000000000..c4a00b7b2
--- /dev/null
+++ b/packages/flutter_app_badger/tizen/src/tizen_badge.cc
@@ -0,0 +1,89 @@
+// Copyright 2022 Samsung Electronics Co., Ltd. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "tizen_badge.h"
+
+#include "log.h"
+
+bool TizenBadge::Initialize() {
+ char *app_id = nullptr;
+ int ret = app_get_id(&app_id);
+ if (ret != APP_ERROR_NONE) {
+ LOG_ERROR("app_get_id() failed with error: %s", get_error_message(ret));
+ last_error_ = ret;
+ return false;
+ }
+ app_id_ = app_id;
+ free(app_id);
+
+ ret = badge_add(app_id_.c_str());
+ if (ret == BADGE_ERROR_NOT_SUPPORTED) {
+ LOG_INFO("Badge is not supported.");
+ is_supported_ = false;
+ last_error_ = ret;
+ } else if (ret != BADGE_ERROR_NONE && ret != BADGE_ERROR_ALREADY_EXIST) {
+ LOG_ERROR("badge_add() failed with error: %s", get_error_message(ret));
+ last_error_ = ret;
+ return false;
+ } else {
+ is_supported_ = true;
+ }
+
+ is_added_ = true;
+ return true;
+}
+
+bool TizenBadge::UpdateBadgeCount(int32_t count) {
+ if (!is_supported_) {
+ LOG_ERROR("Badge is not supported.");
+ last_error_ = BADGE_ERROR_NOT_SUPPORTED;
+ return false;
+ }
+ int ret = BADGE_ERROR_NONE;
+ if (!is_added_) {
+ ret = badge_add(app_id_.c_str());
+ if (ret != BADGE_ERROR_NONE && ret != BADGE_ERROR_ALREADY_EXIST) {
+ LOG_ERROR("badge_add() failed with error: %s", get_error_message(ret));
+ last_error_ = ret;
+ return false;
+ }
+ is_added_ = true;
+ }
+
+ ret = badge_set_count(app_id_.c_str(), count);
+ if (ret != BADGE_ERROR_NONE) {
+ LOG_ERROR("badge_set_count() failed with error: %s",
+ get_error_message(ret));
+ last_error_ = ret;
+ return false;
+ }
+
+ ret = badge_set_display(app_id_.c_str(), 1);
+ if (ret != BADGE_ERROR_NONE) {
+ LOG_ERROR("badge_set_display() failed with error: %s",
+ get_error_message(ret));
+ last_error_ = ret;
+ return false;
+ }
+ return true;
+}
+
+bool TizenBadge::RemoveBadge() {
+ if (!is_supported_) {
+ LOG_ERROR("Badge is not supported.");
+ last_error_ = BADGE_ERROR_NOT_SUPPORTED;
+ return false;
+ }
+
+ if (is_added_) {
+ int ret = badge_remove(app_id_.c_str());
+ if (ret != BADGE_ERROR_NONE) {
+ LOG_ERROR("badge_remove() failed with error: %s", get_error_message(ret));
+ last_error_ = ret;
+ return false;
+ }
+ is_added_ = false;
+ }
+ return true;
+}
diff --git a/packages/flutter_app_badger/tizen/src/tizen_badge.h b/packages/flutter_app_badger/tizen/src/tizen_badge.h
new file mode 100644
index 000000000..b635ed91a
--- /dev/null
+++ b/packages/flutter_app_badger/tizen/src/tizen_badge.h
@@ -0,0 +1,36 @@
+// Copyright 2022 Samsung Electronics Co., Ltd. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef FLUTTER_PLUGIN_TIZEN_BADGE_H_
+#define FLUTTER_PLUGIN_TIZEN_BADGE_H_
+
+#include
+#include
+
+#include
+
+class TizenBadge {
+ public:
+ ~TizenBadge() = default;
+
+ int GetLastError() { return last_error_; }
+
+ std::string GetLastErrorString() { return get_error_message(last_error_); }
+
+ bool IsSupported() { return is_supported_; };
+
+ bool Initialize();
+
+ bool UpdateBadgeCount(int32_t count);
+
+ bool RemoveBadge();
+
+ private:
+ std::string app_id_;
+ bool is_added_ = false;
+ bool is_supported_ = false;
+ int last_error_ = TIZEN_ERROR_NONE;
+};
+
+#endif // FLUTTER_PLUGIN_TIZEN_BADGE_H_
diff --git a/packages/google_maps_flutter/CHANGELOG.md b/packages/google_maps_flutter/CHANGELOG.md
index a2c5c12c7..12c93da5a 100644
--- a/packages/google_maps_flutter/CHANGELOG.md
+++ b/packages/google_maps_flutter/CHANGELOG.md
@@ -1,5 +1,6 @@
-## NEXT
+## 0.1.4
+* Change dependency from webview_flutter_tizen to webview_flutter_lwe.
* Fix integration test failures
## 0.1.3
diff --git a/packages/google_maps_flutter/pubspec.yaml b/packages/google_maps_flutter/pubspec.yaml
index b9098350f..186f81006 100644
--- a/packages/google_maps_flutter/pubspec.yaml
+++ b/packages/google_maps_flutter/pubspec.yaml
@@ -2,7 +2,7 @@ name: google_maps_flutter_tizen
description: Tizen platform implementation of google_maps_flutter
homepage: https://github.com/flutter-tizen/plugins
repository: https://github.com/flutter-tizen/plugins/tree/master/packages/google_maps_flutter
-version: 0.1.3
+version: 0.1.4
flutter:
plugin:
@@ -19,7 +19,7 @@ dependencies:
meta: ^1.3.0
stream_transform: ^2.0.0
webview_flutter: ^3.0.4
- webview_flutter_tizen: ^0.5.3
+ webview_flutter_lwe: ^0.1.0
dev_dependencies:
flutter_test:
diff --git a/packages/google_sign_in/CHANGELOG.md b/packages/google_sign_in/CHANGELOG.md
index 541fbeb16..e5fb29ddf 100644
--- a/packages/google_sign_in/CHANGELOG.md
+++ b/packages/google_sign_in/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 0.1.3
+
+* Add dependency on flutter_secure_storage_tizen.
+
## 0.1.2
* Resolve linter warnings.
diff --git a/packages/google_sign_in/README.md b/packages/google_sign_in/README.md
index 1a1c78881..996d7fcb1 100644
--- a/packages/google_sign_in/README.md
+++ b/packages/google_sign_in/README.md
@@ -2,7 +2,7 @@
[](https://pub.dev/packages/google_sign_in_tizen)
-The Tizen implementation of [`google_sign_in`](https://github.com/flutter/plugins/tree/master_archive/packages/google_sign_in/google_sign_in).
+The Tizen implementation of [`google_sign_in`](https://github.com/flutter/plugins/tree/main/packages/google_sign_in/google_sign_in).
## Usage
@@ -11,7 +11,7 @@ This package is not an _endorsed_ implementation of `google_sign_in`. Therefore,
```yaml
dependencies:
google_sign_in: ^5.4.1
- google_sign_in_tizen: ^0.1.2
+ google_sign_in_tizen: ^0.1.3
```
For detailed usage on how to use `google_sign_in`, see https://pub.dev/packages/google_sign_in#usage.
diff --git a/packages/google_sign_in/example/integration_test/secure_storage_test.dart b/packages/google_sign_in/example/integration_test/secure_storage_test.dart
deleted file mode 100644
index d13dd768c..000000000
--- a/packages/google_sign_in/example/integration_test/secure_storage_test.dart
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright 2022 Samsung Electronics Co., Ltd. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-import 'package:flutter/foundation.dart';
-import 'package:flutter_test/flutter_test.dart';
-import 'package:google_sign_in_tizen/google_sign_in_tizen.dart';
-import 'package:integration_test/integration_test.dart';
-
-void main() {
- IntegrationTestWidgetsFlutterBinding.ensureInitialized();
-
- late SecureStorage storage;
- late Map data1;
- late Map data2;
-
- setUpAll(() async {
- storage = SecureStorage();
- data1 = {
- 'key11': 'value11',
- 'key12': 12,
- };
- data2 = {
- 'key21': 'value21',
- 'key22': 22,
- };
- });
-
- tearDown(() async {
- await storage.destroy();
- });
-
- testWidgets('Can save get and remove', (WidgetTester tester) async {
- await storage.saveJson('a', data1);
- await storage.saveJson('b', data2);
-
- final Map? retrievedData1 = await storage.getJson('a');
- final Map? retrievedData2 = await storage.getJson('b');
- expect(retrievedData1, isNotNull);
- expect(retrievedData2, isNotNull);
-
- expect(true, mapEquals(data1, retrievedData1));
- expect(true, mapEquals(data2, retrievedData2));
-
- await storage.remove('a');
- await storage.remove('b');
-
- expect(await storage.getJson('a'), isNull);
- expect(await storage.getJson('b'), isNull);
- });
-}
diff --git a/packages/google_sign_in/lib/google_sign_in_tizen.dart b/packages/google_sign_in/lib/google_sign_in_tizen.dart
index a2af24df3..fd602951a 100644
--- a/packages/google_sign_in/lib/google_sign_in_tizen.dart
+++ b/packages/google_sign_in/lib/google_sign_in_tizen.dart
@@ -2,18 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-import 'dart:convert' as convert;
+import 'dart:convert';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
+import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:google_sign_in_platform_interface/google_sign_in_platform_interface.dart';
import 'src/device_flow_widget.dart' as device_flow_widget;
import 'src/oauth2.dart';
-import 'src/secure_storage.dart';
export 'src/authorization_exception.dart';
-export 'src/secure_storage.dart';
/// Holds authentication data after Google sign in for Tizen.
class _GoogleSignInTokenDataTizen extends GoogleSignInTokenData {
@@ -50,8 +49,8 @@ class _GoogleSignInTokenDataTizen extends GoogleSignInTokenData {
static _GoogleSignInTokenDataTizen fromJson(Map json) {
return _GoogleSignInTokenDataTizen(
accessToken: json['access_token']! as String,
- accessTokenExpirationDate: DateTime.fromMicrosecondsSinceEpoch(
- json['access_token_expiration_date']! as int),
+ accessTokenExpirationDate:
+ DateTime.parse(json['access_token_expiration_date']! as String),
idToken: json['id_token']! as String,
refreshToken: json['refresh_token'] as String?,
);
@@ -61,8 +60,7 @@ class _GoogleSignInTokenDataTizen extends GoogleSignInTokenData {
Map toJson() {
return {
'access_token': accessToken,
- 'access_token_expiration_date':
- accessTokenExpirationDate.microsecondsSinceEpoch,
+ 'access_token_expiration_date': accessTokenExpirationDate.toString(),
'id_token': idToken,
if (refreshToken != null) 'refresh_token': refreshToken!,
};
@@ -84,7 +82,7 @@ class _Credentials {
class _CachedTokenStorage {
// ignore: invalid_use_of_visible_for_testing_member
- final SecureStorage _storage = SecureStorage();
+ final FlutterSecureStorage _storage = const FlutterSecureStorage();
final String _kToken = 'token';
@@ -92,7 +90,7 @@ class _CachedTokenStorage {
_GoogleSignInTokenDataTizen? _token;
Future saveToken(_GoogleSignInTokenDataTizen token) async {
- await _storage.saveJson(_kToken, token.toJson());
+ await _storage.write(key: _kToken, value: jsonEncode(token.toJson()));
_token = token;
}
@@ -100,12 +98,15 @@ class _CachedTokenStorage {
if (_token != null) {
return _token!;
}
- final Map? json = await _storage.getJson(_kToken);
- return json != null ? _GoogleSignInTokenDataTizen.fromJson(json) : null;
+ final String? jsonString = await _storage.read(key: _kToken);
+ return jsonString != null
+ ? _GoogleSignInTokenDataTizen.fromJson(
+ jsonDecode(jsonString) as Map)
+ : null;
}
Future removeToken() async {
- await _storage.remove(_kToken);
+ await _storage.delete(key: _kToken);
_token = null;
}
}
@@ -328,11 +329,10 @@ class GoogleSignInTizen extends GoogleSignInPlatform {
if (splitTokens.length != 3) {
throw const FormatException('Invalid idToken.');
}
- final String normalizedPayload = convert.base64.normalize(splitTokens[1]);
- final String payloadString =
- convert.utf8.decode(convert.base64.decode(normalizedPayload));
+ final String normalizedPayload = base64.normalize(splitTokens[1]);
+ final String payloadString = utf8.decode(base64.decode(normalizedPayload));
final Map json =
- convert.jsonDecode(payloadString) as Map;
+ jsonDecode(payloadString) as Map;
return GoogleSignInUserData(
email: json['email']! as String,
diff --git a/packages/google_sign_in/lib/src/secure_storage.dart b/packages/google_sign_in/lib/src/secure_storage.dart
deleted file mode 100644
index 4f210026d..000000000
--- a/packages/google_sign_in/lib/src/secure_storage.dart
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright 2022 Samsung Electronics Co., Ltd. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-import 'dart:convert' as convert;
-import 'dart:math';
-
-import 'package:flutter/material.dart';
-import 'package:flutter/services.dart';
-
-// This value must match `kIvSizeBytes` in `secure_storage.cc`.
-const int _kIvSizeBytes = 12;
-
-/// Storage that encrypts/decrypts saved data.
-@visibleForTesting
-class SecureStorage {
- final MethodChannel _channel = const MethodChannel('tizen/secure_storage');
-
- final Random _random = Random.secure();
-
- /// Saves json data with [name] to storage, data will be overwritten if it
- /// already exists.
- Future saveJson(String name, Map json) async {
- final Uint8List bytes =
- Uint8List.fromList(convert.jsonEncode(json).codeUnits);
- final Uint8List initializationVector = Uint8List.fromList(
- List.generate(_kIvSizeBytes, (_) => _random.nextInt(256)));
- await _channel.invokeMethod('save', {
- 'name': name,
- 'data': bytes,
- 'initializationVector': initializationVector,
- });
- }
-
- /// Gets the data [name] from storage, returns `null` if no data is present.
- Future