Home > front end >  Is it possible to always allow "Open this page in WhatsApp" dialog on iOS Flutter App?
Is it possible to always allow "Open this page in WhatsApp" dialog on iOS Flutter App?

Time:09-06

I'd like to launch Whatsapp from my Flutter app for a specific contact on the user's device. I'm able to do that successfully using url launcher as described in many questions on the subject (like this one enter image description here

Is there a way to always allow that? So that the user doesn't have to hit that each time they want to connect to someone on Whatsapp from my app?

CodePudding user response:

Use the LaunchMode enum which is used to state the desired mode to launch a URL.

Future<bool> launchUrl(
Uri url,
{LaunchMode mode = LaunchMode.externalApplication}
);

LaunchMode.externalApplication is supported on all platforms. On iOS, this should be used in cases where sharing the cookies of the user's browser is important, such as SSO flows, since Safari View Controller does not share the browser's context.

  • Related