diff --git a/example/.metadata b/example/.metadata index 033ad2a..72aedeb 100644 --- a/example/.metadata +++ b/example/.metadata @@ -4,7 +4,27 @@ # This file should be version controlled and should not be manually edited. version: - revision: 7a4c33425ddd78c54aba07d86f3f9a4a0051769b - channel: stable + revision: "5dcb86f68f239346676ceb1ed1ea385bd215fba1" + channel: "stable" project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1 + base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1 + - platform: web + create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1 + base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1 + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/example/analysis_options.yaml b/example/analysis_options.yaml new file mode 100644 index 0000000..0d29021 --- /dev/null +++ b/example/analysis_options.yaml @@ -0,0 +1,28 @@ +# This file configures the analyzer, which statically analyzes Dart code to +# check for errors, warnings, and lints. +# +# The issues identified by the analyzer are surfaced in the UI of Dart-enabled +# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be +# invoked from the command line by running `flutter analyze`. + +# The following line activates a set of recommended lints for Flutter apps, +# packages, and plugins designed to encourage good coding practices. +include: package:flutter_lints/flutter.yaml + +linter: + # The lint rules applied to this project can be customized in the + # section below to disable rules from the `package:flutter_lints/flutter.yaml` + # included above or to enable additional rules. A list of all available lints + # and their documentation is published at https://dart.dev/lints. + # + # Instead of disabling a lint rule for the entire project in the + # section below, it can also be suppressed for a single line of code + # or a specific dart file by using the `// ignore: name_of_lint` and + # `// ignore_for_file: name_of_lint` syntax on the line or in the file + # producing the lint. + rules: + # avoid_print: false # Uncomment to disable the `avoid_print` rule + # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/example/web/favicon.png b/example/web/favicon.png new file mode 100644 index 0000000..8aaa46a Binary files /dev/null and b/example/web/favicon.png differ diff --git a/example/web/icons/Icon-192.png b/example/web/icons/Icon-192.png new file mode 100644 index 0000000..b749bfe Binary files /dev/null and b/example/web/icons/Icon-192.png differ diff --git a/example/web/icons/Icon-512.png b/example/web/icons/Icon-512.png new file mode 100644 index 0000000..88cfd48 Binary files /dev/null and b/example/web/icons/Icon-512.png differ diff --git a/example/web/icons/Icon-maskable-192.png b/example/web/icons/Icon-maskable-192.png new file mode 100644 index 0000000..eb9b4d7 Binary files /dev/null and b/example/web/icons/Icon-maskable-192.png differ diff --git a/example/web/icons/Icon-maskable-512.png b/example/web/icons/Icon-maskable-512.png new file mode 100644 index 0000000..d69c566 Binary files /dev/null and b/example/web/icons/Icon-maskable-512.png differ diff --git a/example/web/index.html b/example/web/index.html new file mode 100644 index 0000000..1aa025d --- /dev/null +++ b/example/web/index.html @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + example + + + + + + diff --git a/example/web/manifest.json b/example/web/manifest.json new file mode 100644 index 0000000..096edf8 --- /dev/null +++ b/example/web/manifest.json @@ -0,0 +1,35 @@ +{ + "name": "example", + "short_name": "example", + "start_url": ".", + "display": "standalone", + "background_color": "#0175C2", + "theme_color": "#0175C2", + "description": "A new Flutter project.", + "orientation": "portrait-primary", + "prefer_related_applications": false, + "icons": [ + { + "src": "icons/Icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icons/Icon-512.png", + "sizes": "512x512", + "type": "image/png" + }, + { + "src": "icons/Icon-maskable-192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "icons/Icon-maskable-512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ] +} diff --git a/lib/iamport_payment.dart b/lib/iamport_payment.dart index a5cc396..205b1e7 100644 --- a/lib/iamport_payment.dart +++ b/lib/iamport_payment.dart @@ -12,7 +12,7 @@ import 'package:iamport_flutter/model/url_data.dart'; import 'package:iamport_flutter/widget/iamport_error.dart'; import 'package:iamport_flutter/widget/iamport_webview.dart'; import 'package:iamport_webview_flutter/iamport_webview_flutter.dart'; -import 'package:uni_links/uni_links.dart'; +import 'package:app_links/app_links.dart'; class IamportPayment extends StatelessWidget { final PreferredSizeWidget? appBar; @@ -71,23 +71,21 @@ class IamportPayment extends StatelessWidget { /* [v0.9.6] niceMobileV2: true 대비 코드 작성 */ if (this.data.pg == 'nice' && this.data.payMethod == 'trans') { try { - StreamSubscription sub = linkStream.listen((String? link) async { - if (link != null) { - String decodedUrl = Uri.decodeComponent(link); - Uri parsedUrl = Uri.parse(decodedUrl); - String scheme = parsedUrl.scheme; - if (scheme == data.appScheme.toLowerCase()) { - String queryToString = parsedUrl.query; - String? niceTransRedirectionUrl; - parsedUrl.queryParameters.forEach((key, value) { - if (key == 'callbackparam1') { - niceTransRedirectionUrl = value; - } - }); - await controller.evaluateJavascript(''' + final _appLinks = AppLinks(); + StreamSubscription sub = + _appLinks.uriLinkStream.listen((Uri uri) async { + String scheme = uri.scheme; + if (scheme == data.appScheme.toLowerCase()) { + String queryToString = uri.query; + String? niceTransRedirectionUrl; + uri.queryParameters.forEach((key, value) { + if (key == 'callbackparam1') { + niceTransRedirectionUrl = value; + } + }); + await controller.evaluateJavascript(''' location.href = "$niceTransRedirectionUrl?$queryToString"; '''); - } } }); return sub; diff --git a/pubspec.yaml b/pubspec.yaml index e886298..597dbf4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -12,7 +12,7 @@ dependencies: sdk: flutter iamport_webview_flutter: 3.0.6 url_launcher: ^6.0.4 - uni_links: ^0.5.1 + app_links: ^6.1.1 json_annotation: ^4.8.1 dev_dependencies: