@doorstepai/dropoff-sdk 1.0.5 → 1.0.7

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
@@ -184,6 +184,8 @@ In your `AndroidManifest.xml`, include the following permissions:
184
184
  <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
185
185
  <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
186
186
  <uses-permission android:name="android.permission.HIGH_SAMPLING_RATE_SENSORS" />
187
+ <uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" />
188
+ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
187
189
 
188
190
  <uses-feature android:name="android.hardware.sensor.accelerometer" />
189
191
  <uses-feature android:name="android.hardware.sensor.gyroscope" />
@@ -86,7 +86,7 @@ def kotlin_version = getExtOrDefault("kotlinVersion")
86
86
  dependencies {
87
87
  implementation "com.facebook.react:react-android"
88
88
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
89
- implementation("ai.doorstep.com:doorstepai-dropoff-sdk:0.0.3")
89
+ implementation("ai.doorstep.com:doorstepai-dropoff-sdk:1.0.0")
90
90
  api "org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1"
91
91
  }
92
92
 
@@ -8,41 +8,23 @@ const DoorstepAIView = requireNativeComponent('RootDoorstepAIView');
8
8
  export function RootDoorstepAI(props) {
9
9
  useEffect(() => {
10
10
  const initializeAndRequestPermissions = async () => {
11
- // Initialize SDK
12
11
  if (Platform.OS === 'android') {
13
12
  await DoorstepAI.init();
14
13
  }
15
14
  DoorstepAI.setApiKey(props.apiKey);
16
-
17
- // Request Permissions
18
15
  if (Platform.OS === 'android') {
19
16
  try {
20
17
  const permissionsToRequest = [PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION, PermissionsAndroid.PERMISSIONS.ACTIVITY_RECOGNITION];
21
- // Background location might be needed depending on SDK functionality
22
- // permissionsToRequest.push(PermissionsAndroid.PERMISSIONS.ACCESS_BACKGROUND_LOCATION);
23
-
24
18
  const granted = await PermissionsAndroid.requestMultiple(permissionsToRequest);
25
19
  if (granted[PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION] === PermissionsAndroid.RESULTS.GRANTED && granted[PermissionsAndroid.PERMISSIONS.ACTIVITY_RECOGNITION] === PermissionsAndroid.RESULTS.GRANTED) {
26
20
  console.log('Required Android permissions granted');
27
- // Handle background location if requested
28
- // if (granted[PermissionsAndroid.PERMISSIONS.ACCESS_BACKGROUND_LOCATION] === PermissionsAndroid.RESULTS.GRANTED) {
29
- // console.log('Background location permission granted');
30
- // } else {
31
- // console.warn('Background location permission denied');
32
- // }
33
21
  } else {
34
22
  console.warn('One or more required Android permissions denied');
35
- // Handle permission denial (e.g., show a message to the user)
36
23
  }
37
24
  } catch (err) {
38
25
  console.warn('Error requesting Android permissions:', err);
39
26
  }
40
27
  } else if (Platform.OS === 'ios') {
41
- // On iOS, permissions are requested when features are used.
42
- // Ensure you have added the necessary keys to your Info.plist:
43
- // - NSLocationWhenInUseUsageDescription (required)
44
- // - NSLocationAlwaysAndWhenInUseUsageDescription (if background location is needed)
45
- // - NSMotionUsageDescription (required)
46
28
  console.log('iOS: Ensure location and motion usage descriptions are in Info.plist');
47
29
  }
48
30
  };
@@ -1 +1 @@
1
- {"version":3,"names":["requireNativeComponent","View","Platform","StyleSheet","PermissionsAndroid","useEffect","DoorstepAI","jsx","_jsx","DoorstepAIView","RootDoorstepAI","props","initializeAndRequestPermissions","OS","init","setApiKey","apiKey","permissionsToRequest","PERMISSIONS","ACCESS_FINE_LOCATION","ACTIVITY_RECOGNITION","granted","requestMultiple","RESULTS","GRANTED","console","log","warn","err","style","styles","container","children","create","height","width"],"sourceRoot":"../../src","sources":["RootDoorstepAI.tsx"],"mappings":";;AAAA,SACEA,sBAAsB,EACtBC,IAAI,EACJC,QAAQ,EACRC,UAAU,EACVC,kBAAkB,QACb,cAAc;AAErB,SAASC,SA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ACA;QACA;QACA;QACAY,OAAO,CAACC,GAAG,CACT,sEACF,CAAC;MACH;IACF,CAAC;IAEDd,+BAA+B,CAAC,CAAC;EACnC,CAAC,EAAE,CAACD,KAAK,CAACK,MAAM,CAAC,CAAC;;EAElB;EACA;EACA,oBACER,IAAA,CAACP,IAAI;IAAC4B,KAAK,EAAEC,MAAM,CAACC,SAAU;IAAAC,QAAA,EAC3B9B,QAAQ,CAACW,EAAE,KAAK,KAAK,gBAAGL,IAAA,CAACC,cAAc,IAAE,CAAC,GAAG;EAAI,CAC9C,CAAC;AAEX;AAEA,MAAMqB,MAAM,GAAG3B,UAAU,CAAC8B,MAAM,CAAC;EAC/BF,SAAS,EAAE;IACTG,MAAM,EAAE,CAAC;IACTC,KAAK,EAAE;EACT;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["requireNativeComponent","View","Platform","StyleSheet","PermissionsAndroid","useEffect","DoorstepAI","jsx","_jsx","DoorstepAIView","RootDoorstepAI","props","initializeAndRequestPermissions","OS","init","setApiKey","apiKey","permissionsToRequest","PERMISSIONS","ACCESS_FINE_LOCATION","ACTIVITY_RECOGNITION","granted","requestMultiple","RESULTS","GRANTED","console","log","warn","err","style","styles","container","children","create","height","width"],"sourceRoot":"../../src","sources":["RootDoorstepAI.tsx"],"mappings":";;AAAA,SACEA,sBAAsB,EACtBC,IAAI,EACJC,QAAQ,EACRC,UAAU,EACVC,kBAAkB,QACb,cAAc;AAErB,SAASC,SAAS,QAAQ,OAAO;AAEjC,SAASC,UAAU,QAAQ,iBAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE1C,MAAMC,cAAc,GAAGT,sBAAsB,CAAC,oBAAoB,CAAC;AACnE,OAAO,SAASU,cAAcA,CAACC,KAAyB,EAAE;EACxDN,SAAS,CAAC,MAAM;IACd,MAAMO,+BAA+B,GAAG,MAAAA,CAAA,KAAY;MAElD,IAAIV,QAAQ,CAACW,EAAE,KAAK,SAAS,EAAE;QAC7B,MAAMP,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MAAM,CAAC;EAC/BF,SAAS,EAAE;IACTG,MAAM,EAAE,CAAC;IACTC,KAAK,EAAE;EACT;AACF,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"RootDoorstepAI.d.ts","sourceRoot":"","sources":["../../../src/RootDoorstepAI.tsx"],"names":[],"mappings":"AAaA,wBAAgB,cAAc,CAAC,KAAK,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,2CAiEvD"}
1
+ {"version":3,"file":"RootDoorstepAI.d.ts","sourceRoot":"","sources":["../../../src/RootDoorstepAI.tsx"],"names":[],"mappings":"AAaA,wBAAgB,cAAc,CAAC,KAAK,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,2CAoDvD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doorstepai/dropoff-sdk",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "doorstep.ai dropoff sdk for React Native",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/module/index.js",
@@ -14,21 +14,20 @@ const DoorstepAIView = requireNativeComponent('RootDoorstepAIView');
14
14
  export function RootDoorstepAI(props: { apiKey: string }) {
15
15
  useEffect(() => {
16
16
  const initializeAndRequestPermissions = async () => {
17
- // Initialize SDK
17
+
18
18
  if (Platform.OS === 'android') {
19
19
  await DoorstepAI.init();
20
20
  }
21
21
  DoorstepAI.setApiKey(props.apiKey);
22
22
 
23
- // Request Permissions
23
+
24
24
  if (Platform.OS === 'android') {
25
25
  try {
26
26
  const permissionsToRequest = [
27
27
  PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
28
28
  PermissionsAndroid.PERMISSIONS.ACTIVITY_RECOGNITION,
29
29
  ];
30
- // Background location might be needed depending on SDK functionality
31
- // permissionsToRequest.push(PermissionsAndroid.PERMISSIONS.ACCESS_BACKGROUND_LOCATION);
30
+
32
31
 
33
32
  const granted = await PermissionsAndroid.requestMultiple(
34
33
  permissionsToRequest,
@@ -41,25 +40,13 @@ export function RootDoorstepAI(props: { apiKey: string }) {
41
40
  PermissionsAndroid.RESULTS.GRANTED
42
41
  ) {
43
42
  console.log('Required Android permissions granted');
44
- // Handle background location if requested
45
- // if (granted[PermissionsAndroid.PERMISSIONS.ACCESS_BACKGROUND_LOCATION] === PermissionsAndroid.RESULTS.GRANTED) {
46
- // console.log('Background location permission granted');
47
- // } else {
48
- // console.warn('Background location permission denied');
49
- // }
50
43
  } else {
51
44
  console.warn('One or more required Android permissions denied');
52
- // Handle permission denial (e.g., show a message to the user)
53
45
  }
54
46
  } catch (err) {
55
47
  console.warn('Error requesting Android permissions:', err);
56
48
  }
57
49
  } else if (Platform.OS === 'ios') {
58
- // On iOS, permissions are requested when features are used.
59
- // Ensure you have added the necessary keys to your Info.plist:
60
- // - NSLocationWhenInUseUsageDescription (required)
61
- // - NSLocationAlwaysAndWhenInUseUsageDescription (if background location is needed)
62
- // - NSMotionUsageDescription (required)
63
50
  console.log(
64
51
  'iOS: Ensure location and motion usage descriptions are in Info.plist',
65
52
  );