@imgly/camera-react-native 1.62.0 → 1.64.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -8,7 +8,7 @@ Visit our [documentation](https://img.ly/docs/cesdk) for more tutorials on how t
8
8
 
9
9
  ## License
10
10
 
11
- The Camera SDK is a commercial product. To use it and get access you need to unlock the SDK with a license file. You can purchase a license at https://img.ly/pricing.
11
+ The Camera SDK is a commercial product. You can purchase a license at https://img.ly/pricing. Alternatively, you can use `null` as the license parameter to run the SDK in evaluation mode with a watermark.
12
12
 
13
13
  ## Integration
14
14
 
@@ -78,7 +78,7 @@ repositories {
78
78
  }
79
79
 
80
80
  dependencies {
81
- implementation findProject(":camera") ?: "ly.img:camera:1.62.0"
81
+ implementation findProject(":camera") ?: "ly.img:camera:1.64.0"
82
82
  implementation platform("androidx.compose:compose-bom:2023.05.01")
83
83
  implementation "androidx.activity:activity-compose:1.6.1"
84
84
  implementation "androidx.activity:activity:1.7.0"
@@ -124,7 +124,7 @@ class IMGLYCameraModule(
124
124
  metadata: Map<String, Any?>?,
125
125
  completion: ((Result<CameraResult?>) -> Unit),
126
126
  ) {
127
- val activity = this.currentActivity ?: return
127
+ val activity = this.reactApplicationContext.currentActivity ?: return
128
128
  this.completion = completion
129
129
 
130
130
  val engineConfiguration =
@@ -6,11 +6,11 @@ import android.os.Parcelable
6
6
  /**
7
7
  * A class containing all necessary information to configure the camera.
8
8
  *
9
- * @property license The license key.
9
+ * @property license The license key. Pass `null` to run the SDK in evaluation mode with a watermark.
10
10
  * @property userId The id of the current user.
11
11
  */
12
12
  data class CameraSettings(
13
- val license: String,
13
+ val license: String? = null,
14
14
  val userId: String?,
15
15
  ) : Parcelable {
16
16
  /**
@@ -18,7 +18,7 @@ data class CameraSettings(
18
18
  * @param parcel The [Parcel].
19
19
  */
20
20
  constructor(parcel: Parcel) : this(
21
- parcel.readString() ?: throw (Exception("Missing value for key 'license.'")),
21
+ parcel.readString(),
22
22
  parcel.readString(),
23
23
  )
24
24
 
@@ -38,7 +38,7 @@ data class CameraSettings(
38
38
  override fun newArray(size: Int): Array<CameraSettings?> = arrayOfNulls(size)
39
39
 
40
40
  fun createFromMap(map: Map<String, Any?>): CameraSettings {
41
- val license = map["license"] as? String ?: throw (Exception("Missing value for key 'license.'"))
41
+ val license = map["license"] as? String
42
42
  val userId = map["userId"] as? String
43
43
  return CameraSettings(license, userId)
44
44
  }
@@ -1,7 +1,7 @@
1
1
  /// A struct containing all necessary settings to setup the camera.
2
2
  @objc @objcMembers public class CameraSettings: NSObject, Codable {
3
- /// The license key.
4
- public let license: String
3
+ /// The license key. Pass `nil` to run the SDK in evaluation mode with a watermark.
4
+ public let license: String?
5
5
 
6
6
  /// The id of the current user.
7
7
  public let userId: String?
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imgly/camera-react-native",
3
- "version": "1.62.0",
3
+ "version": "1.64.0",
4
4
  "description": "Camera SDK for React Native - provide a versatile video camera to your users on iOS and Android.",
5
5
  "react-native": "index.js",
6
6
  "source": "index.js",
@@ -75,8 +75,8 @@ interface CameraResult {
75
75
 
76
76
  /** A class containing all necessary settings to setup the camera. */
77
77
  export interface CameraSettings {
78
- /** The license of the editor. */
79
- license: string;
78
+ /** The license of the editor. Pass `null` to run the SDK in evaluation mode with a watermark. */
79
+ license?: string;
80
80
 
81
81
  /**
82
82
  * Unique ID tied to your application's user.