Last updated:
0 purchases
ruut
Ruut Flutter SDK #
Ruut Flutter SDK provides developers with a seamless way to integrate the Ruut chat widget into their Flutter applications.
Installation #
To use the Ruut Flutter SDK in your Flutter project, add ruut as a dependency in your pubspec.yaml file:
dependencies:
flutter:
sdk: flutter
ruut: ^0.0.7
copied to clipboard
Permissions #
Add the following permissions to your app's manifest files:
Android
Add these lines to your android/app/src/main/AndroidManifest.xml file:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
copied to clipboard
Also, add the following attribute to your application tag:
<application
android:usesCleartextTraffic="true"
copied to clipboard
iOS #
Add the following keys to your ios/Runner/Info.plist file:
<key>NSPhotoLibraryUsageDescription</key>
<string>This app requires access to the photo library for image uploads.</string>
<key>NSCameraUsageDescription</key>
<string>This app requires access to the camera for image captures.</string>
copied to clipboard
Usage #
import 'package:flutter/material.dart';
import 'package:ruut/ruut.dart';
class MyRuutScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Ruut(
ruutToken: 'YOUR_RUUT_TOKEN',
user: RuutUser(
id: 'USER_ID',
email: '[email protected]',
fullName: 'John Doe',
// Add other user details here
),
onReady: () {
print('Ruut is ready');
},
);
}
}
copied to clipboard
Features #
Setting User Details #
Ruut.setUser(RuutUser(
id: 'USER_ID',
email: '[email protected]',
fullName: 'John Doe',
// Add other user details here
));
copied to clipboard
Custom Attributes #
Set custom attributes for the user:
Ruut.setCustomAttributes({'plan': 'Premium', 'tier': 'Tier 2'});
));
copied to clipboard
Resetting User #
To reset the user data:
Ruut.resetUser();
copied to clipboard
Deleting Custom Attributes #
To delete a specific custom attribute:
Ruut.deleteCustomAttribute('customAttributeKey');
copied to clipboard
RuutUser Model #
The RuutUser model includes the following properties:
id (required): The user's unique identifier
email: User's email address
avatarUrl: URL to the user's avatar image
fullName: User's full name
phone: User's phone number
identifierHash: Identifier hash for the user
description: A brief description of the user
countryCode: Two-letter country code
city: User's city
companyName: User's company name
socialProfiles: Social profile information (Twitter, Facebook, GitHub, LinkedIn)
Troubleshooting #
If you encounter any issues, please ensure that:
All required permissions are added to your app's manifest files.
Your Ruut token is correct and valid.
You have a stable internet connection.
For more detailed information or support, please visit our documentation or contact our support team.
License #
This project is licensed under the MIT License - see the LICENSE file for details.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.