Bắt đầu
Cài đặt
Thiết lập môi trường phát triển
Thêm dependency
Cài đặt gói SDK cần thiết trong dự án Flutter của bạn.
Đầu tiên, bạn cần thêm piscale_chat_flutter vào pubspec.yaml
.
Terminal
flutter pub add piscale_chat_flutter
Hoặc
pubspec.yaml
dependencies:
piscale_chat_flutter: ^latest_version
Runtime Permission
- Android
- iOS
./android/app/src/main/AndroidManifest.xml
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.VIBRATE" />
./ios/ChatApp/Info.plist
<key>NSCameraUsageDescription</key>
<string>PiScale Chat would like to use your camera</string>
<key>NSMicrophoneUsageDescription</key>
<string>PiScale Chat would like to your microphone (for videos)</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>PiScale Chat would like access to your photo gallery</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>PiScale Chat would like access to your photo gallery</string>
<key>NSLocalNetworkUsageDescription</key>
<string>Looking for local tcp Bonjour service</string>
./ios/Podfile
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
/// ADD LINES BELOW
target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
'$(inherited)',
## dart: PermissionGroup.camera
'PERMISSION_CAMERA=1',
## dart: PermissionGroup.photos
'PERMISSION_PHOTOS=1',
## dart: PermissionGroup.notification
'PERMISSION_NOTIFICATIONS=1',
## dart: PermissionGroup.mediaLibrary
'PERMISSION_MEDIA_LIBRARY=1',
]
end
/// ADD LINES ABOVE
end
end