-
Notifications
You must be signed in to change notification settings - Fork 242
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
FlutterInappPurchase.connectionUpdated not working #272
Comments
This issue is stale because it has been open 90 days with no activity. Leave a comment or this will be closed in 7 days. |
I have something even more sinister right now. The
And it seems that this not only doesn't arrive to the Dart side but it basically hangs the process and it never actually goes on to the next line. This means that |
Oh may I know which version you are using? |
Always the last one, 5.1.0. Now I made a local copy and I keep investigating but practically, the whole channel communication seems to have problems. Strange. Basically, I get into the |
This is my local code now:
|
@deakjahn If I remember correctly, there were lots of question asked for module not being updated. Could you kindly remove the cache and ensure that you have the fresh |
I have no cache issues for sure. Right know I'm working on a local copy of the module and all |
On an unrelated note, because I checked out the plugin registration as well, I'd suggest to include the same checks into
or even better, put the check into a separate function and just call from both places. |
Well, nothing to do with my trouble, but here it is if you're interested, I did it during my attempts. :-) The common function:
and both just call this:
|
@hyochan OK. I found it, finally. You won't like it that much but you'll have to change it. :-) First I'll describe it, then I'll try to look whether I can provide you with a PR. My current code is rather different from your current one, I tweaked it quite a lot but I'll try to incorporate what's needed in your original code. The underlying problem is relatively new:
Plugins now have to handle threading and make sure that they report the result on the UI thread even if their actual platform code runs on a different one. One good solution is the |
And I made my first test purchase again, successfully. So, let's see the PR. :-) |
Version of flutter_inapp_purchase
flutter_inapp_purchase: ^3.0.1
Platforms you faced the error (IOS or Android or both?)
both Android and IOS
Expected behavior
FlutterInappPurchase.connectionUpdated working
Actual behavior
FlutterInappPurchase.connectionUpdated not working when call await FlutterInappPurchase.instance.initConnection
Tested environment (Emulator? Real Device?)
Iphone 7plus (Real Device), Samsung j7 (Real Device)
Steps to reproduce the behavior
Step 1:
var result = await FlutterInappPurchase.instance.initConnection;
Step 2:
_conectionSubscription =
FlutterInappPurchase.connectionUpdated.listen((connected) {
_connectedResult = connected;
print('FlutterInappPurchase connected $connected');
});
The text was updated successfully, but these errors were encountered: