Flutter integration
Create sharing links in your Flutter application
Allowing your users to share content directly from your application is an excellent way to
- Acquire new users.
- Increase engagement and retention.
Thanks to the Weespin package, you can generate personalized and tracked sharing links, integrating deep links to redirect your users to a specific page or feature in your app.
Prerequisites: Get your API keys
- Log into your Weespin dashboard.
- Go to your application.
- Go to the Configuration section.
- In Integration:
- Generate the API key that will be used to identify your application.
Store your keys in a secure file or environment variables.
Integrate the Weespin plugin
- Add the dependency in
pubspec.yaml
: - Import the package in your Dart code:
Always check that you're using the latest version of the package on pub.dev to benefit from new features.
Use the plugin to create a link
Here is a concrete example for creating a link with custom parameters:
You can then trigger this from a share button:
Add deep link handling with app_links
To handle deep links (open a specific screen when the user clicks a generated link), use the app_links
package.
- Add the dependency in
pubspec.yaml
:
Android configuration
In android/app/src/main/AndroidManifest.xml
:
Replace yourdomain.com
with your own domain.
iOS configuration
In ios/Runner/Info.plist
:
Then in Xcode:
- Select your project > Target > "Signing & Capabilities"
- Add the Associated Domains capability
- Add to the list:
applinks:yourdomain.com
Example usage in Flutter
Test on Android and iOS
- Android: test sharing via SMS, WhatsApp, or Gmail.
- iOS: test via iMessage, Mail, or social apps.
- Verify that:
- The link correctly redirects to the app or the website.
- Deep links work and open the exact content.
- The UX is smooth without excessive loading time.
UX tips:
- Provide a default message the user can edit before sending.
- Add a share counter to encourage engagement.
Conclusion / Tips
By integrating sharing links with Weespin:
- You increase the viral reach of your application.
- You create a smooth user journey to your content.
- You collect conversion and engagement data via tracked deep links.
Next step
combine sharing with personalized push notifications to maximize retention and acquisition.
::