crisp

Creator: coderz1093

Last updated:

0 purchases

crisp Image
crisp Images

Languages

Categories

Add to Cart

Description:

crisp

Flutter Crisp #











Connect with Crisp Chat, register a user to chat (or not) and render a chat widget.
Tested on Android and iOS.
Required setup #
Min SDK version:
minSdkVersion 17
AndroidManifest.xml necessary changes:
<application
android:usesCleartextTraffic="true">
...
<meta-data
android:name="flutterEmbedding"
android:value="2" />
<provider
android:name="com.pichillilorenzo.flutter_inappwebview.InAppWebViewFileProvider"
android:authorities="${applicationId}.flutter_inappwebview.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths" />
</provider>
</application>
copied to clipboard
For details check the example folder.
How to use #
Initialize with:

Your website id (https://app.crisp.chat/website/%5BWEBISTE_ID%5D/inbox/);
An optional locale.

CrispMain crispMain;

@override
void initState() {
super.initState();

crispMain = CrispMain(
websiteId: 'WEBSITE_ID',
locale: 'pt-br',
);

crispMain.register(
user: CrispUser(
email: "[email protected]",
avatar: 'https://avatars2.githubusercontent.com/u/16270189?s=200&v=4',
nickname: "João Cardoso",
phone: "5511987654321",
),
);

crispMain.setMessage("Hello world");

crispMain.setSessionData({
"order_id": "111",
"app_version": "0.1.1",
});
}
copied to clipboard
Then use with:

Optional clear cache.

@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Your brand'),
),
body: CrispView(
crispMain: crispMain,
clearCache: false,
),
),
);
}
copied to clipboard
Additional parameters #
Chat user token with userToken
crispMain.initialize(
websiteId: 'WEBSITE_ID',
locale: 'pt-br',
userToken: '<USERTOKENHERE>',
);
copied to clipboard
Verification token with verificationCode (User Verification)
crispMain.register(
user: CrispUser(
email: "[email protected]",
avatar: 'https://avatars2.githubusercontent.com/u/16270189?s=200&v=4',
nickname: "João Cardoso",
phone: "5511987654321",
verificationCode: "<HMAC256CODEHERE>",
),
);
copied to clipboard
Custom data via setSessionData (Set custom data)
crispMain.setSessionData({
"order_id": "111",
"app_version": "0.1.1",
});
copied to clipboard
Custom onLinkPressed event
CrispView(
crispMain: crispMain,
clearCache: true,
onLinkPressed: (url) {
if (url.contains('example.com')) {
loadDeeplinkWithUrl(url: url);
} else
launch(url);
},
),
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.