Skip to main content

Installation

Add the Bit2Connect Flutter SDK to your pubspec.yaml:
Then run:

Setup

1. Initialize the SDK

Initialize the SDK in your app’s main function:
Add deep link handling to your app:

API Reference

Bit2ConnectSDK

The main SDK class for handling dynamic links.

Methods

initialize({required String apiKey, required String projectId})
Initialize the Bit2Connect SDK with your API credentials. Parameters:
  • apiKey (String): Your Bit2Connect API key
  • projectId (String): Your project ID
Example:
getInitialLink()
Get the initial dynamic link that launched the app (if any). Returns: Future<DynamicLinkData?> Example:
onLinkReceived
Stream that emits dynamic link data when a new link is received. Type: Stream<DynamicLinkData> Example:

DynamicLinkData

Represents the data from a dynamic link.

Properties

  • shortUrl (String): The shortened Bit2Connect URL
  • originalUrl (String): The original URL that was shortened
  • payload (Map<String, dynamic>?): Custom data associated with the link
  • createdAt (DateTime): When the link was created
  • expiresAt (DateTime?): When the link expires (if applicable)

Platform Configuration

Android Configuration

Add the following to your android/app/src/main/AndroidManifest.xml:

iOS Configuration

Add the following to your ios/Runner/Info.plist:

Testing

You can test your integration using the Bit2Connect dashboard or API:

Debug Mode

Enable debug logging to troubleshoot issues:

Best Practices

Error Handling

Always handle potential errors when processing dynamic links

User Experience

Provide fallback navigation for invalid or expired links

Security

Validate link data before processing to ensure security

Performance

Cache link data when appropriate to improve app performance

Troubleshooting

Common Issues

Debug Tips

  1. Enable debug mode to see detailed logging
  2. Test with the Bit2Connect dashboard link tester
  3. Verify your app’s deep link configuration
  4. Check that your API key has the correct permissions

Example App

For a complete working example, check out our Flutter example repository:
The example app demonstrates:
  • Complete SDK integration
  • Deferred deep linking
  • Dynamic link creation
  • Error handling
  • Cross-platform support

Code Examples

E-commerce App

Social Media App