avioli / uni_links

Flutter plugin for accepting incoming links.
BSD 2-Clause "Simplified" License
564 stars 315 forks source link

Enable/Disable the deep links at code level #173

Open chiragjuneja opened 1 year ago

chiragjuneja commented 1 year ago

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

We can precisely identify the scenario when we want to disable the deeplinks temporarily and enable it back. But we 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 we are including the library at common code level only, and have no activity for deeplinks explicitly, we could not find the way to do it.

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

Does it related to

[ ] App Links (Android)
[ X ] Deep Links (Android)
[ ] Universal Links (iOS)
[ ] or Custom URL schemes? (iOS)

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