weespin_flutter 1.2.0
weespin_flutter: ^1.2.0 copied to clipboard
Weespin Flutter plugin. Helps you create deep links in a blink
Weespin Flutter SDK #
Weespin helps you create deep links for your apps in a blink. Get started on www.weespin.io/.
How to use #
1. Create an API key #
Create a project and generate an API Key from your dashboard;
const weespin = Weespin(apiKey: "YOUR API KEY");
2. Create a new link #
/// Create a new link
final link = await weespin.createLink(
title: "My link",
description: "Description test",
image: "<binary file>",
segments: ["news", "bananas"],
customParams: ["utm", "productId"],
);
/// Shorten an existing link by providing values for custom parameters
final shortLink = await weespin.shortenLink(
id: "link_id",
params: { "utm": "android", "productId": "123" },
);
/// Create a link and get its short version
final shortLink = await weespin.createShortLink(
title: "My link",
description: "Description test",
image: "<binary file>",
segments: ["news", "bananas"],
customParams: { "utm": "android", "productId": "123" },
);
3. Share your link #
Provide values for your custom parameters and you're ready to go!
/// full url (eg.: https://app.weespin.link/news/bananas?utm=android&productId=123)
print(link.shareLink({"utm": "android", "productId": "123"}));
/// or short url (eg.: https://weespin.link/xyZAbC)
print(shortLink.shortUrl);
4. Receive link click intent #
Use a plugin such as app_links to handle link intent.
Event API #
In addition to links management, you can now logs event into Weespin. Event instances are collected and used to provide various analytics on your dashboard.
How to use? #
weespin.logEvent(
eventName: "add_to_cart",
payload: {
"product_id": "prd_00109",
"quantity": 2,
"from_screen": "/for_you_page"
}
);
Setting a unique user ID #
When using event logs, you may want to set a userID that will be automatically added to all your event payloads.
// add userID at startup
const weespin = Weespin(apiKey: "YOUR API KEY", userId: "user_12345");
// or at a later point
weespin.setUserId("user_12345");
Need help? #
Contact support at contact@caelis-tech.studio.