0

I am working on a flutter app that supports deeplinks via library plugins like app_links, uni_links.

I have the requirement that I want to disable the deeplinks (weblinks) in the app for a particular workflow.

I can precisely identify the scenario when we want to disable the deeplinks temporarily and enable it back. But could not find way to do it.

On native app, we could do something like this:

    ComponentName act = new ComponentName(Android.App.Application.Context, "com.company.ActivityForDeeplink");

    //enabling
    Android.App.Application.Context?.PackageManager?.SetComponentEnabledSetting(act, ComponentEnabledState.Enabled, ComponentEnableOption.DontKillApp);

    //disabling
    Android.App.Application.Context?.PackageManager?.SetComponentEnabledSetting(act, ComponentEnabledState.Disabled, ComponentEnableOption.DontKillApp);

But since I am including the library at common code level only, and have no activity for deeplinks explicitly, I could not find the way to do it.

Links I am looking to disable are : "http/https://" I want custom urls schemes ,like : "://redirect", to work as expected that app will receive callbacks via getinitiallinks etc.

Any idea how to disable or enable the deeplinks at code level.

0 Answers0