You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -15,20 +15,18 @@ For more information you can read the docs [Android](https://docs.snap.com/camer
15
15
#### CAUTION
16
16
**API Token** is different for **Production** and **Staging** Environment. A watermark will be applied to the camera view when using the Staging API token.
17
17
18
-
Once you have access to the account, locate your **groupIds**, **cameraKitLensId** (optional) and **cameraKitApiToken**.
18
+
Once you have access to the account, locate your **groupIds** and **cameraKitApiToken**.
19
19
20
20
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.
21
21
22
22
```dart
23
-
class Constants {
24
-
/// List of group IDs for Camera Kit (TODO: Fill group ID here).
/// The API token for Camera Kit in the staging environment (TODO: Fill API token here).
30
-
static const cameraKitApiToken = 'your-api-token'; //TODO fill api token staging & production here
31
-
}
23
+
class Constants {
24
+
/// List of group IDs for Camera Kit
25
+
static const List<String> groupIdList = ['your-group-ids']; // TODO: Fill group IDs here
26
+
27
+
/// The API token for Camera Kit in the staging environment
28
+
static const cameraKitApiToken = 'your-api-token'; // TODO fill api token staging or production here
29
+
}
32
30
```
33
31
**Note:** To use production api token, your camerakit app should be approved and live on snapchat developer portal.
34
32
Otherwise the app may cause `unauthorized` exception. [Read more](https://docs.snap.com/camera-kit/app-review/release-app) about submitting app for review
@@ -39,48 +37,48 @@ Then run ```flutter pub get``` to install the package.
Add the following keys to your Info.plist file, located in <projectroot>/ios/Runner/Info.plist:
46
44
47
45
* 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.
48
46
* NSMicrophoneUsageDescription - used to explain to the user why the app needs access to the device's microphone.
49
47
```dart
50
-
<key>NSCameraUsageDescription</key>
51
-
<string>app need camera permission for showing camerakit lens</string>
52
-
<key>NSMicrophoneUsageDescription</key>
53
-
<string>app need microphone permission for recording a video</string>
48
+
<key>NSCameraUsageDescription</key>
49
+
<string>app need camera permission for showing camerakit lens</string>
50
+
<key>NSMicrophoneUsageDescription</key>
51
+
<string>app need microphone permission for recording a video</string>
54
52
```
55
53
* (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
56
54
```
57
-
platform :ios, '13.0'
55
+
platform :ios, '13.0'
58
56
```
59
57
## Android
60
58
* CameraKit android SDK requires to use an AppCompat Theme for application, so make sure your application theme inherits an AppCompat theme.
61
59
62
60
* For example: in your `style.xml` define a new theme like this:
Configuration class is used to pass all credentials required for Camerakit, you can pass list of Group ids to show all group lenses. You don't need to set separate credentials for iOS and Android.
106
+
You can set camerakit credentials by just calling setCredentials function. Before calling you need instance of CameraKitFlutterImpl, you only need to pass apiToken to configure camerakit flutter package. You don't need to set separate credentials for iOS and Android.
109
107
110
108
```dart
111
-
final config = Configuration(
112
-
Constants.cameraKitApiToken,
113
-
Constants.groupIdList);
114
-
115
-
_cameraKitFlutterImpl.setCredentials(config);
109
+
late final _cameraKitFlutterImpl = CameraKitFlutterImpl(cameraKitFlutterEvents: this);
0 commit comments