Um plug-in camerakit que fornece aos desenvolvedores integração e acesso sem problemas às funcionalidades do Snapchat CameraKit em seus aplicativos Flutter.
Orientação gerada a partir de informações públicas. Apenas para referência.
camerakit_flutter é um plugin Flutter que permite a integração sem problemas de recursos do Snapchat CameraKit em aplicativos móveis para Android e iOS. Ele fornece aos desenvolvedores acesso a funcionalidades avançadas da câmera, como filtros em tempo real, detecção facial e efeitos AR, tudo por meio de uma interface simples do Flutter. O plugin simplifica a implementação de experiências visuais ricas sem exigir conhecimento de código nativo. Desenvolvido pela devcrew.io, ele aproveita o poder do CameraKit para oferecer capacidades de câmera de alto desempenho em aplicativos Flutter.
Casos de uso
Adicionando filtros AR a aplicativos de mídia social
Implementando efeitos faciais em tempo real em aplicativos de fotos
Melhorando o chat de vídeo com sobreposições interativas
Construindo jogos de realidade aumentada
Integrando recursos de câmera do estilo Snapchat
Principais recursos
Integração sem problemas com o Flutter
Suporte para Android e iOS
Rastreamento em tempo real de rostos e objetos
Acesso à biblioteca de filtros AR do Snapchat
API fácil de usar para controles de câmera
Alto desempenho com baixa latência
Indicado para
Desenvolvedores Flutter criando aplicativos com câmera rica
Plataformas de mídia social ou mensagens
aplicativos de entretenimento com AR
Aplicativos que exigem efeitos visuais em tempo real
Considerações
Requer configuração e credenciais do CameraKit SDK
Personalização limitada além dos filtros fornecidos
Dependente de atualizações de SDK externas
Pode aumentar o tamanho do aplicativo devido aos recursos embutidos
Necessita de tratamento adequado de permissões para acesso à câmera
README original
Snapshot do README original do repositório-fonte vinculado. Consulte o repositório para o conteúdo mais recente.
camerakit-flutter
An open-source SDK package for Flutter that provides developers with seamless integration and access to Snapchat's CameraKit features within their Flutter applications. Flutter developers now can access set configuration from Flutter for both platforms (IOS and Android), you can open CameraKit , get media results (Images and Videos) and get list of lenses against group ids.
Obtaining CameraKit Keys
Your App ID and API Token can be found in the Snap Kit Portal and is used to provide authorized access to Camera Kit remote services.
For more information you can read the docs Android, IOS.
CAUTION
API Token is different for Production and Staging Environment. A watermark will be applied to the camera view when using the Staging API token.
Configuration
Once you have access to the account, locate your groupIds and cameraKitApiToken.
Now that you have obtained all your credentials, you can use it to initialize the Configuration class in your Flutter application as mentioned in the below section.
classConstants{
/// List of group IDs for Camera KitstaticconstList<String> groupIdList = ['your-group-ids']; // TODO: Fill group IDs here
}
Android Setup
The easiest way to include this, is to define a tag in AndroidManifest.xml with a Camera Kit application ID value under tag:
Add SCCameraKitClientID (string), and set it to your application's Snap Kit App ID in your application's Info.plist file.
Add SCCameraKitAPIToken (string), and set it to your application's API Token in your application's Info.plist file.
Note: To use production api token, your camerakit app should be approved and live on snapchat developer portal.
Otherwise the app may cause unauthorized exception. Read more about submitting app for review
Installation
First, add camerakit_flutter: as a dependency in your pubspec.yaml file.
Then run flutter pub get to install the package.
Add the following keys to your Info.plist file, located in /ios/Runner/Info.plist:
NSCameraUsageDescription - describe why your app needs permission for the camera library. It's a privacy feature to ensure that apps don't access sensitive device features without the user's knowledge and consent.
NSMicrophoneUsageDescription - used to explain to the user why the app needs access to the device's microphone.
<key>NSCameraUsageDescription</key>
<string>app need camera permission for showing camerakit lens</string>
<key>NSMicrophoneUsageDescription</key>
<string>app need microphone permission for recording a video</string>
(Optional: To fix cocoapods installation error) Inside Podfile under iOS directory of your flutter project, uncomment the following line and set the iOS version 13
platform :ios, '13.0'
Android
CameraKit android SDK requires to use an AppCompat Theme for application, so make sure your application theme inherits an AppCompat theme.
For example: in your style.xml define a new theme like this:
You can access camerakit by just calling openCameraKit function with only the list of groupIds to load all lenses of given groups.
You can hide or show close button on camerakit screen by setting isHideCloseButton to true or false respectively.
You can access camerakit with single lens by just calling openCameraKitWithSingleLens function with the lensId and groupId of that lens.
You can hide or show close button on camerakit screen by setting isHideCloseButton to true or false respectively.
Have a bug or a feature request? Please first search for existing and closed issues. If your problem
or idea is not addressed
yet, please open a new issue.