Skip to content

Commit 283c935

Browse files
authored
Merge pull request #34 from Flutterwave/release/1.0.6
Bug fix: fix transaction stuck on redirect screen bug
2 parents 75305a9 + 1d127fd commit 283c935

File tree

11 files changed

+81
-120
lines changed

11 files changed

+81
-120
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [1.0.6] - October, 2022
2+
* Fixed bug where transaction gets stuck after redirecting on webview
3+
* Fixed iOS build bug by removing inAppBrowser library
4+
15
## [1.0.5] - October, 2022
26
* Fixed null when transaction is cancelled.
37
* Removed modal pop up before launching web view.

example/ios/Podfile.lock

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,35 @@
11
PODS:
22
- Flutter (1.0.0)
3-
- flutter_inappwebview (0.0.1):
4-
- Flutter
5-
- flutter_inappwebview/Core (= 0.0.1)
6-
- OrderedSet (~> 5.0)
7-
- flutter_inappwebview/Core (0.0.1):
8-
- Flutter
9-
- OrderedSet (~> 5.0)
103
- fluttertoast (0.0.2):
114
- Flutter
125
- Toast
13-
- OrderedSet (5.0.0)
146
- Toast (4.0.0)
7+
- webview_flutter_wkwebview (0.0.1):
8+
- Flutter
159

1610
DEPENDENCIES:
1711
- Flutter (from `Flutter`)
18-
- flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`)
1912
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
13+
- webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`)
2014

2115
SPEC REPOS:
2216
trunk:
23-
- OrderedSet
2417
- Toast
2518

2619
EXTERNAL SOURCES:
2720
Flutter:
2821
:path: Flutter
29-
flutter_inappwebview:
30-
:path: ".symlinks/plugins/flutter_inappwebview/ios"
3122
fluttertoast:
3223
:path: ".symlinks/plugins/fluttertoast/ios"
24+
webview_flutter_wkwebview:
25+
:path: ".symlinks/plugins/webview_flutter_wkwebview/ios"
3326

3427
SPEC CHECKSUMS:
3528
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
36-
flutter_inappwebview: bfd58618f49dc62f2676de690fc6dcda1d6c3721
3729
fluttertoast: 6122fa75143e992b1d3470f61000f591a798cc58
38-
OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c
3930
Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
31+
webview_flutter_wkwebview: b7e70ef1ddded7e69c796c7390ee74180182971f
4032

4133
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
4234

