Prepare a message or share text in an external application. The user remains responsible for choosing recipients and completing any external-app interaction; these actions do not silently send messages in the background.
Reusable Flutter example
import 'package:deeplink_x/deeplink_x.dart';
Future<bool> shareWithWhatsApp(String input) {
final text = input.trim();
if (text.isEmpty) return Future.value(false);
return DeeplinkX().launchAction(WhatsApp.shareText(text: text));
}
Future<bool> openTelegramMessage(String usernameInput, String messageInput) {
final username = usernameInput.trim();
final message = messageInput.trim();
if (username.isEmpty || message.isEmpty) return Future.value(false);
return DeeplinkX().launchAction(
Telegram.sendMessage(username: username, message: message),
);
}
In a user interface, show a specific validation message before calling these helpers so empty input is distinguishable from a failed launch. The existing page reports “Enter text to share” or “Enter both a Telegram username and message.”
Current example inputs and behavior
| Input | Default |
|---|---|
| WhatsApp share text | Try DeeplinkX for type-safe Flutter deeplinks. |
| Telegram username | telegram |
| Telegram message | Hello from the DeeplinkX example! |
The page trims values, rejects required empty fields, constructs the corresponding action, and calls launchAction. It disables repeat requests while launching and shows the final handoff result. Store fallback is not opted into by these calls; normal action fallback remains enabled.
Configuration and limits
- Use the WhatsApp guide and Telegram guide for provider actions and limitations.
- Configure the relevant Android package visibility and iOS query schemes.
- The sample username is a public demo destination; replace it with the intended recipient. Do not treat it as an official DeeplinkX support account.
- Provider login, recipient availability, account policy, user confirmation, and eventual delivery are outside the launch API.
- A returned
truemeans a launch request succeeded, including possible fallback; it does not confirm that any message was sent.
UI behavior
- Whitespace-only WhatsApp text is rejected before launch.
- Either missing Telegram field is rejected before launch; trimmed values reach the action.
- Valid inputs create
WhatsAppShareTextActionorTelegramSendMessageActionwith the expected content. - Native and documented fallback handoffs receive accurate result labels.
- Repeat taps while pending do not send duplicate launch requests.
Source code
All use cases · Social support links · Meetings and communities