@infilect-sdk/capacitor-infiviz-shots 1.0.2
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/InfilectcapacitorCapacitorInfivizShots.podspec +30 -0
- package/LICENSE +21 -0
- package/README.md +5 -0
- package/android/build.gradle +116 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/android/gradle.properties +23 -0
- package/android/gradlew +251 -0
- package/android/gradlew.bat +94 -0
- package/android/settings.gradle +23 -0
- package/android/src/main/AndroidManifest.xml +28 -0
- package/android/src/main/consumer-rules.pro +21 -0
- package/android/src/main/java/com/infilectcapacitordev/capacitor/infivizshots/InfivizShotsEvents.kt +15 -0
- package/android/src/main/java/com/infilectcapacitordev/capacitor/infivizshots/InfivizShotsPlugin.kt +814 -0
- package/android/src/main/java/com/infilectcapacitordev/capacitor/infivizshots/PluginConstants.kt +40 -0
- package/android/src/main/java/com/infilectcapacitordev/capacitor/infivizshots/ResponseUtils.kt +80 -0
- package/android/src/main/java/com/infilectcapacitordev/capacitor/infivizshots/samplePlugin.kt +1118 -0
- package/android/src/main/proguard-rules.pro +25 -0
- package/dist/definitions.d.ts +224 -0
- package/dist/definitions.js +2 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +24 -0
- package/dist/web.d.ts +2 -0
- package/dist/web.js +65 -0
- package/ios/InfivizShotSDK.xcframework/Info.plist +44 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/AccuracyCheckViewController.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/ActionProgressSliderView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/ActionableInsightsViewController.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/ActionsHeaderView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/ActionsTableView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/ActionsTableViewCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/ActionsView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/Assets.car +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/BBoxImageSliderViewController.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/Base.lproj/FullImageCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/CategoryTableViewCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/CircleViewWithNumber.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/CollapsibleHeaderView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/CollapsibleTableViewCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/DemoImageCollectionViewCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/EvidenceCategoryViewController.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/FabBtnView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/Headers/InfivizShotSDK-Swift.h +1203 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/Headers/InfivizShotSDK.h +18 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/ImageOverlayView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/ImageQualityCollectionViewCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/ImageQualityView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/ImageSelectionTableViewCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/ImageSelectionViewController.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/ImageViewFullScreenView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/InfivizShotSDK +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/Info.plist +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/LoaderViewController.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/Localizable.strings +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/Modules/InfivizShotSDK.swiftmodule/arm64-apple-ios.abi.json +103989 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/Modules/InfivizShotSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/Modules/InfivizShotSDK.swiftmodule/arm64-apple-ios.swiftmodule +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/Modules/module.modulemap +11 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/NotificationPermissionOverlayView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/OSAActionTableViewCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/PassthroughView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/PhotoSliderView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/ProgressWithActionView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/RealmTimeChartAndGraphViewController.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/RealtimeChartView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/ReasonActionView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/ReasonsActionCellViewTableViewCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/ReasonsListView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/ReasonsTableView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/SKUTableViewCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/SaveRetakeView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/SelectReasonsTableViewCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/SelectReasonsVIew.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/SessionStatusView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/ShelvingActionPopup.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/ShelvingActionsQuestionVIew.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/ShelvingActionsTableViewCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/ShelvingActionsView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/ShelvingHeaderView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/ShelvingViewController.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/SpreadSheetXIBView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/StoreKPITableViewCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/StoreLevelKPIViewController.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/V1ListTabView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/V1ListTableViewCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/V1ListView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/V1ListViewController.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/V1OptionTableViewCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/V1OptionsView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/V1ReasonTableViewCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/V1ReasonsView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/V1TabView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/V1TableViewCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/V1ViewController.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/V3CollectionViewCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/V3ViewController.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/ViewOverlay.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/default_english.json +251 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/en.lproj/FullImageCell.strings +1 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/id.lproj/FullImageCell.strings +1 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/infivizshots.momd/InfivizShotSDKDatabase 2.mom +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/infivizshots.momd/InfivizShotSDKDatabase 3.mom +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/infivizshots.momd/InfivizShotSDKDatabase 4.mom +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/infivizshots.momd/InfivizShotSDKDatabase 5.mom +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/infivizshots.momd/InfivizShotSDKDatabase 6.mom +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/infivizshots.momd/InfivizShotSDKDatabase 7.mom +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/infivizshots.momd/InfivizShotSDKDatabase 7.omo +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/infivizshots.momd/InfivizShotSDKDatabase.mom +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/infivizshots.momd/VersionInfo.plist +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/shotsSDK.storyboardc/8Tq-Ro-cFI-view-Hie-zi-eQ4.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/shotsSDK.storyboardc/CameraViewController.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/shotsSDK.storyboardc/Grb-Na-uhe-view-0fF-4V-Sp4.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/shotsSDK.storyboardc/ImagePreviewDetailsViewController.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/shotsSDK.storyboardc/Info.plist +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/shotsSDK.storyboardc/LoaderViewController.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/shotsSDK.storyboardc/SW9-KF-vYy-view-a8B-9e-hfC.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/shotsSDK.storyboardc/SessionDetailsViewController.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64/InfivizShotSDK.framework/shotsSDK.storyboardc/xUL-ol-gRQ-view-6A8-mO-Rhi.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/AccuracyCheckViewController.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/ActionProgressSliderView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/ActionableInsightsViewController.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/ActionsHeaderView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/ActionsTableView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/ActionsTableViewCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/ActionsView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/Assets.car +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/BBoxImageSliderViewController.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/Base.lproj/FullImageCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/CategoryTableViewCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/CircleViewWithNumber.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/CollapsibleHeaderView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/CollapsibleTableViewCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/DemoImageCollectionViewCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/EvidenceCategoryViewController.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/FabBtnView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/Headers/InfivizShotSDK-Swift.h +2402 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/Headers/InfivizShotSDK.h +18 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/ImageOverlayView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/ImageQualityCollectionViewCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/ImageQualityView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/ImageSelectionTableViewCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/ImageSelectionViewController.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/ImageViewFullScreenView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/InfivizShotSDK +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/Info.plist +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/LoaderViewController.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/Localizable.strings +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/Modules/InfivizShotSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +103989 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/Modules/InfivizShotSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/Modules/InfivizShotSDK.swiftmodule/arm64-apple-ios-simulator.swiftmodule +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/Modules/InfivizShotSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +103989 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/Modules/InfivizShotSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/Modules/InfivizShotSDK.swiftmodule/x86_64-apple-ios-simulator.swiftmodule +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/Modules/module.modulemap +11 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/NotificationPermissionOverlayView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/OSAActionTableViewCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/PassthroughView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/PhotoSliderView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/ProgressWithActionView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/RealmTimeChartAndGraphViewController.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/RealtimeChartView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/ReasonActionView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/ReasonsActionCellViewTableViewCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/ReasonsListView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/ReasonsTableView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/SKUTableViewCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/SaveRetakeView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/SelectReasonsTableViewCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/SelectReasonsVIew.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/SessionStatusView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/ShelvingActionPopup.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/ShelvingActionsQuestionVIew.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/ShelvingActionsTableViewCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/ShelvingActionsView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/ShelvingHeaderView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/ShelvingViewController.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/SpreadSheetXIBView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/StoreKPITableViewCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/StoreLevelKPIViewController.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/V1ListTabView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/V1ListTableViewCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/V1ListView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/V1ListViewController.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/V1OptionTableViewCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/V1OptionsView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/V1ReasonTableViewCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/V1ReasonsView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/V1TabView.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/V1TableViewCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/V1ViewController.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/V3CollectionViewCell.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/V3ViewController.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/ViewOverlay.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/default_english.json +251 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/en.lproj/FullImageCell.strings +1 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/id.lproj/FullImageCell.strings +1 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/infivizshots.momd/InfivizShotSDKDatabase 2.mom +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/infivizshots.momd/InfivizShotSDKDatabase 3.mom +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/infivizshots.momd/InfivizShotSDKDatabase 4.mom +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/infivizshots.momd/InfivizShotSDKDatabase 5.mom +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/infivizshots.momd/InfivizShotSDKDatabase 6.mom +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/infivizshots.momd/InfivizShotSDKDatabase 7.mom +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/infivizshots.momd/InfivizShotSDKDatabase 7.omo +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/infivizshots.momd/InfivizShotSDKDatabase.mom +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/infivizshots.momd/VersionInfo.plist +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/shotsSDK.storyboardc/8Tq-Ro-cFI-view-Hie-zi-eQ4.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/shotsSDK.storyboardc/CameraViewController.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/shotsSDK.storyboardc/Grb-Na-uhe-view-0fF-4V-Sp4.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/shotsSDK.storyboardc/ImagePreviewDetailsViewController.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/shotsSDK.storyboardc/Info.plist +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/shotsSDK.storyboardc/LoaderViewController.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/shotsSDK.storyboardc/SW9-KF-vYy-view-a8B-9e-hfC.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/shotsSDK.storyboardc/SessionDetailsViewController.nib +0 -0
- package/ios/InfivizShotSDK.xcframework/ios-arm64_x86_64-simulator/InfivizShotSDK.framework/shotsSDK.storyboardc/xUL-ol-gRQ-view-6A8-mO-Rhi.nib +0 -0
- package/ios/Plugin/InfivizShotsPlugin.m +24 -0
- package/ios/Plugin/InfivizShotsPlugin.swift +735 -0
- package/ios/Plugin/Info.plist +16 -0
- package/ios/Podfile +8 -0
- package/package.json +58 -0
|
@@ -0,0 +1,1118 @@
|
|
|
1
|
+
//package com.infilectcapacitordev.capacitor.infivizshots
|
|
2
|
+
//
|
|
3
|
+
//import android.util.Log
|
|
4
|
+
//import android.content.Context
|
|
5
|
+
//import android.content.Intent
|
|
6
|
+
//import android.content.BroadcastReceiver
|
|
7
|
+
//import android.content.IntentFilter
|
|
8
|
+
//import androidx.activity.result.contract.ActivityResultContracts
|
|
9
|
+
//import androidx.activity.result.ActivityResult
|
|
10
|
+
//import androidx.activity.result.ActivityResultLauncher
|
|
11
|
+
//import androidx.localbroadcastmanager.content.LocalBroadcastManager
|
|
12
|
+
//import com.getcapacitor.Plugin
|
|
13
|
+
//import com.getcapacitor.PluginCall
|
|
14
|
+
//import com.getcapacitor.PluginMethod
|
|
15
|
+
//import com.getcapacitor.annotation.CapacitorPlugin
|
|
16
|
+
//import com.getcapacitor.JSObject
|
|
17
|
+
//import infilect.infiviz.InfiVizShotsSDK
|
|
18
|
+
//import infilect.infiviz.infilect_client.SDKCallbacks.OnInfivizShotsSDKLogoutListener
|
|
19
|
+
//import infilect.infiviz.infilect_client.SDKCallbacks.OnInfivizShotsSDKInitializationListener
|
|
20
|
+
//import infilect.infiviz.error.SDKExceptions
|
|
21
|
+
//import infilect.infiviz.sdkEnvironment.InfivizshotsEnvironment
|
|
22
|
+
//import infilect.infiviz.App
|
|
23
|
+
//import infilect.infiviz.IntentConstants
|
|
24
|
+
//import infilect.infiviz.infilect_client.SecuredSharedPref.SecuredInfilectSDKPreferences
|
|
25
|
+
//import infilect.infiviz.infilect_client.model.ivyresponse.SDKCallback
|
|
26
|
+
//import com.infilect.actions.ACTION_TYPE
|
|
27
|
+
//import com.infilect.actions.IRResultAndActionsCallback
|
|
28
|
+
//import android.Manifest
|
|
29
|
+
//import androidx.core.content.ContextCompat
|
|
30
|
+
//import android.content.pm.PackageManager
|
|
31
|
+
//import android.os.Build
|
|
32
|
+
//import android.app.Activity
|
|
33
|
+
//import com.google.gson.Gson
|
|
34
|
+
//import infilect.infiviz.infilect_client.model.ivyresponse.InfiSession
|
|
35
|
+
//import infilect.infiviz.infilect_client.model.ivyresponse.DeleteCallBack
|
|
36
|
+
//import infilect.infiviz.error.ErrorEnums
|
|
37
|
+
//
|
|
38
|
+
//@CapacitorPlugin(name = "SamplePlugin")
|
|
39
|
+
//class SamplePlugin : Plugin() {
|
|
40
|
+
//
|
|
41
|
+
//
|
|
42
|
+
// // Callback for startCamera session ID
|
|
43
|
+
// private var startCameraCallbackSessionId: ((String) -> Unit)? = null
|
|
44
|
+
//
|
|
45
|
+
//
|
|
46
|
+
// // Method to handle camera result from MainActivity
|
|
47
|
+
// fun onCameraResult(sessionId: String?, imageDetails: String?) {
|
|
48
|
+
// if (sessionId != null) {
|
|
49
|
+
// startCameraCallbackSessionId?.invoke(sessionId)
|
|
50
|
+
// } else {
|
|
51
|
+
// Log.e("SamplePlugin", "SessionId is null in onCameraResult")
|
|
52
|
+
// }
|
|
53
|
+
// }
|
|
54
|
+
//
|
|
55
|
+
// private var irResultCallback: IRResultAndActionsCallback? = null
|
|
56
|
+
//
|
|
57
|
+
// private var cameraLauncher: ActivityResultLauncher<Intent>? = null
|
|
58
|
+
// private var permissionLauncher: ActivityResultLauncher<Array<String>>? = null
|
|
59
|
+
// private var pendingCameraCall: PluginCall? = null
|
|
60
|
+
//
|
|
61
|
+
// private val syncCallbackBroadcast: BroadcastReceiver = object : BroadcastReceiver() {
|
|
62
|
+
// override fun onReceive(context: Context?, intent: Intent) {
|
|
63
|
+
// val status = intent.getStringExtra(IntentConstants.STATUS)
|
|
64
|
+
// val message = intent.getStringExtra(IntentConstants.MESSAGE)
|
|
65
|
+
// val sessionId = intent.getStringExtra(IntentConstants.SESSION_ID)
|
|
66
|
+
//
|
|
67
|
+
// InfiVizShotsSDK.fetchUniversalSessionId(
|
|
68
|
+
// getActivity(),
|
|
69
|
+
// sessionId,
|
|
70
|
+
// object : SDKCallback<String?> {
|
|
71
|
+
// override fun onSuccess(universalSessionId: String?) {
|
|
72
|
+
// sendEventToCapacitor(
|
|
73
|
+
// "SyncCompleted",
|
|
74
|
+
// sessionId,
|
|
75
|
+
// universalSessionId,
|
|
76
|
+
// status,
|
|
77
|
+
// message
|
|
78
|
+
// )
|
|
79
|
+
// }
|
|
80
|
+
//
|
|
81
|
+
// override fun onError(exception: SDKExceptions) {
|
|
82
|
+
// sendEventToCapacitor(
|
|
83
|
+
// "SyncCompleted",
|
|
84
|
+
// exception.getSessionId(),
|
|
85
|
+
// "",
|
|
86
|
+
// exception.getStatus().toString(),
|
|
87
|
+
// exception.message
|
|
88
|
+
// )
|
|
89
|
+
// }
|
|
90
|
+
// })
|
|
91
|
+
// }
|
|
92
|
+
// }
|
|
93
|
+
//
|
|
94
|
+
// override fun load() {
|
|
95
|
+
// super.load()
|
|
96
|
+
//
|
|
97
|
+
// // Register permission launcher
|
|
98
|
+
// permissionLauncher = activity.registerForActivityResult(ActivityResultContracts.RequestMultiplePermissions()) { permissions ->
|
|
99
|
+
// val allGranted = permissions.values.all { it }
|
|
100
|
+
// if (allGranted) {
|
|
101
|
+
// pendingCameraCall?.let { call ->
|
|
102
|
+
// startCameraInternal(call)
|
|
103
|
+
// }
|
|
104
|
+
// } else {
|
|
105
|
+
// Log.e("SamplePlugin", "Permissions denied")
|
|
106
|
+
// pendingCameraCall?.let { call ->
|
|
107
|
+
// call.resolve(ResponseUtils.createErrorResponse(PluginConstants.ERROR_PERMISSION_DENIED, PluginConstants.MESSAGE_PERMISSION_DENIED))
|
|
108
|
+
// }
|
|
109
|
+
// }
|
|
110
|
+
// pendingCameraCall = null
|
|
111
|
+
// }
|
|
112
|
+
//
|
|
113
|
+
// cameraLauncher = activity.registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { activityResult: ActivityResult ->
|
|
114
|
+
//
|
|
115
|
+
// when (activityResult.resultCode) {
|
|
116
|
+
// Activity.RESULT_OK, PluginConstants.CAMERA_REQUEST_CODE -> { // RESULT_OK or custom request code for camera
|
|
117
|
+
// if (activityResult.data != null) {
|
|
118
|
+
// val tempSessionId: String? = activityResult.data?.getStringExtra(IntentConstants.TEMP_SESSION_ID)
|
|
119
|
+
// val sessionId: String? = activityResult.data?.getStringExtra(IntentConstants.SESSION_ID)
|
|
120
|
+
// val imageDetails: String? = activityResult.data?.getStringExtra(IntentConstants.IMAGE_DETAILS)
|
|
121
|
+
//
|
|
122
|
+
// Log.i("SamplePlugin", "Camera success - tempSessionId: $tempSessionId, sessionId: $sessionId, imageDetails: $imageDetails")
|
|
123
|
+
//
|
|
124
|
+
// // Use tempSessionId first, fallback to sessionId
|
|
125
|
+
// val finalSessionId = tempSessionId ?: sessionId
|
|
126
|
+
// if (finalSessionId != null) {
|
|
127
|
+
// Log.i("SamplePlugin", "Invoking callback with sessionId: $finalSessionId")
|
|
128
|
+
// startCameraCallbackSessionId?.invoke(finalSessionId)
|
|
129
|
+
// } else {
|
|
130
|
+
// Log.e("SamplePlugin", "No session ID found in camera result")
|
|
131
|
+
// // Try to get sessionId from the intent extras if not found in data
|
|
132
|
+
// val intentSessionId = activityResult.data?.getStringExtra("sessionId")
|
|
133
|
+
// if (intentSessionId != null) {
|
|
134
|
+
// Log.i("SamplePlugin", "Found sessionId in intent extras: $intentSessionId")
|
|
135
|
+
// startCameraCallbackSessionId?.invoke(intentSessionId)
|
|
136
|
+
// } else {
|
|
137
|
+
// Log.e("SamplePlugin", "No session ID found anywhere in camera result")
|
|
138
|
+
// }
|
|
139
|
+
// }
|
|
140
|
+
// } else {
|
|
141
|
+
// Log.e("SamplePlugin", "Camera result data is null")
|
|
142
|
+
// }
|
|
143
|
+
// }
|
|
144
|
+
// Activity.RESULT_CANCELED -> { // RESULT_CANCELED
|
|
145
|
+
// Log.w("SamplePlugin", "Camera was canceled by user")
|
|
146
|
+
// }
|
|
147
|
+
// else -> {
|
|
148
|
+
// Log.w("SamplePlugin", "Camera returned unexpected result code: ${activityResult.resultCode}")
|
|
149
|
+
// }
|
|
150
|
+
// }
|
|
151
|
+
// }
|
|
152
|
+
//
|
|
153
|
+
// // Register broadcast receiver
|
|
154
|
+
// val filter = IntentFilter("sync_callback_broadcast")
|
|
155
|
+
// LocalBroadcastManager.getInstance(context)
|
|
156
|
+
// .registerReceiver(syncCallbackBroadcast, filter)
|
|
157
|
+
//
|
|
158
|
+
// // Set up IR result callback
|
|
159
|
+
// irResultCallback = object : IRResultAndActionsCallback {
|
|
160
|
+
// override fun onCallback(
|
|
161
|
+
// globalSessionId: String,
|
|
162
|
+
// isSuccess: Boolean,
|
|
163
|
+
// broadCastFor: ACTION_TYPE,
|
|
164
|
+
// message: String
|
|
165
|
+
// ) {
|
|
166
|
+
// when (broadCastFor) {
|
|
167
|
+
// ACTION_TYPE.ACTION_GENERATED -> sendSessionRealTimeResultEvent(
|
|
168
|
+
// globalSessionId,
|
|
169
|
+
// message,
|
|
170
|
+
// "ActionsGeneratedEvent"
|
|
171
|
+
// )
|
|
172
|
+
//
|
|
173
|
+
// ACTION_TYPE.RESULTS_GENERATED -> sendSessionRealTimeResultEvent(
|
|
174
|
+
// globalSessionId,
|
|
175
|
+
// message,
|
|
176
|
+
// "SessionRealTimeResultEvent"
|
|
177
|
+
// )
|
|
178
|
+
// }
|
|
179
|
+
// }
|
|
180
|
+
// }
|
|
181
|
+
// InfiVizShotsSDK.setIRResultAndActionsCallback(irResultCallback)
|
|
182
|
+
// }
|
|
183
|
+
//
|
|
184
|
+
// private fun sendEventToCapacitor(
|
|
185
|
+
// eventName: String?,
|
|
186
|
+
// sessionId: String?,
|
|
187
|
+
// universalSessionId: String?,
|
|
188
|
+
// status: String?,
|
|
189
|
+
// message: String?
|
|
190
|
+
// ) {
|
|
191
|
+
// val params = JSObject()
|
|
192
|
+
// params.put("temporarySessionId", sessionId)
|
|
193
|
+
// params.put("universalSessionId", universalSessionId)
|
|
194
|
+
// params.put("status", status)
|
|
195
|
+
// params.put("message", message)
|
|
196
|
+
// notifyListeners(eventName, params)
|
|
197
|
+
// }
|
|
198
|
+
//
|
|
199
|
+
// private fun sendEventToCapacitor(eventName: String?, sessionId: String?) {
|
|
200
|
+
// val params = JSObject()
|
|
201
|
+
// params.put("sessionId", sessionId)
|
|
202
|
+
// notifyListeners(eventName, params)
|
|
203
|
+
// }
|
|
204
|
+
//
|
|
205
|
+
// private fun sendSessionRealTimeResultEvent(
|
|
206
|
+
// sessionId: String?,
|
|
207
|
+
// message: String?,
|
|
208
|
+
// sdkEvent: String?
|
|
209
|
+
// ) {
|
|
210
|
+
// val params = JSObject()
|
|
211
|
+
// params.put("sessionId", sessionId)
|
|
212
|
+
// params.put("message", message)
|
|
213
|
+
// notifyListeners(sdkEvent, params)
|
|
214
|
+
// }
|
|
215
|
+
//
|
|
216
|
+
// @PluginMethod
|
|
217
|
+
// fun echo(call: PluginCall) {
|
|
218
|
+
// val value = call.getString("value") ?: "Default Value"
|
|
219
|
+
//
|
|
220
|
+
// val ret = JSObject()
|
|
221
|
+
// ret.put("value", value)
|
|
222
|
+
// call.resolve(ret)
|
|
223
|
+
// }
|
|
224
|
+
//
|
|
225
|
+
// @PluginMethod
|
|
226
|
+
// fun initialize(call: PluginCall) {
|
|
227
|
+
// try {
|
|
228
|
+
// val appID = call.getString("appID")
|
|
229
|
+
// val authSecret = call.getString("authSecret")
|
|
230
|
+
// val accountKey = call.getString("accountKey")
|
|
231
|
+
// val userID = call.getString("userID")
|
|
232
|
+
// val clientID = call.getString("clientID")
|
|
233
|
+
// val apiToken = call.getString("apiToken")
|
|
234
|
+
// val env = call.getString("env")
|
|
235
|
+
//
|
|
236
|
+
// val context = this.context
|
|
237
|
+
// if (context == null) {
|
|
238
|
+
// call.resolve(ResponseUtils.createContextErrorResponse())
|
|
239
|
+
// return
|
|
240
|
+
// }
|
|
241
|
+
//
|
|
242
|
+
// val appContext = context.applicationContext
|
|
243
|
+
//
|
|
244
|
+
// if (infilect.infiviz.App.appInstance == null) {
|
|
245
|
+
// call.resolve(ResponseUtils.createAppNotInitializedErrorResponse())
|
|
246
|
+
// return
|
|
247
|
+
// }
|
|
248
|
+
//
|
|
249
|
+
// val environment = if ("staging" == env) InfivizshotsEnvironment.UAT else InfivizshotsEnvironment.PROD
|
|
250
|
+
//
|
|
251
|
+
// InfiVizShotsSDK.init(appContext, object : OnInfivizShotsSDKInitializationListener {
|
|
252
|
+
// override fun onInfivizShotsSDKInitSuccess() {
|
|
253
|
+
// val result = JSObject()
|
|
254
|
+
// result.put("message", "SDK initialized successfully!")
|
|
255
|
+
// result.put("status", "723")
|
|
256
|
+
// call.resolve(result)
|
|
257
|
+
// }
|
|
258
|
+
//
|
|
259
|
+
// override fun onInfivizShotsSDKInitFailed(exception: SDKExceptions) {
|
|
260
|
+
// val err = JSObject()
|
|
261
|
+
// err.put("message", exception.message)
|
|
262
|
+
// err.put("status", exception.getStatus()?.toString())
|
|
263
|
+
// err.put("sessionId", exception.getSessionId())
|
|
264
|
+
// call.resolve(err)
|
|
265
|
+
// }
|
|
266
|
+
// }, appID, authSecret, accountKey, userID, clientID, apiToken, environment, false)
|
|
267
|
+
//
|
|
268
|
+
// } catch (e: Exception) {
|
|
269
|
+
// call.resolve(ResponseUtils.createErrorResponse(PluginConstants.ERROR_EXCEPTION, "SDK Initialization Failed: ${e.message}"))
|
|
270
|
+
// }
|
|
271
|
+
// }
|
|
272
|
+
//
|
|
273
|
+
// private fun isAppInitialized(): Boolean {
|
|
274
|
+
// return try {
|
|
275
|
+
// infilect.infiviz.App.appInstance != null
|
|
276
|
+
// } catch (e: Exception) {
|
|
277
|
+
// false
|
|
278
|
+
// }
|
|
279
|
+
// }
|
|
280
|
+
//
|
|
281
|
+
// @PluginMethod
|
|
282
|
+
// fun checkSDKStatus(call: PluginCall) {
|
|
283
|
+
// try {
|
|
284
|
+
// // Get context safely - use the plugin's context which is always available
|
|
285
|
+
// val context = this.context
|
|
286
|
+
// if (context == null) {
|
|
287
|
+
// val result = JSObject()
|
|
288
|
+
// result.put("isAppInitialized", false)
|
|
289
|
+
// result.put("isSDKInitialized", false)
|
|
290
|
+
// result.put("message", PluginConstants.MESSAGE_CONTEXT_NULL)
|
|
291
|
+
// call.resolve(result)
|
|
292
|
+
// return
|
|
293
|
+
// }
|
|
294
|
+
//
|
|
295
|
+
// // Use Application context for SDK operations
|
|
296
|
+
// val appContext = context.applicationContext
|
|
297
|
+
//
|
|
298
|
+
// // Check App initialization
|
|
299
|
+
// val isAppInit = isAppInitialized()
|
|
300
|
+
//
|
|
301
|
+
// // Check SDK initialization by looking for auth key
|
|
302
|
+
// val authKey = try {
|
|
303
|
+
// infilect.infiviz.infilect_client.SecuredSharedPref.SecuredInfilectSDKPreferences.getAuthKey(appContext)
|
|
304
|
+
// } catch (e: Exception) {
|
|
305
|
+
// null
|
|
306
|
+
// }
|
|
307
|
+
//
|
|
308
|
+
// val isSDKInit = !authKey.isNullOrEmpty()
|
|
309
|
+
//
|
|
310
|
+
// val result = JSObject()
|
|
311
|
+
// result.put("isAppInitialized", isAppInit)
|
|
312
|
+
// result.put("isSDKInitialized", isSDKInit)
|
|
313
|
+
// result.put("appInstance", infilect.infiviz.App.appInstance?.toString() ?: "null")
|
|
314
|
+
// result.put("message", "SDK Status checked successfully")
|
|
315
|
+
//
|
|
316
|
+
// call.resolve(result)
|
|
317
|
+
//
|
|
318
|
+
// } catch (e: Exception) {
|
|
319
|
+
// val result = JSObject()
|
|
320
|
+
// result.put("isAppInitialized", false)
|
|
321
|
+
// result.put("isSDKInitialized", false)
|
|
322
|
+
// result.put("message", "SDK Status check failed: ${e.message}")
|
|
323
|
+
// call.resolve(result)
|
|
324
|
+
// }
|
|
325
|
+
// }
|
|
326
|
+
// @PluginMethod
|
|
327
|
+
// fun startCamera(call: PluginCall) {
|
|
328
|
+
// // Check permissions first
|
|
329
|
+
// if (!checkCameraPermissions()) {
|
|
330
|
+
// pendingCameraCall = call
|
|
331
|
+
// requestCameraPermissions()
|
|
332
|
+
// return
|
|
333
|
+
// }
|
|
334
|
+
//
|
|
335
|
+
// startCameraInternal(call)
|
|
336
|
+
// }
|
|
337
|
+
//
|
|
338
|
+
// private fun checkCameraPermissions(): Boolean {
|
|
339
|
+
// val permissions = getRequiredCameraPermissions()
|
|
340
|
+
// return permissions.all { permission ->
|
|
341
|
+
// ContextCompat.checkSelfPermission(getContext(), permission) == PackageManager.PERMISSION_GRANTED
|
|
342
|
+
// }
|
|
343
|
+
// }
|
|
344
|
+
//
|
|
345
|
+
// private fun getRequiredCameraPermissions(): Array<String> {
|
|
346
|
+
// return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
|
347
|
+
// arrayOf(
|
|
348
|
+
// Manifest.permission.CAMERA,
|
|
349
|
+
// Manifest.permission.READ_PHONE_STATE,
|
|
350
|
+
// Manifest.permission.ACCESS_FINE_LOCATION,
|
|
351
|
+
// Manifest.permission.POST_NOTIFICATIONS
|
|
352
|
+
// )
|
|
353
|
+
// } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
|
354
|
+
// arrayOf(
|
|
355
|
+
// Manifest.permission.CAMERA,
|
|
356
|
+
// Manifest.permission.READ_PHONE_STATE,
|
|
357
|
+
// Manifest.permission.ACCESS_FINE_LOCATION
|
|
358
|
+
// )
|
|
359
|
+
// } else {
|
|
360
|
+
// arrayOf(
|
|
361
|
+
// Manifest.permission.CAMERA,
|
|
362
|
+
// Manifest.permission.READ_PHONE_STATE,
|
|
363
|
+
// Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
|
364
|
+
// Manifest.permission.ACCESS_FINE_LOCATION
|
|
365
|
+
// )
|
|
366
|
+
// }
|
|
367
|
+
// }
|
|
368
|
+
//
|
|
369
|
+
// private fun requestCameraPermissions() {
|
|
370
|
+
// val permissions = getRequiredCameraPermissions()
|
|
371
|
+
// permissionLauncher?.launch(permissions)
|
|
372
|
+
// }
|
|
373
|
+
//
|
|
374
|
+
// private fun startCameraInternal(call: PluginCall) {
|
|
375
|
+
// try {
|
|
376
|
+
// val taskName = call.getString("taskName") ?: ""
|
|
377
|
+
// val storeTitle = call.getString("storeTitle") ?: ""
|
|
378
|
+
// val storeId = call.getString("storeId") ?: ""
|
|
379
|
+
// val photoType = call.getString("photoType") ?: ""
|
|
380
|
+
// val category = call.getString("category") ?: ""
|
|
381
|
+
// val maxPhoto = call.getInt("maxPhoto") ?: 0
|
|
382
|
+
// val maxPhotoOneGo = call.getInt("maxPhotoOneGo") ?: 0
|
|
383
|
+
// val env = call.getString("env")
|
|
384
|
+
//
|
|
385
|
+
// val context = this.context
|
|
386
|
+
// if (context == null) {
|
|
387
|
+
// call.resolve(ResponseUtils.createContextErrorResponse())
|
|
388
|
+
// return
|
|
389
|
+
// }
|
|
390
|
+
//
|
|
391
|
+
// val appContext = context.applicationContext
|
|
392
|
+
//
|
|
393
|
+
// if (!isAppInitialized()) {
|
|
394
|
+
// call.resolve(ResponseUtils.createAppNotInitializedErrorResponse())
|
|
395
|
+
// return
|
|
396
|
+
// }
|
|
397
|
+
//
|
|
398
|
+
// val authKey = try {
|
|
399
|
+
// infilect.infiviz.infilect_client.SecuredSharedPref.SecuredInfilectSDKPreferences.getAuthKey(appContext)
|
|
400
|
+
// } catch (e: Exception) {
|
|
401
|
+
// null
|
|
402
|
+
// }
|
|
403
|
+
//
|
|
404
|
+
// if (authKey.isNullOrEmpty()) {
|
|
405
|
+
// call.resolve(ResponseUtils.createSDKNotInitializedErrorResponse())
|
|
406
|
+
// return
|
|
407
|
+
// }
|
|
408
|
+
//
|
|
409
|
+
// val environment = if ("staging" == env) InfivizshotsEnvironment.UAT else InfivizshotsEnvironment.PROD
|
|
410
|
+
//
|
|
411
|
+
// if (cameraLauncher == null) {
|
|
412
|
+
// call.resolve(ResponseUtils.createErrorResponse(PluginConstants.ERROR_CAMERA_LAUNCHER_NULL, PluginConstants.MESSAGE_CAMERA_LAUNCHER_NULL))
|
|
413
|
+
// return
|
|
414
|
+
// }
|
|
415
|
+
//
|
|
416
|
+
// startCameraCallbackSessionId = { sessionId ->
|
|
417
|
+
// val result = JSObject()
|
|
418
|
+
// result.put("sessionId", sessionId)
|
|
419
|
+
// call.resolve(result)
|
|
420
|
+
// }
|
|
421
|
+
//
|
|
422
|
+
// InfiVizShotsSDK.startCamera(
|
|
423
|
+
// getActivity(),
|
|
424
|
+
// taskName,
|
|
425
|
+
// storeTitle,
|
|
426
|
+
// storeId,
|
|
427
|
+
// photoType,
|
|
428
|
+
// category,
|
|
429
|
+
// maxPhoto,
|
|
430
|
+
// maxPhotoOneGo,
|
|
431
|
+
// PluginConstants.CAMERA_REQUEST_CODE,
|
|
432
|
+
// object : SDKCallback<String> {
|
|
433
|
+
// override fun onSuccess(response: String) {
|
|
434
|
+
// }
|
|
435
|
+
//
|
|
436
|
+
// override fun onError(exception: SDKExceptions) {
|
|
437
|
+
// val err = JSObject()
|
|
438
|
+
// err.put("message", exception.message)
|
|
439
|
+
// err.put("status", exception.getStatus()?.toString())
|
|
440
|
+
// err.put("sessionId", exception.getSessionId())
|
|
441
|
+
// call.resolve(err)
|
|
442
|
+
// }
|
|
443
|
+
// },
|
|
444
|
+
// cameraLauncher
|
|
445
|
+
// )
|
|
446
|
+
//
|
|
447
|
+
// } catch (e: Exception) {
|
|
448
|
+
// val result = ResponseUtils.createErrorResponse(PluginConstants.ERROR_EXCEPTION, "Start camera failed: ${e.message}")
|
|
449
|
+
// result.put("errorType", e.javaClass.simpleName)
|
|
450
|
+
// call.resolve(result)
|
|
451
|
+
// }
|
|
452
|
+
// }
|
|
453
|
+
//
|
|
454
|
+
// @PluginMethod
|
|
455
|
+
// fun logout(call: PluginCall) {
|
|
456
|
+
// try {
|
|
457
|
+
// val context = this.context
|
|
458
|
+
// if (context == null) {
|
|
459
|
+
// call.resolve(ResponseUtils.createErrorResponse(PluginConstants.ERROR_CONTEXT, "SDK Logout failed: ${PluginConstants.MESSAGE_CONTEXT_NULL}"))
|
|
460
|
+
// return
|
|
461
|
+
// }
|
|
462
|
+
//
|
|
463
|
+
// val appContext = context.applicationContext
|
|
464
|
+
//
|
|
465
|
+
// if (!isAppInitialized()) {
|
|
466
|
+
// call.resolve(ResponseUtils.createErrorResponse(PluginConstants.ERROR_APP_NOT_INITIALIZED, "SDK Logout failed: ${PluginConstants.MESSAGE_APP_NOT_INIT}"))
|
|
467
|
+
// return
|
|
468
|
+
// }
|
|
469
|
+
//
|
|
470
|
+
// val authKey = try {
|
|
471
|
+
// infilect.infiviz.infilect_client.SecuredSharedPref.SecuredInfilectSDKPreferences.getAuthKey(appContext)
|
|
472
|
+
// } catch (e: Exception) {
|
|
473
|
+
// null
|
|
474
|
+
// }
|
|
475
|
+
//
|
|
476
|
+
// if (authKey.isNullOrEmpty()) {
|
|
477
|
+
// call.resolve(ResponseUtils.createErrorResponse(PluginConstants.ERROR_SDK_NOT_INITIALIZED, "SDK Logout failed: InfiViz Shots SDK is not initialized properly. Please re-initialize"))
|
|
478
|
+
// return
|
|
479
|
+
// }
|
|
480
|
+
//
|
|
481
|
+
// InfiVizShotsSDK.logoutSDK(appContext, object : OnInfivizShotsSDKLogoutListener {
|
|
482
|
+
// override fun onInfivizShotsSDKLogoutSuccess() {
|
|
483
|
+
// val result = JSObject()
|
|
484
|
+
// result.put("message", "SDK Logout success")
|
|
485
|
+
// result.put("status", "723")
|
|
486
|
+
// call.resolve(result)
|
|
487
|
+
// }
|
|
488
|
+
//
|
|
489
|
+
// override fun onInfivizShotsSDKLogoutFailed(exception: SDKExceptions) {
|
|
490
|
+
// val err = JSObject()
|
|
491
|
+
// err.put("message", exception.message)
|
|
492
|
+
// err.put("status", exception.getStatus()?.toString())
|
|
493
|
+
// err.put("sessionId", exception.getSessionId())
|
|
494
|
+
// call.resolve(err)
|
|
495
|
+
// }
|
|
496
|
+
// })
|
|
497
|
+
//
|
|
498
|
+
// } catch (e: Exception) {
|
|
499
|
+
// call.resolve(ResponseUtils.createErrorResponse(PluginConstants.ERROR_EXCEPTION, "SDK Logout failed: ${e.message}"))
|
|
500
|
+
// }
|
|
501
|
+
// }
|
|
502
|
+
//
|
|
503
|
+
// @PluginMethod
|
|
504
|
+
// fun syncSession(call: PluginCall) {
|
|
505
|
+
// try {
|
|
506
|
+
// val sessionId = call.getString("sessionId")
|
|
507
|
+
//
|
|
508
|
+
// val context = this.context
|
|
509
|
+
// if (context == null) {
|
|
510
|
+
// call.resolve(ResponseUtils.createContextErrorResponse())
|
|
511
|
+
// return
|
|
512
|
+
// }
|
|
513
|
+
//
|
|
514
|
+
// if (!isAppInitialized()) {
|
|
515
|
+
// val result = JSObject()
|
|
516
|
+
// result.put("message", "App instance not initialized. Please check MainApplication setup.")
|
|
517
|
+
// result.put("error", "APP_NOT_INITIALIZED")
|
|
518
|
+
// call.resolve(result)
|
|
519
|
+
// return
|
|
520
|
+
// }
|
|
521
|
+
//
|
|
522
|
+
// val authKey = try {
|
|
523
|
+
// infilect.infiviz.infilect_client.SecuredSharedPref.SecuredInfilectSDKPreferences.getAuthKey(context.applicationContext)
|
|
524
|
+
// } catch (e: Exception) {
|
|
525
|
+
// null
|
|
526
|
+
// }
|
|
527
|
+
//
|
|
528
|
+
// if (authKey.isNullOrEmpty()) {
|
|
529
|
+
// val result = JSObject()
|
|
530
|
+
// result.put("message", "InfiViz Shots SDK is not initialized properly. Please re-initialize")
|
|
531
|
+
// result.put("error", "SDK_NOT_INITIALIZED")
|
|
532
|
+
// result.put("status", 706)
|
|
533
|
+
// call.resolve(result)
|
|
534
|
+
// return
|
|
535
|
+
// }
|
|
536
|
+
//
|
|
537
|
+
// val sessionIds = ArrayList<String?>()
|
|
538
|
+
// sessionIds.add(sessionId)
|
|
539
|
+
//
|
|
540
|
+
// InfiVizShotsSDK.uploadSession(getActivity(), sessionIds, object : SDKCallback<String?> {
|
|
541
|
+
// override fun onSuccess(syncedSession: String?) {
|
|
542
|
+
// InfiVizShotsSDK.fetchUniversalSessionId(
|
|
543
|
+
// getActivity(),
|
|
544
|
+
// sessionId,
|
|
545
|
+
// object : SDKCallback<String?> {
|
|
546
|
+
// override fun onSuccess(universalSessionId: String?) {
|
|
547
|
+
// sendEventToCapacitor(
|
|
548
|
+
// "SyncCompleted",
|
|
549
|
+
// syncedSession,
|
|
550
|
+
// universalSessionId,
|
|
551
|
+
// "200",
|
|
552
|
+
// syncedSession
|
|
553
|
+
// )
|
|
554
|
+
//
|
|
555
|
+
// val data = JSObject()
|
|
556
|
+
// data.put("syncedSession", syncedSession)
|
|
557
|
+
// data.put("universalSessionId", universalSessionId)
|
|
558
|
+
// call.resolve(ResponseUtils.createSuccessResponse(PluginConstants.MESSAGE_SESSION_SYNCED, data))
|
|
559
|
+
// }
|
|
560
|
+
//
|
|
561
|
+
// override fun onError(exception: SDKExceptions) {
|
|
562
|
+
// sendEventToCapacitor(
|
|
563
|
+
// "SyncCompleted",
|
|
564
|
+
// syncedSession,
|
|
565
|
+
// "",
|
|
566
|
+
// exception.getStatus().toString(),
|
|
567
|
+
// exception.message
|
|
568
|
+
// )
|
|
569
|
+
//
|
|
570
|
+
// val data = JSObject()
|
|
571
|
+
// data.put("syncedSession", syncedSession)
|
|
572
|
+
// call.resolve(ResponseUtils.createSuccessResponse("Session synced but failed to get universal session ID: ${exception.message}", data))
|
|
573
|
+
// }
|
|
574
|
+
// })
|
|
575
|
+
// }
|
|
576
|
+
//
|
|
577
|
+
// override fun onError(exception: SDKExceptions) {
|
|
578
|
+
// sendEventToCapacitor(
|
|
579
|
+
// "SyncCompleted",
|
|
580
|
+
// exception.getSessionId(),
|
|
581
|
+
// "",
|
|
582
|
+
// exception.getStatus().toString(),
|
|
583
|
+
// exception.message
|
|
584
|
+
// )
|
|
585
|
+
//
|
|
586
|
+
// call.resolve(ResponseUtils.createErrorResponse(PluginConstants.ERROR_SDK_ERROR, "${exception.message}", exception.getStatus().toString()))
|
|
587
|
+
// }
|
|
588
|
+
// })
|
|
589
|
+
//
|
|
590
|
+
// } catch (e: Exception) {
|
|
591
|
+
// val result = ResponseUtils.createErrorResponse(PluginConstants.ERROR_EXCEPTION, "Sync session failed: ${e.message}")
|
|
592
|
+
// result.put("errorType", e.javaClass.simpleName)
|
|
593
|
+
// call.resolve(result)
|
|
594
|
+
// }
|
|
595
|
+
// }
|
|
596
|
+
//
|
|
597
|
+
// @PluginMethod
|
|
598
|
+
// fun fetchSessionDetails(call: PluginCall) {
|
|
599
|
+
// try {
|
|
600
|
+
// val temporarySessionID = call.getString("temporarySessionID") ?: ""
|
|
601
|
+
//
|
|
602
|
+
// val context = this.context
|
|
603
|
+
// if (context == null) {
|
|
604
|
+
// call.resolve(ResponseUtils.createContextErrorResponse())
|
|
605
|
+
// return
|
|
606
|
+
// }
|
|
607
|
+
//
|
|
608
|
+
// if (!isAppInitialized()) {
|
|
609
|
+
// call.resolve(ResponseUtils.createAppNotInitializedErrorResponse())
|
|
610
|
+
// return
|
|
611
|
+
// }
|
|
612
|
+
//
|
|
613
|
+
// val authKey = try {
|
|
614
|
+
// infilect.infiviz.infilect_client.SecuredSharedPref.SecuredInfilectSDKPreferences.getAuthKey(context.applicationContext)
|
|
615
|
+
// } catch (e: Exception) {
|
|
616
|
+
// null
|
|
617
|
+
// }
|
|
618
|
+
//
|
|
619
|
+
// if (authKey.isNullOrEmpty()) {
|
|
620
|
+
// call.resolve(ResponseUtils.createSDKNotInitializedErrorResponse())
|
|
621
|
+
// return
|
|
622
|
+
// }
|
|
623
|
+
//
|
|
624
|
+
// InfiVizShotsSDK.fetchSessionDetails(
|
|
625
|
+
// getActivity(),
|
|
626
|
+
// temporarySessionID,
|
|
627
|
+
// object : SDKCallback<String?> {
|
|
628
|
+
// override fun onSuccess(response: String?) {
|
|
629
|
+
// try {
|
|
630
|
+
// val jsonResponse = org.json.JSONObject(response ?: "{}")
|
|
631
|
+
// val out = JSObject().apply {
|
|
632
|
+
// put("data", jsonResponse.optString("data"))
|
|
633
|
+
// put("status", jsonResponse.optString("status"))
|
|
634
|
+
// put("message", jsonResponse.optString("message"))
|
|
635
|
+
// }
|
|
636
|
+
// call.resolve(out)
|
|
637
|
+
// } catch (e: Exception) {
|
|
638
|
+
// val err = JSObject()
|
|
639
|
+
// err.put("message", e.message)
|
|
640
|
+
// call.resolve(err)
|
|
641
|
+
// }
|
|
642
|
+
// }
|
|
643
|
+
//
|
|
644
|
+
// override fun onError(exception: SDKExceptions) {
|
|
645
|
+
// val err = JSObject()
|
|
646
|
+
// err.put("message", exception.message)
|
|
647
|
+
// err.put("status", exception.getStatus()?.toString())
|
|
648
|
+
// err.put("sessionId", exception.getSessionId())
|
|
649
|
+
// call.resolve(err)
|
|
650
|
+
// }
|
|
651
|
+
// })
|
|
652
|
+
//
|
|
653
|
+
// } catch (e: Exception) {
|
|
654
|
+
// val result = ResponseUtils.createErrorResponse(PluginConstants.ERROR_EXCEPTION, "Fetch session details failed: ${e.message}")
|
|
655
|
+
// result.put("errorType", e.javaClass.simpleName)
|
|
656
|
+
// call.resolve(result)
|
|
657
|
+
// }
|
|
658
|
+
// }
|
|
659
|
+
// @PluginMethod
|
|
660
|
+
// fun deletePhoto(call: PluginCall) {
|
|
661
|
+
// try {
|
|
662
|
+
// val temporarySessionId = call.getString("temporarySessionId")?: ""
|
|
663
|
+
// val imageURI = call.getString("imageURI")?: ""
|
|
664
|
+
//
|
|
665
|
+
//// if (temporarySessionId.isNullOrEmpty() || imageURI.isNullOrEmpty()) {
|
|
666
|
+
//// val missingFields = listOf(
|
|
667
|
+
//// if (temporarySessionId.isNullOrEmpty()) "temporarySessionId" else null,
|
|
668
|
+
//// if (imageURI.isNullOrEmpty()) "imageURI" else null
|
|
669
|
+
//// ).filterNotNull()
|
|
670
|
+
//// call.resolve(
|
|
671
|
+
//// ResponseUtils.createValidationErrorResponse(
|
|
672
|
+
//// "${PluginConstants.MESSAGE_MISSING_PARAMS} for deletePhoto",
|
|
673
|
+
//// missingFields
|
|
674
|
+
//// )
|
|
675
|
+
//// )
|
|
676
|
+
//// return
|
|
677
|
+
//// }
|
|
678
|
+
//
|
|
679
|
+
// val context = this.context
|
|
680
|
+
// if (context == null) {
|
|
681
|
+
// call.resolve(ResponseUtils.createContextErrorResponse())
|
|
682
|
+
// return
|
|
683
|
+
// }
|
|
684
|
+
//
|
|
685
|
+
// if (!isAppInitialized()) {
|
|
686
|
+
// call.resolve(ResponseUtils.createAppNotInitializedErrorResponse())
|
|
687
|
+
// return
|
|
688
|
+
// }
|
|
689
|
+
//
|
|
690
|
+
// val authKey = try {
|
|
691
|
+
// infilect.infiviz.infilect_client.SecuredSharedPref.SecuredInfilectSDKPreferences.getAuthKey(context.applicationContext)
|
|
692
|
+
// } catch (e: Exception) {
|
|
693
|
+
// null
|
|
694
|
+
// }
|
|
695
|
+
//
|
|
696
|
+
// if (authKey.isNullOrEmpty()) {
|
|
697
|
+
// call.resolve(ResponseUtils.createSDKNotInitializedErrorResponse())
|
|
698
|
+
// return
|
|
699
|
+
// }
|
|
700
|
+
//
|
|
701
|
+
// InfiVizShotsSDK.deleteImage(
|
|
702
|
+
// getActivity(),
|
|
703
|
+
// temporarySessionId,
|
|
704
|
+
// imageURI,
|
|
705
|
+
// object : DeleteCallBack() {
|
|
706
|
+
// override fun onSuccess(tempSessionId: String?, errorEnums: ErrorEnums?) {
|
|
707
|
+
// if (errorEnums != null) {
|
|
708
|
+
// val err = JSObject()
|
|
709
|
+
// err.put("message", errorEnums.getMessage())
|
|
710
|
+
// err.put("status", errorEnums.getStatus()?.toString())
|
|
711
|
+
// call.resolve(err)
|
|
712
|
+
// } else {
|
|
713
|
+
// call.resolve(JSObject())
|
|
714
|
+
// }
|
|
715
|
+
// }
|
|
716
|
+
//
|
|
717
|
+
// override fun onError(exception: SDKExceptions) {
|
|
718
|
+
// val err = JSObject()
|
|
719
|
+
// err.put("message", exception.message)
|
|
720
|
+
// err.put("status", exception.getStatus()?.toString())
|
|
721
|
+
// err.put("sessionId", exception.getSessionId())
|
|
722
|
+
// call.resolve(err)
|
|
723
|
+
// }
|
|
724
|
+
// }
|
|
725
|
+
// )
|
|
726
|
+
//
|
|
727
|
+
// } catch (e: Exception) {
|
|
728
|
+
// val result = ResponseUtils.createErrorResponse(
|
|
729
|
+
// PluginConstants.ERROR_EXCEPTION,
|
|
730
|
+
// "Delete photo failed: ${e.message}"
|
|
731
|
+
// )
|
|
732
|
+
// result.put("errorType", e.javaClass.simpleName)
|
|
733
|
+
// call.resolve(result)
|
|
734
|
+
// }
|
|
735
|
+
// }
|
|
736
|
+
//
|
|
737
|
+
// @PluginMethod
|
|
738
|
+
// fun retakeImage(call: PluginCall) {
|
|
739
|
+
// try {
|
|
740
|
+
// val temporarySessionId = call.getString("temporarySessionId") ?: ""
|
|
741
|
+
// val imageURI = call.getString("imageURI") ?: ""
|
|
742
|
+
////
|
|
743
|
+
//// // Validate required parameters
|
|
744
|
+
//// if (temporarySessionId.isNullOrEmpty() || imageURI.isNullOrEmpty()) {
|
|
745
|
+
//// val missingFields = listOf(
|
|
746
|
+
//// if (temporarySessionId.isNullOrEmpty()) "temporarySessionId" else null,
|
|
747
|
+
//// if (imageURI.isNullOrEmpty()) "imageURI" else null
|
|
748
|
+
//// ).filterNotNull()
|
|
749
|
+
//// call.resolve(ResponseUtils.createValidationErrorResponse("${PluginConstants.MESSAGE_MISSING_PARAMS} for retakeImage", missingFields))
|
|
750
|
+
//// return
|
|
751
|
+
//// }
|
|
752
|
+
//
|
|
753
|
+
// // Get context safely
|
|
754
|
+
// val context = this.context
|
|
755
|
+
// if (context == null) {
|
|
756
|
+
// call.resolve(ResponseUtils.createContextErrorResponse())
|
|
757
|
+
// return
|
|
758
|
+
// }
|
|
759
|
+
//
|
|
760
|
+
// // Verify App instance is available
|
|
761
|
+
// if (!isAppInitialized()) {
|
|
762
|
+
// call.resolve(ResponseUtils.createAppNotInitializedErrorResponse())
|
|
763
|
+
// return
|
|
764
|
+
// }
|
|
765
|
+
//
|
|
766
|
+
// // Check if SDK is initialized
|
|
767
|
+
// val authKey = try {
|
|
768
|
+
// infilect.infiviz.infilect_client.SecuredSharedPref.SecuredInfilectSDKPreferences.getAuthKey(context.applicationContext)
|
|
769
|
+
// } catch (e: Exception) {
|
|
770
|
+
// null
|
|
771
|
+
// }
|
|
772
|
+
//
|
|
773
|
+
// if (authKey.isNullOrEmpty()) {
|
|
774
|
+
// call.resolve(ResponseUtils.createSDKNotInitializedErrorResponse())
|
|
775
|
+
// return
|
|
776
|
+
// }
|
|
777
|
+
//
|
|
778
|
+
// InfiVizShotsSDK.retakeImage(
|
|
779
|
+
// getActivity(),
|
|
780
|
+
// temporarySessionId,
|
|
781
|
+
// imageURI,
|
|
782
|
+
// object : SDKCallback<String?> {
|
|
783
|
+
// override fun onSuccess(response: String?) {
|
|
784
|
+
// val data = JSObject()
|
|
785
|
+
// data.put("response", response)
|
|
786
|
+
// call.resolve(data)
|
|
787
|
+
// }
|
|
788
|
+
//
|
|
789
|
+
// override fun onError(exception: SDKExceptions) {
|
|
790
|
+
// val err = JSObject()
|
|
791
|
+
// err.put("message", exception.message)
|
|
792
|
+
// err.put("status", exception.getStatus()?.toString())
|
|
793
|
+
// err.put("sessionId", exception.getSessionId())
|
|
794
|
+
// call.resolve(err)
|
|
795
|
+
// }
|
|
796
|
+
// },
|
|
797
|
+
// PluginConstants.CAMERA_REQUEST_CODE
|
|
798
|
+
// )
|
|
799
|
+
//
|
|
800
|
+
// } catch (e: Exception) {
|
|
801
|
+
// val result = ResponseUtils.createErrorResponse(PluginConstants.ERROR_EXCEPTION, "Retake image failed: ${e.message}")
|
|
802
|
+
// result.put("errorType", e.javaClass.simpleName)
|
|
803
|
+
// call.resolve(result)
|
|
804
|
+
// }
|
|
805
|
+
// }
|
|
806
|
+
//
|
|
807
|
+
// @PluginMethod
|
|
808
|
+
// fun getIrResult(call: PluginCall) {
|
|
809
|
+
// try {
|
|
810
|
+
// val sessionId = call.getString("sessionId") ?: ""
|
|
811
|
+
//
|
|
812
|
+
//// // Validate required parameters
|
|
813
|
+
//// if (sessionId.isNullOrEmpty()) {
|
|
814
|
+
//// call.resolve(ResponseUtils.createValidationErrorResponse("sessionId is required for getIrResult"))
|
|
815
|
+
//// return
|
|
816
|
+
//// }
|
|
817
|
+
////
|
|
818
|
+
// // Get context safely
|
|
819
|
+
// val context = this.context
|
|
820
|
+
// if (context == null) {
|
|
821
|
+
// call.resolve(ResponseUtils.createContextErrorResponse())
|
|
822
|
+
// return
|
|
823
|
+
// }
|
|
824
|
+
//
|
|
825
|
+
// // Verify App instance is available
|
|
826
|
+
// if (!isAppInitialized()) {
|
|
827
|
+
// call.resolve(ResponseUtils.createAppNotInitializedErrorResponse())
|
|
828
|
+
// return
|
|
829
|
+
// }
|
|
830
|
+
//
|
|
831
|
+
// // Check if SDK is initialized
|
|
832
|
+
// val authKey = try {
|
|
833
|
+
// infilect.infiviz.infilect_client.SecuredSharedPref.SecuredInfilectSDKPreferences.getAuthKey(context.applicationContext)
|
|
834
|
+
// } catch (e: Exception) {
|
|
835
|
+
// null
|
|
836
|
+
// }
|
|
837
|
+
//
|
|
838
|
+
// if (authKey.isNullOrEmpty()) {
|
|
839
|
+
// call.resolve(ResponseUtils.createSDKNotInitializedErrorResponse())
|
|
840
|
+
// return
|
|
841
|
+
// }
|
|
842
|
+
//
|
|
843
|
+
// InfiVizShotsSDK.getIRResult(getContext(), sessionId, object : SDKCallback<String?> {
|
|
844
|
+
// override fun onSuccess(result: String?) {
|
|
845
|
+
// val data = JSObject()
|
|
846
|
+
// data.put("result", result)
|
|
847
|
+
// call.resolve(data)
|
|
848
|
+
// }
|
|
849
|
+
//
|
|
850
|
+
// override fun onError(exception: SDKExceptions) {
|
|
851
|
+
// val err = JSObject()
|
|
852
|
+
// err.put("message", exception.message)
|
|
853
|
+
// err.put("status", exception.getStatus()?.toString())
|
|
854
|
+
// err.put("sessionId", exception.getSessionId())
|
|
855
|
+
// call.resolve(err)
|
|
856
|
+
// }
|
|
857
|
+
// })
|
|
858
|
+
//
|
|
859
|
+
// } catch (e: Exception) {
|
|
860
|
+
// val result = ResponseUtils.createErrorResponse(PluginConstants.ERROR_EXCEPTION, "Get IR result failed: ${e.message}")
|
|
861
|
+
// result.put("errorType", e.javaClass.simpleName)
|
|
862
|
+
// call.resolve(result)
|
|
863
|
+
// }
|
|
864
|
+
// }
|
|
865
|
+
//
|
|
866
|
+
// @PluginMethod
|
|
867
|
+
// fun getActionsResult(call: PluginCall) {
|
|
868
|
+
// try {
|
|
869
|
+
// val sessionId = call.getString("sessionId") ?: ""
|
|
870
|
+
//
|
|
871
|
+
//// // Validate required parameters
|
|
872
|
+
//// if (sessionId.isNullOrEmpty()) {
|
|
873
|
+
//// call.resolve(ResponseUtils.createValidationErrorResponse("sessionId is required for getActionsResult"))
|
|
874
|
+
//// return
|
|
875
|
+
//// }
|
|
876
|
+
////
|
|
877
|
+
// // Get context safely
|
|
878
|
+
// val context = this.context
|
|
879
|
+
// if (context == null) {
|
|
880
|
+
// call.resolve(ResponseUtils.createContextErrorResponse())
|
|
881
|
+
// return
|
|
882
|
+
// }
|
|
883
|
+
//
|
|
884
|
+
// // Verify App instance is available
|
|
885
|
+
// if (!isAppInitialized()) {
|
|
886
|
+
// call.resolve(ResponseUtils.createAppNotInitializedErrorResponse())
|
|
887
|
+
// return
|
|
888
|
+
// }
|
|
889
|
+
//
|
|
890
|
+
// // Check if SDK is initialized
|
|
891
|
+
// val authKey = try {
|
|
892
|
+
// infilect.infiviz.infilect_client.SecuredSharedPref.SecuredInfilectSDKPreferences.getAuthKey(context.applicationContext)
|
|
893
|
+
// } catch (e: Exception) {
|
|
894
|
+
// null
|
|
895
|
+
// }
|
|
896
|
+
//
|
|
897
|
+
// if (authKey.isNullOrEmpty()) {
|
|
898
|
+
// call.resolve(ResponseUtils.createSDKNotInitializedErrorResponse())
|
|
899
|
+
// return
|
|
900
|
+
// }
|
|
901
|
+
//
|
|
902
|
+
// InfiVizShotsSDK.getActionsResult(getContext(), sessionId, object : SDKCallback<String?> {
|
|
903
|
+
// override fun onSuccess(result: String?) {
|
|
904
|
+
// val data = JSObject()
|
|
905
|
+
// data.put("result", result)
|
|
906
|
+
// call.resolve(data)
|
|
907
|
+
// }
|
|
908
|
+
//
|
|
909
|
+
// override fun onError(exception: SDKExceptions) {
|
|
910
|
+
// val err = JSObject()
|
|
911
|
+
// err.put("message", exception.message)
|
|
912
|
+
// err.put("status", exception.getStatus()?.toString())
|
|
913
|
+
// err.put("sessionId", exception.getSessionId())
|
|
914
|
+
// call.resolve(err)
|
|
915
|
+
// }
|
|
916
|
+
// })
|
|
917
|
+
//
|
|
918
|
+
// } catch (e: Exception) {
|
|
919
|
+
// val result = ResponseUtils.createErrorResponse(PluginConstants.ERROR_EXCEPTION, "Get actions result failed: ${e.message}")
|
|
920
|
+
// result.put("errorType", e.javaClass.simpleName)
|
|
921
|
+
// call.resolve(result)
|
|
922
|
+
// }
|
|
923
|
+
// }
|
|
924
|
+
//
|
|
925
|
+
//
|
|
926
|
+
// @PluginMethod
|
|
927
|
+
// fun fetchUniversalSessionId(call: PluginCall) {
|
|
928
|
+
// try {
|
|
929
|
+
// val tempID = call.getString("tempID") ?: ""
|
|
930
|
+
// Log.i("SamplePlugin", "fetchUniversalSessionId called with tempID: '$tempID'")
|
|
931
|
+
//
|
|
932
|
+
// val context = this.context
|
|
933
|
+
// if (context == null) {
|
|
934
|
+
// Log.e("SamplePlugin", "fetchUniversalSessionId: Context is null")
|
|
935
|
+
// call.resolve(ResponseUtils.createContextErrorResponse())
|
|
936
|
+
// return
|
|
937
|
+
// }
|
|
938
|
+
//
|
|
939
|
+
// if (!isAppInitialized()) {
|
|
940
|
+
// call.resolve(ResponseUtils.createAppNotInitializedErrorResponse())
|
|
941
|
+
// return
|
|
942
|
+
// }
|
|
943
|
+
//
|
|
944
|
+
// val authKey = try {
|
|
945
|
+
// infilect.infiviz.infilect_client.SecuredSharedPref.SecuredInfilectSDKPreferences.getAuthKey(context.applicationContext)
|
|
946
|
+
// } catch (e: Exception) {
|
|
947
|
+
// null
|
|
948
|
+
// }
|
|
949
|
+
//
|
|
950
|
+
// if (authKey.isNullOrEmpty()) {
|
|
951
|
+
// call.resolve(ResponseUtils.createSDKNotInitializedErrorResponse())
|
|
952
|
+
// return
|
|
953
|
+
// }
|
|
954
|
+
//
|
|
955
|
+
// InfiVizShotsSDK.fetchUniversalSessionId(
|
|
956
|
+
// getActivity(),
|
|
957
|
+
// tempID,
|
|
958
|
+
// object : SDKCallback<String?> {
|
|
959
|
+
// override fun onSuccess(response: String?) {
|
|
960
|
+
// try {
|
|
961
|
+
// val jsonResponse = org.json.JSONObject(response ?: "{}")
|
|
962
|
+
//
|
|
963
|
+
// val dataObject = jsonResponse.optJSONObject("data")
|
|
964
|
+
//
|
|
965
|
+
// val sessionIdFromData = dataObject?.optString("sessionId")
|
|
966
|
+
//
|
|
967
|
+
// val out = JSObject().apply {
|
|
968
|
+
// put("data", dataObject?.toString())
|
|
969
|
+
// put("status", jsonResponse.optString("status"))
|
|
970
|
+
// put("message", jsonResponse.optString("message"))
|
|
971
|
+
// }
|
|
972
|
+
//
|
|
973
|
+
// call.resolve(out)
|
|
974
|
+
// } catch (e: Exception) {
|
|
975
|
+
// e.printStackTrace()
|
|
976
|
+
// val err = JSObject()
|
|
977
|
+
// err.put("message", e.message)
|
|
978
|
+
// call.resolve(err)
|
|
979
|
+
// }
|
|
980
|
+
// }
|
|
981
|
+
//
|
|
982
|
+
// override fun onError(exception: SDKExceptions) {
|
|
983
|
+
// val err = JSObject()
|
|
984
|
+
// err.put("message", exception.message)
|
|
985
|
+
// err.put("status", exception.getStatus()?.toString())
|
|
986
|
+
// err.put("sessionId", exception.getSessionId())
|
|
987
|
+
// call.resolve(err)
|
|
988
|
+
// }
|
|
989
|
+
// })
|
|
990
|
+
//
|
|
991
|
+
// } catch (e: Exception) {
|
|
992
|
+
// e.printStackTrace()
|
|
993
|
+
// val result = ResponseUtils.createErrorResponse(PluginConstants.ERROR_EXCEPTION, "Fetch universal session ID failed: ${e.message}")
|
|
994
|
+
// result.put("errorType", e.javaClass.simpleName)
|
|
995
|
+
// call.resolve(result)
|
|
996
|
+
// }
|
|
997
|
+
// }
|
|
998
|
+
//
|
|
999
|
+
// @PluginMethod
|
|
1000
|
+
// fun fetchSessionID(call: PluginCall) {
|
|
1001
|
+
// try {
|
|
1002
|
+
// val taskCategory = call.getString("taskCategory")
|
|
1003
|
+
// val storeID = call.getString("storeID")
|
|
1004
|
+
// val taskPhotoType = call.getString("taskPhotoType")
|
|
1005
|
+
//
|
|
1006
|
+
// // Validate required parameters
|
|
1007
|
+
// if (taskCategory.isNullOrEmpty() || storeID.isNullOrEmpty() || taskPhotoType.isNullOrEmpty()) {
|
|
1008
|
+
// val missingFields = listOf(
|
|
1009
|
+
// if (taskCategory.isNullOrEmpty()) "taskCategory" else null,
|
|
1010
|
+
// if (storeID.isNullOrEmpty()) "storeID" else null,
|
|
1011
|
+
// if (taskPhotoType.isNullOrEmpty()) "taskPhotoType" else null
|
|
1012
|
+
// ).filterNotNull()
|
|
1013
|
+
// call.resolve(ResponseUtils.createValidationErrorResponse("${PluginConstants.MESSAGE_MISSING_PARAMS} for fetchSessionID", missingFields))
|
|
1014
|
+
// return
|
|
1015
|
+
// }
|
|
1016
|
+
//
|
|
1017
|
+
// // Get context safely
|
|
1018
|
+
// val context = this.context
|
|
1019
|
+
// if (context == null) {
|
|
1020
|
+
// call.resolve(ResponseUtils.createContextErrorResponse())
|
|
1021
|
+
// return
|
|
1022
|
+
// }
|
|
1023
|
+
//
|
|
1024
|
+
// // Verify App instance is available
|
|
1025
|
+
// if (!isAppInitialized()) {
|
|
1026
|
+
// call.resolve(ResponseUtils.createAppNotInitializedErrorResponse())
|
|
1027
|
+
// return
|
|
1028
|
+
// }
|
|
1029
|
+
//
|
|
1030
|
+
// // Check if SDK is initialized
|
|
1031
|
+
// val authKey = try {
|
|
1032
|
+
// infilect.infiviz.infilect_client.SecuredSharedPref.SecuredInfilectSDKPreferences.getAuthKey(context.applicationContext)
|
|
1033
|
+
// } catch (e: Exception) {
|
|
1034
|
+
// null
|
|
1035
|
+
// }
|
|
1036
|
+
//
|
|
1037
|
+
// if (authKey.isNullOrEmpty()) {
|
|
1038
|
+
// call.resolve(ResponseUtils.createSDKNotInitializedErrorResponse())
|
|
1039
|
+
// return
|
|
1040
|
+
// }
|
|
1041
|
+
//
|
|
1042
|
+
// // Generate a temporary session ID
|
|
1043
|
+
// // Note: This appears to be a placeholder implementation
|
|
1044
|
+
// // In a real implementation, this should call the SDK to generate a proper session ID
|
|
1045
|
+
// val tempSessionID = "session_" + System.currentTimeMillis()
|
|
1046
|
+
//
|
|
1047
|
+
// val data = JSObject()
|
|
1048
|
+
// data.put("tempSessionID", tempSessionID)
|
|
1049
|
+
// call.resolve(ResponseUtils.createSuccessResponse("Temporary session ID generated successfully", data))
|
|
1050
|
+
//
|
|
1051
|
+
// } catch (e: Exception) {
|
|
1052
|
+
// val result = ResponseUtils.createErrorResponse(PluginConstants.ERROR_EXCEPTION, "Fetch session ID failed: ${e.message}")
|
|
1053
|
+
// result.put("errorType", e.javaClass.simpleName)
|
|
1054
|
+
// call.resolve(result)
|
|
1055
|
+
// }
|
|
1056
|
+
// }
|
|
1057
|
+
//
|
|
1058
|
+
// @PluginMethod
|
|
1059
|
+
// fun resumeCamera(call: PluginCall) {
|
|
1060
|
+
// try {
|
|
1061
|
+
// val tempSessionId = call.getString("temporarySessionID") ?: ""
|
|
1062
|
+
// val requestCodeInt: Int = call.getInt("requestCode") ?: PluginConstants.CAMERA_REQUEST_CODE
|
|
1063
|
+
//
|
|
1064
|
+
// val context = this.context
|
|
1065
|
+
// if (context == null) {
|
|
1066
|
+
// call.resolve(ResponseUtils.createContextErrorResponse())
|
|
1067
|
+
// return
|
|
1068
|
+
// }
|
|
1069
|
+
//
|
|
1070
|
+
// if (!isAppInitialized()) {
|
|
1071
|
+
// call.resolve(ResponseUtils.createAppNotInitializedErrorResponse())
|
|
1072
|
+
// return
|
|
1073
|
+
// }
|
|
1074
|
+
//
|
|
1075
|
+
// val authKey = try {
|
|
1076
|
+
// infilect.infiviz.infilect_client.SecuredSharedPref.SecuredInfilectSDKPreferences.getAuthKey(context.applicationContext)
|
|
1077
|
+
// } catch (e: Exception) {
|
|
1078
|
+
// null
|
|
1079
|
+
// }
|
|
1080
|
+
//
|
|
1081
|
+
// if (authKey.isNullOrEmpty()) {
|
|
1082
|
+
// call.resolve(ResponseUtils.createSDKNotInitializedErrorResponse())
|
|
1083
|
+
// return
|
|
1084
|
+
// }
|
|
1085
|
+
//
|
|
1086
|
+
// startCameraCallbackSessionId = { sessionId ->
|
|
1087
|
+
// val result = JSObject()
|
|
1088
|
+
// result.put("sessionId", sessionId)
|
|
1089
|
+
// call.resolve(result)
|
|
1090
|
+
// }
|
|
1091
|
+
//
|
|
1092
|
+
// InfiVizShotsSDK.resumeCamera(
|
|
1093
|
+
// getActivity(),
|
|
1094
|
+
// tempSessionId,
|
|
1095
|
+
// requestCodeInt,
|
|
1096
|
+
// object : SDKCallback<String?> {
|
|
1097
|
+
// override fun onSuccess(response: String?) {
|
|
1098
|
+
// }
|
|
1099
|
+
//
|
|
1100
|
+
// override fun onError(exception: SDKExceptions) {
|
|
1101
|
+
// val err = JSObject()
|
|
1102
|
+
// err.put("message", exception.message)
|
|
1103
|
+
// err.put("status", exception.getStatus()?.toString())
|
|
1104
|
+
// err.put("sessionId", exception.getSessionId())
|
|
1105
|
+
// call.resolve(err)
|
|
1106
|
+
// }
|
|
1107
|
+
// })
|
|
1108
|
+
//
|
|
1109
|
+
// } catch (e: Exception) {
|
|
1110
|
+
// val err = JSObject()
|
|
1111
|
+
// err.put("message", e.message)
|
|
1112
|
+
// err.put("errorType", e.javaClass.simpleName)
|
|
1113
|
+
// call.resolve(err)
|
|
1114
|
+
// }
|
|
1115
|
+
// }
|
|
1116
|
+
//
|
|
1117
|
+
//
|
|
1118
|
+
//}
|