Skip to content

Issue with Deep Linking #23

@renanmgs

Description

@renanmgs

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions