vela_links 0.1.0
vela_links: ^0.1.0 copied to clipboard
Deep links, deferred deep links, short links and QR tracking for Flutter apps, powered by the Vela Links service.
vela_links #
Deep links, deferred deep links, short links and QR tracking for Flutter apps, powered by the Vela Links service. A link opens the right screen in your app, even when the app is not installed yet.
1. Set up your app in the dashboard #
Sign up at https://deeplinks.velaapps.in, add your app (package name, signing fingerprint, Apple Team ID, store links) and copy the SDK key. The dashboard shows the exact Android and iOS settings for your app.
2. Install #
flutter pub add vela_links
3. Use #
import 'package:vela_links/vela_links.dart';
await VelaLinks.init(apiKey: 'vl_...', baseUrl: 'https://api.links.velaapps.in');
// A link opened your app (or matched your first launch after install)
VelaLinks.instance.onLink.listen((link) {
// link.route, link.params, link.deferred
});
// Create a short link from inside the app
final url = await VelaLinks.instance.createLink(route: '/invite', params: {'id': '42'});
If a link arrives before you start listening, read it once with VelaLinks.instance.consumePendingLink().
4. Platform setup #
- Android: an intent filter for your link domain and your URI scheme (shown in the dashboard), and the Play Install Referrer is read automatically for deferred links.
- iOS: the Associated Domains entitlement
applinks:<your link domain>and your URI scheme.
Good to know #
- The SDK key identifies your app. It can create links and report opens for that one app, and nothing else. It is meant to live in your app, like an analytics key, so it is rate-limited and only works from your own app id. You can rotate it in the dashboard.
baseUrlmust behttps://(plainhttp://only forlocalhostor the Android emulator10.0.2.2).- Every call has a time limit (
requestTimeout, default 10 seconds). Failures raiseVelaLinksExceptionand never stop your app starting. - Treat
link.routeandlink.paramsas untrusted input, like any deep link: check the route against the screens you allow, and never put secrets in link params. - On iOS the first launch reads a one-time token from the clipboard (iOS may show its paste notice) and clears it after a match.
- Call
VelaLinks.instance.dispose()to stop listening. Callinginitagain replaces the previous instance. reportOpens: falseturns off open and QR-scan reporting.
License #
MIT. See LICENSE.