shakebug-react-native 1.0.14
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/DeviceInfo/index.js.flow +177 -0
- package/DeviceInfo/index.ts +1034 -0
- package/DeviceInfo/internal/asyncHookWrappers.ts +59 -0
- package/DeviceInfo/internal/devicesWithDynamicIsland.ts +30 -0
- package/DeviceInfo/internal/devicesWithNotch.ts +374 -0
- package/DeviceInfo/internal/nativeInterface.ts +28 -0
- package/DeviceInfo/internal/privateTypes.ts +231 -0
- package/DeviceInfo/internal/supported-platform-info.ts +97 -0
- package/DeviceInfo/internal/types.ts +19 -0
- package/DeviceInfo/web/index.js +223 -0
- package/GetLocals/src/NativeRNLocalize.ts +18 -0
- package/GetLocals/src/constants.ts +269 -0
- package/GetLocals/src/index.ts +56 -0
- package/GetLocals/src/module.ts +51 -0
- package/GetLocals/src/module.web.ts +148 -0
- package/GetLocals/src/types.ts +31 -0
- package/GetLocation/LocationError.ts +20 -0
- package/GetLocation/index.ts +46 -0
- package/GetLocation/utils.ts +89 -0
- package/ImageOrVedioPicker/src/index.ts +28 -0
- package/ImageOrVedioPicker/src/platforms/NativeImagePicker.ts +10 -0
- package/ImageOrVedioPicker/src/platforms/native.ts +61 -0
- package/ImageOrVedioPicker/src/platforms/web.ts +159 -0
- package/ImageOrVedioPicker/src/types.ts +74 -0
- package/NetInfo/src/__tests__/eventListenerCallbacks.spec.ts +332 -0
- package/NetInfo/src/__tests__/fetch.spec.ts +479 -0
- package/NetInfo/src/index.ts +186 -0
- package/NetInfo/src/internal/__mocks__/nativeModule.ts +13 -0
- package/NetInfo/src/internal/defaultConfiguration.ts +17 -0
- package/NetInfo/src/internal/defaultConfiguration.web.ts +17 -0
- package/NetInfo/src/internal/internetReachability.ts +180 -0
- package/NetInfo/src/internal/nativeInterface.ts +43 -0
- package/NetInfo/src/internal/nativeInterface.web.ts +27 -0
- package/NetInfo/src/internal/nativeModule.ts +15 -0
- package/NetInfo/src/internal/nativeModule.web.ts +306 -0
- package/NetInfo/src/internal/privateTypes.ts +41 -0
- package/NetInfo/src/internal/state.ts +137 -0
- package/NetInfo/src/internal/types.ts +128 -0
- package/README.md +246 -0
- package/RecordScreen/src/index.tsx +75 -0
- package/ScreenShot/src/RNViewShot.js +3 -0
- package/ScreenShot/src/RNViewShot.web.js +42 -0
- package/ScreenShot/src/index.js +308 -0
- package/Sensor/src/index.js +14 -0
- package/Sensor/src/rnsensors.js +57 -0
- package/Sensor/src/sensors.js +97 -0
- package/VideoPlayer/PlayVideo.tsx +51 -0
- package/VideoPlayer/index.js +69 -0
- package/android/README.md +14 -0
- package/android/build/generated/source/buildConfig/debug/com/shakebug/BuildConfig.java +10 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +42 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +18 -0
- package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +6 -0
- package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +1 -0
- package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/R.txt +47 -0
- package/android/build/intermediates/compiled_local_resources/debug/out/xml_imagepicker_provider_paths.xml.flat +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +12 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +2 -0
- package/android/build/intermediates/javac/debug/classes/com/shakebug/BuildConfig.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/shakebug/CustomMediaMetadataRetriever.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/shakebug/ImageMetadata.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/shakebug/ImagePickerProvider.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/shakebug/Metadata.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/shakebug/Options.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/shakebug/RecordScreenModule$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/shakebug/RecordScreenModule.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/shakebug/Shakebug.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/shakebug/ShakebugPackage.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/shakebug/Utility.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/shakebug/Utils.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/shakebug/VideoMetadata.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/shakebug/ViewShot$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/shakebug/ViewShot$2.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/shakebug/ViewShot$Formats.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/shakebug/ViewShot$Results.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/shakebug/ViewShot$ReusableByteArrayOutputStream.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/shakebug/ViewShot.class +0 -0
- package/android/build/intermediates/local_only_symbol_list/debug/R-def.txt +49 -0
- package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +82 -0
- package/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml +42 -0
- package/android/build/intermediates/navigation_json/debug/navigation.json +1 -0
- package/android/build/intermediates/packaged_res/debug/values/values.xml +25 -0
- package/android/build/intermediates/packaged_res/debug/xml/imagepicker_provider_paths.xml +4 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/BuildConfig.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/CustomMediaMetadataRetriever.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/ImageMetadata.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/ImagePickerProvider.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/Metadata.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/Options.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/RecordScreenModule$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/RecordScreenModule.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/Shakebug.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/ShakebugPackage.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/Utility.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/Utils.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/VideoMetadata.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/ViewShot$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/ViewShot$2.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/ViewShot$Formats.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/ViewShot$Results.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/ViewShot$ReusableByteArrayOutputStream.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/ViewShot.class +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +48 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +97 -0
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build.gradle +235 -0
- package/android/src/main/AndroidManifest.xml +40 -0
- package/android/src/main/java/com/shakebug/AmazonFireDeviceConnectivityPoller.java +170 -0
- package/android/src/main/java/com/shakebug/BaseUtils.java +33 -0
- package/android/src/main/java/com/shakebug/BroadcastReceiverConnectivityReceiver.java +131 -0
- package/android/src/main/java/com/shakebug/ConnectivityReceiver.java +318 -0
- package/android/src/main/java/com/shakebug/CrashLoggerModule.java +48 -0
- package/android/src/main/java/com/shakebug/DateUtil.java +64 -0
- package/android/src/main/java/com/shakebug/DeviceType.java +18 -0
- package/android/src/main/java/com/shakebug/DeviceUtil.java +46 -0
- package/android/src/main/java/com/shakebug/DrawingView.java +90 -0
- package/android/src/main/java/com/shakebug/DrawingViewManager.java +38 -0
- package/android/src/main/java/com/shakebug/GetLocation.java +147 -0
- package/android/src/main/java/com/shakebug/ImageMetadata.java +42 -0
- package/android/src/main/java/com/shakebug/ImagePickerProvider.java +8 -0
- package/android/src/main/java/com/shakebug/Metadata.java +46 -0
- package/android/src/main/java/com/shakebug/NetInfoModule.java +79 -0
- package/android/src/main/java/com/shakebug/NetInfoUtils.java +50 -0
- package/android/src/main/java/com/shakebug/NetworkCallbackConnectivityReceiver.java +209 -0
- package/android/src/main/java/com/shakebug/Options.java +42 -0
- package/android/src/main/java/com/shakebug/RNDeviceModule.java +1036 -0
- package/android/src/main/java/com/shakebug/RNInstallReferrerClient.java +124 -0
- package/android/src/main/java/com/shakebug/RNLocalizeModule.java +79 -0
- package/android/src/main/java/com/shakebug/RNLocalizeModuleImpl.java +258 -0
- package/android/src/main/java/com/shakebug/ReactNativeGetLocationModule.java +95 -0
- package/android/src/main/java/com/shakebug/RecordScreenModule.java +202 -0
- package/android/src/main/java/com/shakebug/ScreenshotDetectorModule.java +63 -0
- package/android/src/main/java/com/shakebug/SettingsUtil.java +44 -0
- package/android/src/main/java/com/shakebug/Shakebug.java +181 -0
- package/android/src/main/java/com/shakebug/ShakebugPackage.java +75 -0
- package/android/src/main/java/com/shakebug/ShakebugSDKImagePickerModule.java +56 -0
- package/android/src/main/java/com/shakebug/ShakebugSDKImagePickerModuleImpl.java +230 -0
- package/android/src/main/java/com/shakebug/ShakebugSDKScreenShotModule.java +196 -0
- package/android/src/main/java/com/shakebug/SharedPreferencesModule.java +39 -0
- package/android/src/main/java/com/shakebug/UnitConverter.java +48 -0
- package/android/src/main/java/com/shakebug/Utility.java +29 -0
- package/android/src/main/java/com/shakebug/Utils.java +593 -0
- package/android/src/main/java/com/shakebug/VideoMetadata.java +91 -0
- package/android/src/main/java/com/shakebug/VideoPlayerModule.java +199 -0
- package/android/src/main/java/com/shakebug/VideoThumbnailModule.java +215 -0
- package/android/src/main/java/com/shakebug/VideoTrimModule.java +372 -0
- package/android/src/main/java/com/shakebug/ViewShot.java +627 -0
- package/android/src/main/java/com/shakebug/adapters/VideoTrimmerAdapter.java +54 -0
- package/android/src/main/java/com/shakebug/callback/SingleCallback.java +11 -0
- package/android/src/main/java/com/shakebug/interfaces/IVideoTrimmerView.java +5 -0
- package/android/src/main/java/com/shakebug/interfaces/VideoPlayerListner.java +5 -0
- package/android/src/main/java/com/shakebug/interfaces/VideoTrimListener.java +10 -0
- package/android/src/main/java/com/shakebug/resolver/DeviceIdResolver.java +87 -0
- package/android/src/main/java/com/shakebug/resolver/DeviceTypeResolver.java +94 -0
- package/android/src/main/java/com/shakebug/thread/BackgroundExecutor.java +246 -0
- package/android/src/main/java/com/shakebug/thread/UiThreadExecutor.java +120 -0
- package/android/src/main/java/com/shakebug/types/CellularGeneration.java +60 -0
- package/android/src/main/java/com/shakebug/types/ConnectionType.java +26 -0
- package/android/src/main/java/com/shakebug/utils/StorageUtil.java +139 -0
- package/android/src/main/java/com/shakebug/utils/VideoTrimmerUtil.java +89 -0
- package/android/src/main/java/com/shakebug/widgets/RangeSeekBarView.java +534 -0
- package/android/src/main/java/com/shakebug/widgets/SpacesItemDecoration2.java +32 -0
- package/android/src/main/java/com/shakebug/widgets/VideoPlayerView.java +429 -0
- package/android/src/main/java/com/shakebug/widgets/VideoTrimmerView.java +477 -0
- package/android/src/main/java/com/shakebug/widgets/ZVideoView.java +48 -0
- package/android/src/main/res/drawable/custom_progress.xml +16 -0
- package/android/src/main/res/drawable/custom_thumb.xml +4 -0
- package/android/src/main/res/drawable/ic_close_button.xml +10 -0
- package/android/src/main/res/drawable/ic_video_pause_black.png +0 -0
- package/android/src/main/res/drawable/ic_video_play_black.png +0 -0
- package/android/src/main/res/drawable/ic_video_thumb_handle.png +0 -0
- package/android/src/main/res/drawable/icon_seek_bar.png +0 -0
- package/android/src/main/res/layout/video_player_view.xml +121 -0
- package/android/src/main/res/layout/video_thumb_item_layout.xml +16 -0
- package/android/src/main/res/layout/video_trimmer_view.xml +148 -0
- package/android/src/main/res/values/colors.xml +17 -0
- package/android/src/main/res/values/strings.xml +14 -0
- package/android/src/main/res/xml/imagepicker_provider_paths.xml +4 -0
- package/ios/CammeraPermission/RNCameraPermission.h +16 -0
- package/ios/CammeraPermission/RNCameraPermission.m +46 -0
- package/ios/DeviceInfo/DeviceUID.h +14 -0
- package/ios/DeviceInfo/DeviceUID.m +202 -0
- package/ios/DeviceInfo/EnvironmentUtil.h +41 -0
- package/ios/DeviceInfo/EnvironmentUtil.m +56 -0
- package/ios/DeviceInfo/RNDeviceInfo.h +22 -0
- package/ios/DeviceInfo/RNDeviceInfo.m +918 -0
- package/ios/GetLocals/ShakebugSDKRNLocalize.h +21 -0
- package/ios/GetLocals/ShakebugSDKRNLocalize.m +296 -0
- package/ios/GetLocation/SettingsUtil.h +16 -0
- package/ios/GetLocation/SettingsUtil.m +21 -0
- package/ios/GetLocation/ShakebugSDKLocationModule.h +17 -0
- package/ios/GetLocation/ShakebugSDKLocationModule.m +218 -0
- package/ios/ImageOrVideoPicker/ShakebugSDKImagePickerManager.h +40 -0
- package/ios/ImageOrVideoPicker/ShakebugSDKImagePickerManager.m +588 -0
- package/ios/ImageOrVideoPicker/ShakebugSDKImagePickerUtils.h +26 -0
- package/ios/ImageOrVideoPicker/ShakebugSDKImagePickerUtils.m +194 -0
- package/ios/MicrophonePermissionManager.h +14 -0
- package/ios/MicrophonePermissionManager.m +35 -0
- package/ios/NetInfo/RNCConnectionState.h +42 -0
- package/ios/NetInfo/RNCConnectionState.m +119 -0
- package/ios/NetInfo/RNCConnectionStateWatcher.h +31 -0
- package/ios/NetInfo/RNCConnectionStateWatcher.m +136 -0
- package/ios/NetInfo/RNCNetInfo.h +13 -0
- package/ios/NetInfo/RNCNetInfo.m +269 -0
- package/ios/RecordScreen/ShakebugSDKRecordScreen.h +31 -0
- package/ios/RecordScreen/ShakebugSDKRecordScreen.m +309 -0
- package/ios/ScreenShot/ShakebugSDKRNViewShot.h +6 -0
- package/ios/ScreenShot/ShakebugSDKRNViewShot.m +186 -0
- package/ios/ScreenshotDetector/ScreenShotDetector.h +12 -0
- package/ios/ScreenshotDetector/ScreenShotDetector.m +37 -0
- package/ios/Senors/RNSensorsAccelerometer.h +22 -0
- package/ios/Senors/RNSensorsAccelerometer.m +162 -0
- package/ios/Senors/RNSensorsBarometer.h +22 -0
- package/ios/Senors/RNSensorsBarometer.m +141 -0
- package/ios/Senors/RNSensorsGravity.h +22 -0
- package/ios/Senors/RNSensorsGravity.m +165 -0
- package/ios/Senors/RNSensorsGyroscope.h +22 -0
- package/ios/Senors/RNSensorsGyroscope.m +160 -0
- package/ios/Senors/RNSensorsMagnetometer.h +22 -0
- package/ios/Senors/RNSensorsMagnetometer.m +163 -0
- package/ios/Senors/RNSensorsOrientation.h +22 -0
- package/ios/Senors/RNSensorsOrientation.m +189 -0
- package/ios/Senors/RNSensorsUtils.h +7 -0
- package/ios/Senors/RNSensorsUtils.m +9 -0
- package/ios/Shakebug.h +7 -0
- package/ios/Shakebug.m +16 -0
- package/ios/Shakebug.xcodeproj/project.pbxproj +872 -0
- package/ios/Shakebug.xcodeproj/xcshareddata/xcschemes/Shakebug.xcscheme +66 -0
- package/ios/Shakebug.xcworkspace/contents.xcworkspacedata +10 -0
- package/ios/Shakebug.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/SketchCanvas/DrawingView.h +18 -0
- package/ios/SketchCanvas/DrawingView.m +96 -0
- package/ios/SketchCanvas/DrawingViewManager.h +12 -0
- package/ios/SketchCanvas/DrawingViewManager.m +35 -0
- package/ios/Storage/SharedPreferencesModule.h +13 -0
- package/ios/Storage/SharedPreferencesModule.m +35 -0
- package/ios/Thumbnaill/VideoThumbnailManager.h +12 -0
- package/ios/Thumbnaill/VideoThumbnailManager.m +73 -0
- package/ios/TrimVideo/ShakebugSDKVideoTrim.swift +372 -0
- package/ios/TrimVideo/VideoTrim-Bridging-Header.h +10 -0
- package/ios/TrimVideo/VideoTrim.m +23 -0
- package/ios/TrimVideo/VideoTrimmer.swift +810 -0
- package/ios/TrimVideo/VideoTrimmerThumb.swift +119 -0
- package/ios/TrimVideo/VideoTrimmerViewController.swift +301 -0
- package/ios/VideoPlayer/VideoPlayerModule.h +14 -0
- package/ios/VideoPlayer/VideoPlayerModule.m +29 -0
- package/ios/VideoPlayer/VideoPlayerViewController.h +18 -0
- package/ios/VideoPlayer/VideoPlayerViewController.m +29 -0
- package/package.json +45 -0
- package/shakebug-react-native.podspec +50 -0
- package/src/APIs/AddIssue.js +70 -0
- package/src/APIs/EndSession.js +32 -0
- package/src/APIs/Event.js +39 -0
- package/src/APIs/MatchKey.js +40 -0
- package/src/APIs/StartSession.js +84 -0
- package/src/Assets/images/OpenSketch.png +0 -0
- package/src/Assets/images/Push.png +0 -0
- package/src/Assets/images/RemoveTextView.png +0 -0
- package/src/Assets/images/black.png +0 -0
- package/src/Assets/images/blue.png +0 -0
- package/src/Assets/images/borderdBlack.png +0 -0
- package/src/Assets/images/borderdBlue.png +0 -0
- package/src/Assets/images/borderdGreen.png +0 -0
- package/src/Assets/images/borderdRed.png +0 -0
- package/src/Assets/images/borderdYellow.png +0 -0
- package/src/Assets/images/clear.png +0 -0
- package/src/Assets/images/close.png +0 -0
- package/src/Assets/images/green.png +0 -0
- package/src/Assets/images/next.png +0 -0
- package/src/Assets/images/play.png +0 -0
- package/src/Assets/images/red.png +0 -0
- package/src/Assets/images/shake.png +0 -0
- package/src/Assets/images/shakebugLogo.png +0 -0
- package/src/Assets/images/stopButton.png +0 -0
- package/src/Assets/images/text_icon.png +0 -0
- package/src/Assets/images/yellow.png +0 -0
- package/src/Componanats/CustomAlert.js +80 -0
- package/src/Componanats/ErrorHandler.js +80 -0
- package/src/Componanats/GlobalStateContext.js +22 -0
- package/src/Componanats/KeyboardAvoidingWrapper.js +43 -0
- package/src/Componanats/NavigationContext.js +42 -0
- package/src/Componanats/ShakeFunction.js +562 -0
- package/src/Componanats/localization.js +482 -0
- package/src/Screens/AddDetailsScreen.js +462 -0
- package/src/Screens/FirstScreen.js +629 -0
- package/src/Screens/Shakebug.js +487 -0
- package/src/Screens/StrockView.js +20 -0
- package/src/Screens/TrimVideoScreen.js +81 -0
- package/src/Screens/TutorialScreen.js +36 -0
- package/src/index.tsx +117 -0
- package/trimVideo/src/index.tsx +141 -0
|
@@ -0,0 +1,487 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Platform, Alert, AppState, NativeModules, View, StyleSheet, Animated, Dimensions, SafeAreaView } from 'react-native';
|
|
3
|
+
import ShakeFunction from '../Componanats/ShakeFunction';
|
|
4
|
+
import FirstScreen from './FirstScreen';
|
|
5
|
+
import AddDetailsScreen from './AddDetailsScreen';
|
|
6
|
+
import TrimVideoScreen from './TrimVideoScreen'
|
|
7
|
+
import DeviceInfo from '../../DeviceInfo';
|
|
8
|
+
import { useEffect, useState } from 'react';
|
|
9
|
+
import GetLocation from '../../GetLocation'
|
|
10
|
+
import NetInfo from '../../NetInfo/src'
|
|
11
|
+
import { SessionStartApi } from '../APIs/StartSession';
|
|
12
|
+
import { MatchKeyApi } from '../APIs/MatchKey';
|
|
13
|
+
import { SessionEndApi } from '../APIs/EndSession';
|
|
14
|
+
import { logger, consoleTransport } from "react-native-logs";
|
|
15
|
+
import { EventApi } from '../APIs/Event';
|
|
16
|
+
import TutorialScreen from './TutorialScreen';
|
|
17
|
+
import { setGlobalErrorHandler } from '../Componanats/ErrorHandler';
|
|
18
|
+
import { NavigationProvider, useNavigation } from '../Componanats/NavigationContext';
|
|
19
|
+
import { Localization } from '../Componanats/localization';
|
|
20
|
+
import { GlobalStateProvider, useGlobalState } from '../Componanats/GlobalStateContext';
|
|
21
|
+
import CustomeAlert from 'shakebug-react-native/src/Componanats/CustomAlert';
|
|
22
|
+
|
|
23
|
+
console.ignoredYellowBox = ["Warning: Each", "Warning: Failed"];
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
global.session_id = "";
|
|
27
|
+
global.application_id = "";
|
|
28
|
+
global.IsBackground = 'true';
|
|
29
|
+
global.isAndroidValid = false;
|
|
30
|
+
global.isIOSValid = false;
|
|
31
|
+
global.isRealDevice = true;
|
|
32
|
+
global.latitude = "";
|
|
33
|
+
global.longitude = "";
|
|
34
|
+
global.isFirstTime = "false";
|
|
35
|
+
global.isRecording = false
|
|
36
|
+
global.isScreenShotDetected = false
|
|
37
|
+
global.ShakebugLanguage = "ENGLISH"
|
|
38
|
+
global.makeLogEnabled = false
|
|
39
|
+
global.ShakebugSDKEndPointURL = "https://www.shakebug.com/api/v1.3/webservice.php/";
|
|
40
|
+
global.ShakebugSDKEndPointURLheaderKey = 'MarchShake2022';
|
|
41
|
+
global.AllowVideo = false;
|
|
42
|
+
global.total_video = 0;
|
|
43
|
+
global.used_video = 0;
|
|
44
|
+
global.videoDuration = 0;
|
|
45
|
+
global.isMic = false;
|
|
46
|
+
global.isRecordingStart = false;
|
|
47
|
+
global.isTrigger = false;
|
|
48
|
+
global.isShakebugOpen = false;
|
|
49
|
+
global.isScreeenShotTaken = false;
|
|
50
|
+
global.restrictedViews = [];
|
|
51
|
+
global.currentScreen = ""
|
|
52
|
+
global.isShakebugSDKOpen = false;
|
|
53
|
+
|
|
54
|
+
function Shakebug({ children, Android_appkey, iOS_appkey, showTutorialScreenFirstTime, ShakebugThemeColor, changeSDKScreenTitle, allowToReportBugByShakingMobile, allowToReportBugByScreenCapture, allowCrashReport, ShakebugLanguage, makeLogEnabled, setShakebugSDKEndPointURL }) {
|
|
55
|
+
|
|
56
|
+
const ThemeColor = ShakebugThemeColor ? ShakebugThemeColor : "#1dd3e3";
|
|
57
|
+
const FirstScreenTitle = changeSDKScreenTitle ? changeSDKScreenTitle[0] != "" ? changeSDKScreenTitle[0] : Localization[ShakebugLanguage].FirstScreenTitle : Localization[ShakebugLanguage].FirstScreenTitle;
|
|
58
|
+
const SecondScreenTitle = changeSDKScreenTitle ? changeSDKScreenTitle[1] != "" ? changeSDKScreenTitle[1] : Localization[ShakebugLanguage].SecondScreenTitle : Localization[ShakebugLanguage].SecondScreenTitle;
|
|
59
|
+
const [isAlert, setIsAlert] = useState(false)
|
|
60
|
+
const [isAlertText, setAlertText] = useState("")
|
|
61
|
+
global.ShakebugLanguage = ShakebugLanguage;
|
|
62
|
+
global.makeLogEnabled = makeLogEnabled;
|
|
63
|
+
global.ShakebugSDKEndPointURL = setShakebugSDKEndPointURL[0].length > 0 ? setShakebugSDKEndPointURL[0] : "https://www.shakebug.com/api/v1.3/webservice.php/";
|
|
64
|
+
global.ShakebugSDKEndPointURLheaderKey = setShakebugSDKEndPointURL[1].length > 0 ? setShakebugSDKEndPointURL[1] : "MarchShake2022";
|
|
65
|
+
|
|
66
|
+
const { ShakebugSDKSharedPreferencesModule } = NativeModules;
|
|
67
|
+
|
|
68
|
+
// DefaulfConfig for log
|
|
69
|
+
const defaultConfig = {
|
|
70
|
+
levels: {
|
|
71
|
+
debug: 0,
|
|
72
|
+
info: 1,
|
|
73
|
+
warn: 2,
|
|
74
|
+
error: 3,
|
|
75
|
+
},
|
|
76
|
+
severity: "debug",
|
|
77
|
+
transport: consoleTransport,
|
|
78
|
+
transportOptions: {
|
|
79
|
+
colors: {
|
|
80
|
+
info: "blueBright",
|
|
81
|
+
warn: "yellowBright",
|
|
82
|
+
error: "redBright",
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
async: true,
|
|
86
|
+
dateFormat: "time",
|
|
87
|
+
printLevel: false,
|
|
88
|
+
printDate: false,
|
|
89
|
+
fixedExtLvlLength: false,
|
|
90
|
+
enabled: makeLogEnabled == true ? true : false,
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
var log = logger.createLogger(defaultConfig);
|
|
94
|
+
|
|
95
|
+
// For get current latitude and longitude
|
|
96
|
+
useEffect(() => {
|
|
97
|
+
async function fetchData() {
|
|
98
|
+
await GetLocation.getCurrentPosition({
|
|
99
|
+
enableHighAccuracy: true,
|
|
100
|
+
timeout: 60000,
|
|
101
|
+
})
|
|
102
|
+
.then(async (location) => {
|
|
103
|
+
global.latitude = location.latitude
|
|
104
|
+
global.longitude = location.longitude
|
|
105
|
+
})
|
|
106
|
+
.catch(error => {
|
|
107
|
+
const { code, message } = error;
|
|
108
|
+
log.error(code, message);
|
|
109
|
+
})
|
|
110
|
+
}
|
|
111
|
+
fetchData();
|
|
112
|
+
}, [Android_appkey, iOS_appkey])
|
|
113
|
+
|
|
114
|
+
// For check mau limit, valid appkey and call MatchKeyFunc
|
|
115
|
+
useEffect(() => {
|
|
116
|
+
async function fetchData() {
|
|
117
|
+
if (Android_appkey != undefined || iOS_appkey != undefined) {
|
|
118
|
+
if (Platform.OS == 'android') {
|
|
119
|
+
if (Android_appkey.trim().length > 0) {
|
|
120
|
+
try {
|
|
121
|
+
const ismauReached = await ShakebugSDKSharedPreferencesModule.getString('mauReachedTime')
|
|
122
|
+
if (ismauReached == undefined || ismauReached == null || ismauReached == "") {
|
|
123
|
+
MatchKeyFunc(Android_appkey)
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
if (parseInt(ismauReached) < new Date().getTime()) {
|
|
127
|
+
MatchKeyFunc(Android_appkey)
|
|
128
|
+
ShakebugSDKSharedPreferencesModule.setString("mauReachedTime", "")
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
log.debug("------------------------------------------------------------------------------------------")
|
|
132
|
+
log.warn('MAU limit is arrived, please try after', new Date(parseInt(ismauReached)).toLocaleString());
|
|
133
|
+
log.debug("------------------------------------------------------------------------------------------")
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
catch (err) {
|
|
138
|
+
log.error("Err here", err)
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
log.warn("Please provide valid android appkey")
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
else if (Platform.OS == 'ios') {
|
|
146
|
+
if (iOS_appkey.trim().length > 0) {
|
|
147
|
+
try {
|
|
148
|
+
const ismauReached = await ShakebugSDKSharedPreferencesModule.getString('mauReachedTime')
|
|
149
|
+
if (ismauReached == undefined || ismauReached == null || ismauReached == "") {
|
|
150
|
+
MatchKeyFunc(iOS_appkey)
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
if (parseInt(ismauReached) < new Date().getTime()) {
|
|
154
|
+
MatchKeyFunc(iOS_appkey)
|
|
155
|
+
ShakebugSDKSharedPreferencesModule.setString("mauReachedTime", "")
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
log.debug("------------------------------------------------------------------------------------------")
|
|
159
|
+
log.warn('MAU limit is arrived, please try after', new Date(parseInt(ismauReached)).toLocaleString());
|
|
160
|
+
log.debug("------------------------------------------------------------------------------------------")
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
catch (err) {
|
|
165
|
+
log.error("Err", err)
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
log.warn("Please provide valid ios appkey")
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
if (Platform.OS == 'android') {
|
|
175
|
+
console.log("Please provide Android_appkey");
|
|
176
|
+
}
|
|
177
|
+
else if (Platform.OS == 'ios') {
|
|
178
|
+
console.log("Please provide iOS_appkey");
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
let i = 0;
|
|
184
|
+
NetInfo.addEventListener(state => {
|
|
185
|
+
if (i == 0) {
|
|
186
|
+
if (state.isConnected == true) {
|
|
187
|
+
fetchData()
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
setAlertText(Localization[global.ShakebugLanguage].InterNetConnetionError)
|
|
191
|
+
setIsAlert(true)
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
i++;
|
|
195
|
+
})
|
|
196
|
+
}, [Android_appkey, iOS_appkey])
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
// For close or start session according app state
|
|
200
|
+
useEffect(() => {
|
|
201
|
+
const handleAppStateChange = (nextAppState) => {
|
|
202
|
+
if (global.IsBackground == 'true') {
|
|
203
|
+
if (nextAppState == 'active' && global.IsBackground == 'true') {
|
|
204
|
+
if (Platform.OS == 'android' && global.isAndroidValid) {
|
|
205
|
+
StartSession()
|
|
206
|
+
}
|
|
207
|
+
else if (Platform.OS == 'ios' && global.isIOSValid)
|
|
208
|
+
StartSession()
|
|
209
|
+
}
|
|
210
|
+
else if (nextAppState == "background" || nextAppState == 'inactive') {
|
|
211
|
+
if (global.session_id != "" && global.IsBackground == 'true') {
|
|
212
|
+
async function FetchEndSessionData() {
|
|
213
|
+
try {
|
|
214
|
+
const { success, message } = await SessionEndApi(global.session_id);
|
|
215
|
+
if (success) {
|
|
216
|
+
log.debug("------------------------------------------------------------------------------------------")
|
|
217
|
+
log.info('API response:', message);
|
|
218
|
+
log.debug("------------------------------------------------------------------------------------------")
|
|
219
|
+
global.session_id = ""
|
|
220
|
+
} else {
|
|
221
|
+
log.debug("------------------------------------------------------------------------------------------")
|
|
222
|
+
log.warn(message);
|
|
223
|
+
log.debug("------------------------------------------------------------------------------------------")
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
catch (err) {
|
|
227
|
+
log.error("err", err)
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
FetchEndSessionData()
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
// Subscribe to app state changes
|
|
237
|
+
const appStateSubscription = AppState.addEventListener('change', handleAppStateChange);
|
|
238
|
+
|
|
239
|
+
// Unsubscribe when component unmounts
|
|
240
|
+
return () => {
|
|
241
|
+
appStateSubscription.remove();
|
|
242
|
+
};
|
|
243
|
+
}, [global.IsBackground]);
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
// For call Match key app and get application id
|
|
247
|
+
const MatchKeyFunc = async (appkey) => {
|
|
248
|
+
try {
|
|
249
|
+
let BundleId = DeviceInfo.getBundleId();
|
|
250
|
+
|
|
251
|
+
const { success, application_id: newApplication_id, message, total_mau, used_mau, total_video, used_video, video_duration } = await MatchKeyApi(appkey, BundleId);
|
|
252
|
+
|
|
253
|
+
global.videoDuration = video_duration;
|
|
254
|
+
|
|
255
|
+
if (success) {
|
|
256
|
+
if (total_video == "Unlimited") {
|
|
257
|
+
global.AllowVideo = true;
|
|
258
|
+
}
|
|
259
|
+
else if (used_video == null) {
|
|
260
|
+
global.AllowVideo = true;
|
|
261
|
+
}
|
|
262
|
+
else if (parseInt(total_video) > parseInt(used_video)) {
|
|
263
|
+
global.AllowVideo = true;
|
|
264
|
+
}
|
|
265
|
+
else {
|
|
266
|
+
global.AllowVideo = false;
|
|
267
|
+
global.total_video = total_video;
|
|
268
|
+
global.used_video - used_video;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
if (total_mau.toString() == used_mau.toString()) {
|
|
272
|
+
let date = new Date().getTime() + 6 * 60 * 60 * 1000
|
|
273
|
+
ShakebugSDKSharedPreferencesModule.setString("mauReachedTime", date.toString())
|
|
274
|
+
}
|
|
275
|
+
if (Platform.OS == "android") {
|
|
276
|
+
global.isAndroidValid = true
|
|
277
|
+
}
|
|
278
|
+
else {
|
|
279
|
+
global.isIOSValid = true
|
|
280
|
+
}
|
|
281
|
+
global.application_id = newApplication_id
|
|
282
|
+
log.debug("------------------------------------------------------------------------------------------")
|
|
283
|
+
log.info('API response:', message);
|
|
284
|
+
log.debug("------------------------------------------------------------------------------------------")
|
|
285
|
+
StartSession()
|
|
286
|
+
} else {
|
|
287
|
+
if (Platform.OS == "android") {
|
|
288
|
+
global.isAndroidValid = false
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
global.isIOSValid = false
|
|
292
|
+
}
|
|
293
|
+
log.debug("------------------------------------------------------------------------------------------")
|
|
294
|
+
log.warn(message);
|
|
295
|
+
log.debug("------------------------------------------------------------------------------------------")
|
|
296
|
+
global.application_id = ""
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
catch (err) {
|
|
300
|
+
log.error("Err", err)
|
|
301
|
+
if (err = "Network request failed") {
|
|
302
|
+
log.warn("Please check your internet connection")
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
// For call Startsesstion and get session id
|
|
308
|
+
const StartSession = async () => {
|
|
309
|
+
if (global.session_id == "") {
|
|
310
|
+
try {
|
|
311
|
+
const { success, session_id: newSessionId, message } = await SessionStartApi(global.latitude, global.longitude, global.application_id);
|
|
312
|
+
if (success) {
|
|
313
|
+
global.session_id = newSessionId
|
|
314
|
+
log.debug("------------------------------------------------------------------------------------------")
|
|
315
|
+
log.info('API response:', message);
|
|
316
|
+
log.debug("------------------------------------------------------------------------------------------")
|
|
317
|
+
} else {
|
|
318
|
+
log.debug("------------------------------------------------------------------------------------------")
|
|
319
|
+
log.warn(message);
|
|
320
|
+
log.debug("------------------------------------------------------------------------------------------")
|
|
321
|
+
global.session_id = ""
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
catch (err) {
|
|
325
|
+
log.error("err", err)
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
DeviceInfo.isEmulator().then(res => {
|
|
330
|
+
if (res === true) {
|
|
331
|
+
log.info("Supports real device only");
|
|
332
|
+
}
|
|
333
|
+
})
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
// For shakeFunctionscreen with childern as props
|
|
337
|
+
const ShakeScreen = () => {
|
|
338
|
+
|
|
339
|
+
DeviceInfo.isEmulator()
|
|
340
|
+
.then(res => {
|
|
341
|
+
global.isRealDevice = !res
|
|
342
|
+
})
|
|
343
|
+
|
|
344
|
+
return (
|
|
345
|
+
<ShakeFunction isRealDevice={global.isRealDevice} themeColor={ThemeColor} showTutorialScreen={showTutorialScreenFirstTime} SDKScreenTitle={[FirstScreenTitle, SecondScreenTitle]} allowToReportBugByShaking={allowToReportBugByShakingMobile} allowToReportBugByScreenCapture={allowToReportBugByScreenCapture} allowCrashReport={allowCrashReport} ShakebugLanguage={ShakebugLanguage}>
|
|
346
|
+
{children}
|
|
347
|
+
</ShakeFunction>
|
|
348
|
+
)
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
// For handel error globaly
|
|
352
|
+
setGlobalErrorHandler()
|
|
353
|
+
|
|
354
|
+
const { width } = Dimensions.get('window');
|
|
355
|
+
|
|
356
|
+
// For register all screen
|
|
357
|
+
const screens = {
|
|
358
|
+
ShakebugHome: ShakeScreen,
|
|
359
|
+
TutorialScreen: TutorialScreen,
|
|
360
|
+
FirstScreen: FirstScreen,
|
|
361
|
+
TrimVideoScreen: TrimVideoScreen,
|
|
362
|
+
AddDetailsScreen: AddDetailsScreen
|
|
363
|
+
};
|
|
364
|
+
|
|
365
|
+
// For navigation in register screen
|
|
366
|
+
const NavigationContainer = () => {
|
|
367
|
+
const { navigationState } = useNavigation();
|
|
368
|
+
const animation = React.useRef(new Animated.Value(0)).current;
|
|
369
|
+
|
|
370
|
+
React.useEffect(() => {
|
|
371
|
+
Animated.timing(animation, {
|
|
372
|
+
toValue: navigationState.length - 1,
|
|
373
|
+
duration: 300,
|
|
374
|
+
useNativeDriver: true,
|
|
375
|
+
}).start();
|
|
376
|
+
}, [navigationState]);
|
|
377
|
+
|
|
378
|
+
return (
|
|
379
|
+
<View style={styles.container}>
|
|
380
|
+
{navigationState.map((screen, index) => {
|
|
381
|
+
const ScreenComponent = screens[screen.name];
|
|
382
|
+
const translateX = animation.interpolate({
|
|
383
|
+
inputRange: [index - 1, index, index + 1],
|
|
384
|
+
outputRange: [width, 0, -width],
|
|
385
|
+
});
|
|
386
|
+
|
|
387
|
+
return (
|
|
388
|
+
<Animated.View key={index} style={[styles.screen, { transform: [{ translateX }] }]}>
|
|
389
|
+
<ScreenComponent {...screen.params} />
|
|
390
|
+
</Animated.View>
|
|
391
|
+
);
|
|
392
|
+
})}
|
|
393
|
+
</View>
|
|
394
|
+
);
|
|
395
|
+
};
|
|
396
|
+
|
|
397
|
+
return (
|
|
398
|
+
<SafeAreaView
|
|
399
|
+
style={{
|
|
400
|
+
width: '100%',
|
|
401
|
+
height: '100%'
|
|
402
|
+
}}
|
|
403
|
+
>
|
|
404
|
+
<GlobalStateProvider>
|
|
405
|
+
<NavigationProvider>
|
|
406
|
+
<NavigationContainer />
|
|
407
|
+
</NavigationProvider>
|
|
408
|
+
</GlobalStateProvider>
|
|
409
|
+
|
|
410
|
+
<CustomeAlert
|
|
411
|
+
isVisible={isAlert}
|
|
412
|
+
text={isAlertText}
|
|
413
|
+
color={ThemeColor}
|
|
414
|
+
OnPrees={() => {
|
|
415
|
+
setAlertText("")
|
|
416
|
+
setIsAlert(false)
|
|
417
|
+
}}
|
|
418
|
+
/>
|
|
419
|
+
</SafeAreaView>
|
|
420
|
+
)
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
export default Shakebug;
|
|
425
|
+
|
|
426
|
+
// For add event api
|
|
427
|
+
export const AddEvent = async (name, value) => {
|
|
428
|
+
|
|
429
|
+
const defaultConfig = {
|
|
430
|
+
levels: {
|
|
431
|
+
debug: 0,
|
|
432
|
+
info: 1,
|
|
433
|
+
warn: 2,
|
|
434
|
+
error: 3,
|
|
435
|
+
},
|
|
436
|
+
severity: "debug",
|
|
437
|
+
transport: consoleTransport,
|
|
438
|
+
transportOptions: {
|
|
439
|
+
colors: {
|
|
440
|
+
info: "blueBright",
|
|
441
|
+
warn: "yellowBright",
|
|
442
|
+
error: "redBright",
|
|
443
|
+
},
|
|
444
|
+
},
|
|
445
|
+
async: true,
|
|
446
|
+
dateFormat: "time",
|
|
447
|
+
printLevel: false,
|
|
448
|
+
printDate: false,
|
|
449
|
+
fixedExtLvlLength: false,
|
|
450
|
+
enabled: global.makeLogEnabled == true ? true : false,
|
|
451
|
+
};
|
|
452
|
+
|
|
453
|
+
var log = logger.createLogger(defaultConfig);
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
if (global.application_id != "") {
|
|
457
|
+
try {
|
|
458
|
+
const { success, message } = await EventApi(global.application_id, name, value);
|
|
459
|
+
if (success) {
|
|
460
|
+
log.debug("------------------------------------------------------------------------------------------")
|
|
461
|
+
log.info('API response:', message);
|
|
462
|
+
log.debug("------------------------------------------------------------------------------------------")
|
|
463
|
+
} else {
|
|
464
|
+
log.debug("------------------------------------------------------------------------------------------")
|
|
465
|
+
log.warn(message);
|
|
466
|
+
log.debug("------------------------------------------------------------------------------------------")
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
catch (err) {
|
|
470
|
+
log.error("err", err)
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
else {
|
|
474
|
+
log.info("application", global.application_id)
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
// Navigation styles
|
|
479
|
+
const styles = StyleSheet.create({
|
|
480
|
+
container: {
|
|
481
|
+
flex: 1,
|
|
482
|
+
position: 'relative',
|
|
483
|
+
},
|
|
484
|
+
screen: {
|
|
485
|
+
...StyleSheet.absoluteFillObject,
|
|
486
|
+
},
|
|
487
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Platform, requireNativeComponent, NativeModules, findNodeHandle} from 'react-native';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export const RNDrawingView = requireNativeComponent('ShakebugSDKDrawingView')
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export const ClearCanvas = (ref) => {
|
|
8
|
+
|
|
9
|
+
const { ShakebugSDKDrawingView } = NativeModules;
|
|
10
|
+
|
|
11
|
+
if (ref.current) {
|
|
12
|
+
if (Platform.OS == "android") {
|
|
13
|
+
ref.current.setNativeProps({ clearCanvas: true });
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
const reactTag = findNodeHandle(ref.current);
|
|
17
|
+
NativeModules.ShakebugSDKDrawingView.clearCanvas(reactTag);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { NativeEventEmitter, NativeModules, SafeAreaView, StatusBar } from 'react-native'
|
|
2
|
+
import React, { useEffect, useState } from 'react'
|
|
3
|
+
import { showEditor } from '../../trimVideo/src/index';
|
|
4
|
+
import { useNavigation } from '../Componanats/NavigationContext';
|
|
5
|
+
import { Localization } from '../Componanats/localization';
|
|
6
|
+
|
|
7
|
+
console.ignoredYellowBox = ["Warning: Each", "Warning: Failed"];
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
const TrimVideoScreen = ({ video, themeColor, SDKScreenTitle, Type, UpdateStatusBar, updateParent }) => {
|
|
12
|
+
|
|
13
|
+
const { goToScreenAtIndex, navigate, goBack } = useNavigation();
|
|
14
|
+
|
|
15
|
+
// For display video trimmer
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
StatusBar.setHidden(true)
|
|
18
|
+
showEditor(video, {
|
|
19
|
+
saveButtonText: Localization[global.ShakebugLanguage].Choose,
|
|
20
|
+
cancelButtonText: Localization[global.ShakebugLanguage].Cancel,
|
|
21
|
+
trimmingText: Localization[global.ShakebugLanguage].TrimmingText,
|
|
22
|
+
enableCancelDialog: true,
|
|
23
|
+
cancelDialogCancelText: Localization[global.ShakebugLanguage].No,
|
|
24
|
+
cancelDialogConfirmText: Localization[global.ShakebugLanguage].Yes,
|
|
25
|
+
cancelDialogTitle: "",
|
|
26
|
+
cancelDialogMessage: Localization[global.ShakebugLanguage].CancelDialog,
|
|
27
|
+
saveToPhoto: false,
|
|
28
|
+
enableSaveDialog: true,
|
|
29
|
+
maxDuration: parseInt(global.videoDuration),
|
|
30
|
+
saveDialogMessage: "",
|
|
31
|
+
saveDialogTitle: Localization[global.ShakebugLanguage].TrimmingDialog,
|
|
32
|
+
saveDialogCancelText: Localization[global.ShakebugLanguage].No,
|
|
33
|
+
saveDialogConfirmText: Localization[global.ShakebugLanguage].Yes
|
|
34
|
+
});
|
|
35
|
+
const eventEmitter = new NativeEventEmitter(NativeModules.ShakebugSDKVideoTrim);
|
|
36
|
+
const subscription = eventEmitter.addListener('ShakebugSDKVideoTrim', (event) => {
|
|
37
|
+
switch (event.name) {
|
|
38
|
+
case 'onShow': {
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
case 'onHide': {
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
case 'onStartTrimming': {
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
case 'onFinishTrimming': {
|
|
48
|
+
global.IsBackground = 'true'
|
|
49
|
+
UpdateStatusBar()
|
|
50
|
+
navigate("AddDetailsScreen", { media: `${event.outputPath}`, mediaType: 'video', themeColor: themeColor, SDKScreenTitle: SDKScreenTitle, updateParent: updateParent });
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
case 'onCancelTrimming': {
|
|
54
|
+
UpdateStatusBar()
|
|
55
|
+
if (Type == "video") {
|
|
56
|
+
goToScreenAtIndex(1)
|
|
57
|
+
}
|
|
58
|
+
else if (Type == "imgReplacedWithVideo") {
|
|
59
|
+
goBack()
|
|
60
|
+
}
|
|
61
|
+
else if (Type == "videoReplacedWithVideo") {
|
|
62
|
+
goToScreenAtIndex(3)
|
|
63
|
+
}
|
|
64
|
+
return;
|
|
65
|
+
// break;
|
|
66
|
+
}
|
|
67
|
+
case 'onError': {
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
return () => {
|
|
74
|
+
subscription.remove();
|
|
75
|
+
};
|
|
76
|
+
}, [])
|
|
77
|
+
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export default TrimVideoScreen;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { View, Text, SafeAreaView, TouchableOpacity, Image, StatusBar} from 'react-native'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import { useNavigation } from '../Componanats/NavigationContext';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
const TutorialScreen = () => {
|
|
7
|
+
|
|
8
|
+
const { goBack } = useNavigation();
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<SafeAreaView style={{ width: '100%', height: '100%', backgroundColor: '#FFF', alignItems: 'center', justifyContent: 'center' }}>
|
|
12
|
+
<StatusBar
|
|
13
|
+
backgroundColor='#fff'
|
|
14
|
+
barStyle={'dark-content'}
|
|
15
|
+
/>
|
|
16
|
+
<TouchableOpacity
|
|
17
|
+
style={{ width: '100%', height: '100%', alignItems: 'center', justifyContent: 'space-around'}}
|
|
18
|
+
onPress={() => {
|
|
19
|
+
goBack()
|
|
20
|
+
}}
|
|
21
|
+
>
|
|
22
|
+
<Image source={require("../Assets/images/shakebugLogo.png")} resizeMode='contain' style={{ width: '80%', height: '20%' }} />
|
|
23
|
+
|
|
24
|
+
<View style={{width: '100%', height: "20%", alignItems: 'center', justifyContent: 'center', marginTop: '-15%'}}>
|
|
25
|
+
<Image source={require("../Assets/images/shake.png")} resizeMode='contain' style={{ width: '40%', height: '100%'}} />
|
|
26
|
+
<Text style={{width: '60%', letterSpacing: 1, fontSize: 16, fontWeight: '500', color: '#000', textAlign: 'center'}}>Shake your mobile to report a bug</Text>
|
|
27
|
+
</View>
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
<Text style={{ letterSpacing: 1, fontSize: 16, fontWeight: '500', color: '#000', textAlign: 'center'}}>Tap anywhare to dismiss</Text>
|
|
31
|
+
</TouchableOpacity>
|
|
32
|
+
</SafeAreaView>
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export default TutorialScreen
|