@regantis-sdk/react-native-chat 0.1.1 → 0.1.3

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/src/client.js CHANGED
@@ -438,10 +438,10 @@ class RegantisChatClient {
438
438
  }
439
439
 
440
440
  async pickAndUpload(kind) {
441
- const type = kind === 'image' ? 'image' : 'file';
442
- const file = kind === 'screenshot' ? await native.captureScreenshot() : await native.pickAttachment(type);
441
+ const type = kind === 'image' || kind === 'camera' ? 'image' : 'file';
442
+ const file = kind === 'camera' ? await native.takePhoto() : await native.pickAttachment(type);
443
443
  if (!file) return null;
444
- return this.uploadAttachment(file, kind === 'screenshot' ? 'image' : type);
444
+ return this.uploadAttachment(file, type);
445
445
  }
446
446
 
447
447
  async setTranslationLanguage(languageCode) {
package/src/defaults.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  module.exports = {
4
4
  DEFAULT_SERVER_URL: 'https://www.crm.regantis.technology',
5
- SDK_VERSION: '0.1.1',
5
+ SDK_VERSION: '0.1.3',
6
6
  DEFAULT_SETTINGS: {
7
7
  operator_name: 'Operator',
8
8
  use_profile_names: 0,
package/src/native.js CHANGED
@@ -32,11 +32,11 @@ async function pickAttachment(kind) {
32
32
  return native.pickAttachment(kind === 'image' ? 'image' : 'file');
33
33
  }
34
34
 
35
- async function captureScreenshot() {
36
- if (!native || !native.captureScreenshot) {
37
- throw new Error('NATIVE_SCREENSHOT_UNAVAILABLE');
35
+ async function takePhoto() {
36
+ if (!native || !native.takePhoto) {
37
+ throw new Error('NATIVE_CAMERA_UNAVAILABLE');
38
38
  }
39
- return native.captureScreenshot();
39
+ return native.takePhoto();
40
40
  }
41
41
 
42
42
  function playIncomingSound() {
@@ -51,6 +51,6 @@ module.exports = {
51
51
  removeItem,
52
52
  getAppInfo,
53
53
  pickAttachment,
54
- captureScreenshot,
54
+ takePhoto,
55
55
  playIncomingSound,
56
56
  };