43-
COCOAPODS: 1.9.3
35+
COCOAPODS: 1.11.3

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 46;
6+
objectVersion = 50;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -156,7 +156,7 @@
156156
97C146E61CF9000F007C117D /* Project object */ = {
157157
isa = PBXProject;
158158
attributes = {
159-
LastUpgradeCheck = 1020;
159+
LastUpgradeCheck = 1300;
160160
ORGANIZATIONNAME = "";
161161
TargetAttributes = {
162162
97C146ED1CF9000F007C117D = {
@@ -239,19 +239,12 @@
239239
buildActionMask = 2147483647;
240240
files = (
241241
);
242-
inputPaths = (
243-
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
244-
"${BUILT_PRODUCTS_DIR}/OrderedSet/OrderedSet.framework",
245-
"${BUILT_PRODUCTS_DIR}/Toast/Toast.framework",
246-
"${BUILT_PRODUCTS_DIR}/flutter_inappwebview/flutter_inappwebview.framework",
247-
"${BUILT_PRODUCTS_DIR}/fluttertoast/fluttertoast.framework",
242+
inputFileListPaths = (
243+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
248244
);
249245
name = "[CP] Embed Pods Frameworks";
250-
outputPaths = (
251-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OrderedSet.framework",
252-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Toast.framework",
253-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_inappwebview.framework",
254-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/fluttertoast.framework",
246+
outputFileListPaths = (
247+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
255248
);
256249
runOnlyForDeploymentPostprocessing = 0;
257250
shellPath = /bin/sh;
@@ -369,7 +362,10 @@
369362
"$(PROJECT_DIR)/Flutter",
370363
);
371364
INFOPLIST_FILE = Runner/Info.plist;
372-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
365+
LD_RUNPATH_SEARCH_PATHS = (
366+
"$(inherited)",
367+
"@executable_path/Frameworks",
368+
);
373369
LIBRARY_SEARCH_PATHS = (
374370
"$(inherited)",
375371
"$(PROJECT_DIR)/Flutter",
@@ -501,7 +497,10 @@
501497
"$(PROJECT_DIR)/Flutter",
502498
);
503499
INFOPLIST_FILE = Runner/Info.plist;
504-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
500+
LD_RUNPATH_SEARCH_PATHS = (
501+
"$(inherited)",
502+
"@executable_path/Frameworks",
503+
);
505504
LIBRARY_SEARCH_PATHS = (
506505
"$(inherited)",
507506
"$(PROJECT_DIR)/Flutter",
@@ -528,7 +527,10 @@
528527
"$(PROJECT_DIR)/Flutter",
529528
);
530529
INFOPLIST_FILE = Runner/Info.plist;
531-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
530+
LD_RUNPATH_SEARCH_PATHS = (
531+
"$(inherited)",
532+
"@executable_path/Frameworks",
533+
);
532534
LIBRARY_SEARCH_PATHS = (
533535
"$(inherited)",
534536
"$(PROJECT_DIR)/Flutter",

example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1020"
3+
LastUpgradeVersion = "1300"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

example/ios/Runner/Info.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,7 @@
4141
</array>
4242
<key>UIViewControllerBasedStatusBarAppearance</key>
4343
<false/>
44+
<key>CADisableMinimumFrameDurationOnPhone</key>
45+
<true/>
4446
</dict>
4547
</plist>

example/lib/main.dart

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ class _MyHomePageState extends State<MyHomePage> {
3838
String selectedCurrency = "";
3939

4040
bool isTestMode = true;
41-
final pbk = "FLWPUBK_TEST";
4241

4342
@override
4443
Widget build(BuildContext context) {
@@ -132,7 +131,6 @@ class _MyHomePageState extends State<MyHomePage> {
132131
width: double.infinity,
133132
margin: EdgeInsets.fromLTRB(0, 20, 0, 10),
134133
child: Row(
135-
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
136134
children: [
137135
Text("Use Debug"),
138136
Switch(
@@ -187,7 +185,6 @@ class _MyHomePageState extends State<MyHomePage> {
187185
txRef: Uuid().v1(),
188186
amount: this.amountController.text.toString().trim(),
189187
customer: customer,
190-
// subAccounts: subAccounts,
191188
paymentOptions: "card, payattitude, barter, bank transfer, ussd",
192189
customization: Customization(title: "Test Payment"),
193190
isTestMode: this.isTestMode);
@@ -201,8 +198,8 @@ class _MyHomePageState extends State<MyHomePage> {
201198
}
202199

203200
String getPublicKey() {
204-
if (isTestMode) return "FLWPUBK_TEST--X";
205-
return "FLWPUBK--X";
201+
if (isTestMode) return "FLWPUBK_TEST-6f008dca68dc8988715b929f2861da41-X";
202+
return "FLWPUBK-45587fdb1c84335354ab0fa388b803d5-X";
206203
}
207204

208205
void _openBottomSheet() {

example/pubspec.lock

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,6 @@ packages:
6969
description: flutter
7070
source: sdk
7171
version: "0.0.0"
72-
flutter_inappwebview:
73-
dependency: transitive
74-
description:
75-
name: flutter_inappwebview
76-
url: "https://pub.dartlang.org"
77-
source: hosted
78-
version: "5.3.2"
7972
flutter_test:
8073
dependency: "direct dev"
8174
description: flutter
@@ -99,7 +92,7 @@ packages:
9992
path: ".."
10093
relative: true
10194
source: path
102-
version: "1.0.5"
95+
version: "1.0.6"
10396
http:
10497
dependency: transitive
10598
description:

lib/view/FlutterwaveWebView.dart

Lines changed: 0 additions & 54 deletions
This file was deleted.

lib/view/standard_webview.dart

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

2+
import 'dart:convert';
23
import 'dart:io';
34

45
import 'package:flutter/foundation.dart';
@@ -55,26 +56,58 @@ class _StandardWebViewAppState extends State<StandardWebView> {
5556
initialUrl: widget.url,
5657
javascriptMode: JavascriptMode.unrestricted,
5758
gestureRecognizers: gestureRecognizers,
58-
navigationDelegate: (request) {
59-
final url = Uri.parse(request.url);
60-
if (_hasCompletedProcessing(url)) {
61-
_finish(url);
62-
return NavigationDecision.prevent;
63-
} else {
64-
_hasCompletedProcessing(url);
65-
return NavigationDecision.navigate;
66-
}
67-
}
59+
onPageStarted: (webUrl) {
60+
final url = Uri.parse(webUrl);
61+
_processUrl(url);
62+
},
6863
),
6964
)
7065
);
7166
}
7267

73-
bool _hasCompletedProcessing(final Uri uri) {
68+
_processUrl(Uri uri) {
69+
if (_checkHasAppendedWithResponse(uri)) {
70+
_finishWithAppendedResponse(uri);
71+
} else {
72+
_checkHasCompletedProcessing(uri);
73+
}
74+
}
75+
76+
_checkHasCompletedProcessing(final Uri uri) {
7477
final status = uri.queryParameters["status"];
7578
final txRef = uri.queryParameters["tx_ref"];
7679
final id = uri.queryParameters["transaction_id"];
77-
return status != null && txRef != null;
80+
if (status != null && txRef != null) {
81+
_finish(uri);
82+
}
83+
}
84+
85+
bool _checkHasAppendedWithResponse(final Uri uri) {
86+
final response = uri.queryParameters["response"];
87+
if (response != null) {
88+
final json = jsonDecode(response);
89+
final status = json["status"];
90+
final txRef = json["txRef"];
91+
return status != null && txRef != null;
92+
}
93+
return false;
94+
}
95+
96+
_finishWithAppendedResponse(Uri uri) {
97+
final response = uri.queryParameters["response"];
98+
final decoded = Uri.decodeFull(response!);
99+
final json = jsonDecode(decoded);
100+
final status = json["status"];
101+
final txRef = json["txRef"];
102+
final id = json["id"];
103+
104+
final ChargeResponse chargeResponse = ChargeResponse(
105+
status: status,
106+
transactionId: "$id",
107+
txRef: txRef,
108+
success: status?.contains("success") == true
109+
);
110+
Navigator.pop(context, chargeResponse);
78111
}
79112

80113
_finish(final Uri uri) {

pubspec.lock

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,6 @@ packages:
146146
description: flutter
147147
source: sdk
148148
version: "0.0.0"
149-
flutter_inappwebview:
150-
dependency: "direct main"
151-
description:
152-
name: flutter_inappwebview
153-
url: "https://pub.dartlang.org"
154-
source: hosted
155-
version: "5.3.2"
156149
flutter_test:
157150
dependency: "direct dev"
158151
description: flutter

0 commit comments

Comments
 (0)