New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issue #339 #359
Fix issue #339 #359
Conversation
Removed the error of same variable naming
Update AndroidInappPurchasePlugin.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Async issue still exist. This Solution is working, just replace the getPurchaseHistory method with this part:
Future<List<PurchasedItem>?> getPurchaseHistory() async {
if (_platform.isAndroid) {
final dynamic getInappPurchaseHistory = await _channel.invokeMethod(
'getPurchaseHistoryByType',
<String, dynamic>{
'type': describeEnum(_TypeInApp.inapp),
},
);
final dynamic getSubsPurchaseHistory = await _channel.invokeMethod(
'getPurchaseHistoryByType',
<String, dynamic>{
'type': describeEnum(_TypeInApp.subs),
},
);
return extractPurchased(getInappPurchaseHistory)! + extractPurchased(getSubsPurchaseHistory)!;
} else if (_platform.isIOS) {
dynamic result = await _channel.invokeMethod('getAvailableItems');
return extractPurchased(json.encode(result));
}
throw PlatformException(
code: _platform.operatingSystem, message: "platform not supported");
}
lib/flutter_inapp_purchase.dart
Outdated
dynamic result1 = await _channel.invokeMethod( | ||
'getAvailableItemsByType', | ||
<String, dynamic>{ | ||
'type': describeEnum(_TypeInApp.inapp), | ||
}, | ||
); | ||
|
||
dynamic result2 = await _channel.invokeMethod( | ||
'getAvailableItemsByType', | ||
<String, dynamic>{ | ||
'type': describeEnum(_TypeInApp.subs), | ||
}, | ||
); | ||
|
||
return extractPurchased(result1)! + extractPurchased(result2)!; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove these lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made the fix in eb3dc95. This resolves previous tests from failing.
Hope you people can review this before merging 🙏
@offline-first @valterh4ck3r
Codecov Report
@@ Coverage Diff @@
## master #359 +/- ##
==========================================
- Coverage 45.97% 45.74% -0.23%
==========================================
Files 3 3
Lines 435 435
==========================================
- Hits 200 199 -1
- Misses 235 236 +1
Continue to review full report at Codecov.
|
fixed async issue
PR came from #359. The credit goes to @offline-first @valterh4ck3r. Fixes #356 Co-authored-by: offline-first <info@offlinefirst.net> Co-authored-by: valterh4ck3r <valterh4ck3r@hotmail.com>
No description provided.