DEEPLINKX / use case

Share text with WhatsApp and open a Telegram conversation

Validate text inputs and hand off typed sharing or messaging actions to the user's external apps.

DeeplinkX 1.5.8 · Source

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

InputDefault
WhatsApp share textTry DeeplinkX for type-safe Flutter deeplinks.
Telegram usernametelegram
Telegram messageHello 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 true means 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 WhatsAppShareTextAction or TelegramSendMessageAction with 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