Skip to content
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: progressHandler not working on new devices & handlers not responding #474

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

theatifwaheed
Copy link

We just need to call setChannelMethodCallHandler after setting all of the handlers from project we're working in.

We can also call this function on every set...Handlers method to make sure this is not required for the User Project.

@theatifwaheed
Copy link
Author

@dlutton here is the MR.

@dlutton dlutton self-requested a review March 24, 2024 20:53
@dlutton dlutton self-assigned this Mar 24, 2024
@@ -95,9 +95,7 @@ class FlutterTtsPlugin : MethodCallHandler, FlutterPlugin {
invokeMethod("speak.onStart", true)
}
}
if (Build.VERSION.SDK_INT < 26) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is progressHandler not working for you on newer devices? This was added because onRangeStart was added in SDK version 26 which will add to onProgress. This onStart will get called regardless since it was added in version 15, so we only need to add to onProgress here if less than 26. Basically if your device is 26 or greater, the progressHandler should work via the onRangeStart listener.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not receiving on Progress Events from native to flutter side on Android 14.
When I removed this, It was receiving on Flutter Side.
Then I was getting issue of NULL functions and when I called setChannelMethodCallHandler after setting all of the handlers, It started working i.e. sending data to project.
cc @dlutton

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@theatifwaheed that's very odd, I'll have to test this before merging in since I don't want the issue of having onProgress being called multiple times initially.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@theatifwaheed I apologize for the extremely late reply. I tested on a pixel 5 android version 14 device and it's working in the master branch without this change. Can you provide an example of it not working? This is an example of the code I used to confirm it's working:
https://gist.githubusercontent.com/dlutton/30b065449cb2eb941dfd6bef86aeefaf/raw/5ee94f80f0cbd678c5645c27caaaa078c307376f/ttsSetProgressHandler.dart

@theatifwaheed
Copy link
Author

@dlutton any update on this PR ?

@dlutton
Copy link
Owner

dlutton commented Apr 1, 2024

@theatifwaheed sorry I've been busy with work, but I'll try to make some time this week to test this and then hopefully create a new version for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants