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

Issue with Deep Linking #23

Open
renanmgs opened this issue Feb 24, 2022 · 0 comments
Open

Issue with Deep Linking #23

renanmgs opened this issue Feb 24, 2022 · 0 comments

Comments

@renanmgs
Copy link

Copy from https://stackoverflow.com/questions/71237552/deeplinking-in-flutter-with-flutterfragmentactivity

I have an Streaming app that connects to ChromeCast.

It uses this package to handle the connection: https://github.com/samyakkkk/flutter_video_cast

It needs to use FlutterFragmentActivity so the connection can work, but, if i use it, i lose the hability to DeepLinking. How can i succed in this if i need to use FlutterFragmentActivity?

Here is the code that makes Chromecast Work but breaks DeepLinking:

    class MainActivity : FlutterFragmentActivity() {

    override fun provideFlutterEngine(context: Context): FlutterEngine? {
        return AudioServicePlugin.getFlutterEngine(context)
    }
    
    override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
        GeneratedPluginRegistrant.registerWith(flutterEngine)
        provideFlutterEngine(applicationContext)
    }
}

Here is the code that DeepLinking works but breaks the ChromeCast connection:


    class MainActivity : FlutterActivity() {
    override fun provideFlutterEngine(context: Context): FlutterEngine? {
        configureFlutterEngine(FlutterEngine(applicationContext))
        return AudioServicePlugin.getFlutterEngine(context)
    }
}

I need to use "AudioServicePlugin" for playing audio, so this line need to be set also.

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

No branches or pull requests

1 participant