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.
Files changed (296) hide show
  1. package/DeviceInfo/index.js.flow +177 -0
  2. package/DeviceInfo/index.ts +1034 -0
  3. package/DeviceInfo/internal/asyncHookWrappers.ts +59 -0
  4. package/DeviceInfo/internal/devicesWithDynamicIsland.ts +30 -0
  5. package/DeviceInfo/internal/devicesWithNotch.ts +374 -0
  6. package/DeviceInfo/internal/nativeInterface.ts +28 -0
  7. package/DeviceInfo/internal/privateTypes.ts +231 -0
  8. package/DeviceInfo/internal/supported-platform-info.ts +97 -0
  9. package/DeviceInfo/internal/types.ts +19 -0
  10. package/DeviceInfo/web/index.js +223 -0
  11. package/GetLocals/src/NativeRNLocalize.ts +18 -0
  12. package/GetLocals/src/constants.ts +269 -0
  13. package/GetLocals/src/index.ts +56 -0
  14. package/GetLocals/src/module.ts +51 -0
  15. package/GetLocals/src/module.web.ts +148 -0
  16. package/GetLocals/src/types.ts +31 -0
  17. package/GetLocation/LocationError.ts +20 -0
  18. package/GetLocation/index.ts +46 -0
  19. package/GetLocation/utils.ts +89 -0
  20. package/ImageOrVedioPicker/src/index.ts +28 -0
  21. package/ImageOrVedioPicker/src/platforms/NativeImagePicker.ts +10 -0
  22. package/ImageOrVedioPicker/src/platforms/native.ts +61 -0
  23. package/ImageOrVedioPicker/src/platforms/web.ts +159 -0
  24. package/ImageOrVedioPicker/src/types.ts +74 -0
  25. package/NetInfo/src/__tests__/eventListenerCallbacks.spec.ts +332 -0
  26. package/NetInfo/src/__tests__/fetch.spec.ts +479 -0
  27. package/NetInfo/src/index.ts +186 -0
  28. package/NetInfo/src/internal/__mocks__/nativeModule.ts +13 -0
  29. package/NetInfo/src/internal/defaultConfiguration.ts +17 -0
  30. package/NetInfo/src/internal/defaultConfiguration.web.ts +17 -0
  31. package/NetInfo/src/internal/internetReachability.ts +180 -0
  32. package/NetInfo/src/internal/nativeInterface.ts +43 -0
  33. package/NetInfo/src/internal/nativeInterface.web.ts +27 -0
  34. package/NetInfo/src/internal/nativeModule.ts +15 -0
  35. package/NetInfo/src/internal/nativeModule.web.ts +306 -0
  36. package/NetInfo/src/internal/privateTypes.ts +41 -0
  37. package/NetInfo/src/internal/state.ts +137 -0
  38. package/NetInfo/src/internal/types.ts +128 -0
  39. package/README.md +246 -0
  40. package/RecordScreen/src/index.tsx +75 -0
  41. package/ScreenShot/src/RNViewShot.js +3 -0
  42. package/ScreenShot/src/RNViewShot.web.js +42 -0
  43. package/ScreenShot/src/index.js +308 -0
  44. package/Sensor/src/index.js +14 -0
  45. package/Sensor/src/rnsensors.js +57 -0
  46. package/Sensor/src/sensors.js +97 -0
  47. package/VideoPlayer/PlayVideo.tsx +51 -0
  48. package/VideoPlayer/index.js +69 -0
  49. package/android/README.md +14 -0
  50. package/android/build/generated/source/buildConfig/debug/com/shakebug/BuildConfig.java +10 -0
  51. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +42 -0
  52. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +18 -0
  53. package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +6 -0
  54. package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +1 -0
  55. package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
  56. package/android/build/intermediates/compile_r_class_jar/debug/R.jar +0 -0
  57. package/android/build/intermediates/compile_symbol_list/debug/R.txt +47 -0
  58. package/android/build/intermediates/compiled_local_resources/debug/out/xml_imagepicker_provider_paths.xml.flat +0 -0
  59. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +12 -0
  60. package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
  61. package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
  62. package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
  63. package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +2 -0
  64. package/android/build/intermediates/javac/debug/classes/com/shakebug/BuildConfig.class +0 -0
  65. package/android/build/intermediates/javac/debug/classes/com/shakebug/CustomMediaMetadataRetriever.class +0 -0
  66. package/android/build/intermediates/javac/debug/classes/com/shakebug/ImageMetadata.class +0 -0
  67. package/android/build/intermediates/javac/debug/classes/com/shakebug/ImagePickerProvider.class +0 -0
  68. package/android/build/intermediates/javac/debug/classes/com/shakebug/Metadata.class +0 -0
  69. package/android/build/intermediates/javac/debug/classes/com/shakebug/Options.class +0 -0
  70. package/android/build/intermediates/javac/debug/classes/com/shakebug/RecordScreenModule$1.class +0 -0
  71. package/android/build/intermediates/javac/debug/classes/com/shakebug/RecordScreenModule.class +0 -0
  72. package/android/build/intermediates/javac/debug/classes/com/shakebug/Shakebug.class +0 -0
  73. package/android/build/intermediates/javac/debug/classes/com/shakebug/ShakebugPackage.class +0 -0
  74. package/android/build/intermediates/javac/debug/classes/com/shakebug/Utility.class +0 -0
  75. package/android/build/intermediates/javac/debug/classes/com/shakebug/Utils.class +0 -0
  76. package/android/build/intermediates/javac/debug/classes/com/shakebug/VideoMetadata.class +0 -0
  77. package/android/build/intermediates/javac/debug/classes/com/shakebug/ViewShot$1.class +0 -0
  78. package/android/build/intermediates/javac/debug/classes/com/shakebug/ViewShot$2.class +0 -0
  79. package/android/build/intermediates/javac/debug/classes/com/shakebug/ViewShot$Formats.class +0 -0
  80. package/android/build/intermediates/javac/debug/classes/com/shakebug/ViewShot$Results.class +0 -0
  81. package/android/build/intermediates/javac/debug/classes/com/shakebug/ViewShot$ReusableByteArrayOutputStream.class +0 -0
  82. package/android/build/intermediates/javac/debug/classes/com/shakebug/ViewShot.class +0 -0
  83. package/android/build/intermediates/local_only_symbol_list/debug/R-def.txt +49 -0
  84. package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +82 -0
  85. package/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml +42 -0
  86. package/android/build/intermediates/navigation_json/debug/navigation.json +1 -0
  87. package/android/build/intermediates/packaged_res/debug/values/values.xml +25 -0
  88. package/android/build/intermediates/packaged_res/debug/xml/imagepicker_provider_paths.xml +4 -0
  89. package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/BuildConfig.class +0 -0
  90. package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/CustomMediaMetadataRetriever.class +0 -0
  91. package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/ImageMetadata.class +0 -0
  92. package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/ImagePickerProvider.class +0 -0
  93. package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/Metadata.class +0 -0
  94. package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/Options.class +0 -0
  95. package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/RecordScreenModule$1.class +0 -0
  96. package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/RecordScreenModule.class +0 -0
  97. package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/Shakebug.class +0 -0
  98. package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/ShakebugPackage.class +0 -0
  99. package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/Utility.class +0 -0
  100. package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/Utils.class +0 -0
  101. package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/VideoMetadata.class +0 -0
  102. package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/ViewShot$1.class +0 -0
  103. package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/ViewShot$2.class +0 -0
  104. package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/ViewShot$Formats.class +0 -0
  105. package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/ViewShot$Results.class +0 -0
  106. package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/ViewShot$ReusableByteArrayOutputStream.class +0 -0
  107. package/android/build/intermediates/runtime_library_classes_dir/debug/com/shakebug/ViewShot.class +0 -0
  108. package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +48 -0
  109. package/android/build/outputs/logs/manifest-merger-debug-report.txt +97 -0
  110. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  111. package/android/build.gradle +235 -0
  112. package/android/src/main/AndroidManifest.xml +40 -0
  113. package/android/src/main/java/com/shakebug/AmazonFireDeviceConnectivityPoller.java +170 -0
  114. package/android/src/main/java/com/shakebug/BaseUtils.java +33 -0
  115. package/android/src/main/java/com/shakebug/BroadcastReceiverConnectivityReceiver.java +131 -0
  116. package/android/src/main/java/com/shakebug/ConnectivityReceiver.java +318 -0
  117. package/android/src/main/java/com/shakebug/CrashLoggerModule.java +48 -0
  118. package/android/src/main/java/com/shakebug/DateUtil.java +64 -0
  119. package/android/src/main/java/com/shakebug/DeviceType.java +18 -0
  120. package/android/src/main/java/com/shakebug/DeviceUtil.java +46 -0
  121. package/android/src/main/java/com/shakebug/DrawingView.java +90 -0
  122. package/android/src/main/java/com/shakebug/DrawingViewManager.java +38 -0
  123. package/android/src/main/java/com/shakebug/GetLocation.java +147 -0
  124. package/android/src/main/java/com/shakebug/ImageMetadata.java +42 -0
  125. package/android/src/main/java/com/shakebug/ImagePickerProvider.java +8 -0
  126. package/android/src/main/java/com/shakebug/Metadata.java +46 -0
  127. package/android/src/main/java/com/shakebug/NetInfoModule.java +79 -0
  128. package/android/src/main/java/com/shakebug/NetInfoUtils.java +50 -0
  129. package/android/src/main/java/com/shakebug/NetworkCallbackConnectivityReceiver.java +209 -0
  130. package/android/src/main/java/com/shakebug/Options.java +42 -0
  131. package/android/src/main/java/com/shakebug/RNDeviceModule.java +1036 -0
  132. package/android/src/main/java/com/shakebug/RNInstallReferrerClient.java +124 -0
  133. package/android/src/main/java/com/shakebug/RNLocalizeModule.java +79 -0
  134. package/android/src/main/java/com/shakebug/RNLocalizeModuleImpl.java +258 -0
  135. package/android/src/main/java/com/shakebug/ReactNativeGetLocationModule.java +95 -0
  136. package/android/src/main/java/com/shakebug/RecordScreenModule.java +202 -0
  137. package/android/src/main/java/com/shakebug/ScreenshotDetectorModule.java +63 -0
  138. package/android/src/main/java/com/shakebug/SettingsUtil.java +44 -0
  139. package/android/src/main/java/com/shakebug/Shakebug.java +181 -0
  140. package/android/src/main/java/com/shakebug/ShakebugPackage.java +75 -0
  141. package/android/src/main/java/com/shakebug/ShakebugSDKImagePickerModule.java +56 -0
  142. package/android/src/main/java/com/shakebug/ShakebugSDKImagePickerModuleImpl.java +230 -0
  143. package/android/src/main/java/com/shakebug/ShakebugSDKScreenShotModule.java +196 -0
  144. package/android/src/main/java/com/shakebug/SharedPreferencesModule.java +39 -0
  145. package/android/src/main/java/com/shakebug/UnitConverter.java +48 -0
  146. package/android/src/main/java/com/shakebug/Utility.java +29 -0
  147. package/android/src/main/java/com/shakebug/Utils.java +593 -0
  148. package/android/src/main/java/com/shakebug/VideoMetadata.java +91 -0
  149. package/android/src/main/java/com/shakebug/VideoPlayerModule.java +199 -0
  150. package/android/src/main/java/com/shakebug/VideoThumbnailModule.java +215 -0
  151. package/android/src/main/java/com/shakebug/VideoTrimModule.java +372 -0
  152. package/android/src/main/java/com/shakebug/ViewShot.java +627 -0
  153. package/android/src/main/java/com/shakebug/adapters/VideoTrimmerAdapter.java +54 -0
  154. package/android/src/main/java/com/shakebug/callback/SingleCallback.java +11 -0
  155. package/android/src/main/java/com/shakebug/interfaces/IVideoTrimmerView.java +5 -0
  156. package/android/src/main/java/com/shakebug/interfaces/VideoPlayerListner.java +5 -0
  157. package/android/src/main/java/com/shakebug/interfaces/VideoTrimListener.java +10 -0
  158. package/android/src/main/java/com/shakebug/resolver/DeviceIdResolver.java +87 -0
  159. package/android/src/main/java/com/shakebug/resolver/DeviceTypeResolver.java +94 -0
  160. package/android/src/main/java/com/shakebug/thread/BackgroundExecutor.java +246 -0
  161. package/android/src/main/java/com/shakebug/thread/UiThreadExecutor.java +120 -0
  162. package/android/src/main/java/com/shakebug/types/CellularGeneration.java +60 -0
  163. package/android/src/main/java/com/shakebug/types/ConnectionType.java +26 -0
  164. package/android/src/main/java/com/shakebug/utils/StorageUtil.java +139 -0
  165. package/android/src/main/java/com/shakebug/utils/VideoTrimmerUtil.java +89 -0
  166. package/android/src/main/java/com/shakebug/widgets/RangeSeekBarView.java +534 -0
  167. package/android/src/main/java/com/shakebug/widgets/SpacesItemDecoration2.java +32 -0
  168. package/android/src/main/java/com/shakebug/widgets/VideoPlayerView.java +429 -0
  169. package/android/src/main/java/com/shakebug/widgets/VideoTrimmerView.java +477 -0
  170. package/android/src/main/java/com/shakebug/widgets/ZVideoView.java +48 -0
  171. package/android/src/main/res/drawable/custom_progress.xml +16 -0
  172. package/android/src/main/res/drawable/custom_thumb.xml +4 -0
  173. package/android/src/main/res/drawable/ic_close_button.xml +10 -0
  174. package/android/src/main/res/drawable/ic_video_pause_black.png +0 -0
  175. package/android/src/main/res/drawable/ic_video_play_black.png +0 -0
  176. package/android/src/main/res/drawable/ic_video_thumb_handle.png +0 -0
  177. package/android/src/main/res/drawable/icon_seek_bar.png +0 -0
  178. package/android/src/main/res/layout/video_player_view.xml +121 -0
  179. package/android/src/main/res/layout/video_thumb_item_layout.xml +16 -0
  180. package/android/src/main/res/layout/video_trimmer_view.xml +148 -0
  181. package/android/src/main/res/values/colors.xml +17 -0
  182. package/android/src/main/res/values/strings.xml +14 -0
  183. package/android/src/main/res/xml/imagepicker_provider_paths.xml +4 -0
  184. package/ios/CammeraPermission/RNCameraPermission.h +16 -0
  185. package/ios/CammeraPermission/RNCameraPermission.m +46 -0
  186. package/ios/DeviceInfo/DeviceUID.h +14 -0
  187. package/ios/DeviceInfo/DeviceUID.m +202 -0
  188. package/ios/DeviceInfo/EnvironmentUtil.h +41 -0
  189. package/ios/DeviceInfo/EnvironmentUtil.m +56 -0
  190. package/ios/DeviceInfo/RNDeviceInfo.h +22 -0
  191. package/ios/DeviceInfo/RNDeviceInfo.m +918 -0
  192. package/ios/GetLocals/ShakebugSDKRNLocalize.h +21 -0
  193. package/ios/GetLocals/ShakebugSDKRNLocalize.m +296 -0
  194. package/ios/GetLocation/SettingsUtil.h +16 -0
  195. package/ios/GetLocation/SettingsUtil.m +21 -0
  196. package/ios/GetLocation/ShakebugSDKLocationModule.h +17 -0
  197. package/ios/GetLocation/ShakebugSDKLocationModule.m +218 -0
  198. package/ios/ImageOrVideoPicker/ShakebugSDKImagePickerManager.h +40 -0
  199. package/ios/ImageOrVideoPicker/ShakebugSDKImagePickerManager.m +588 -0
  200. package/ios/ImageOrVideoPicker/ShakebugSDKImagePickerUtils.h +26 -0
  201. package/ios/ImageOrVideoPicker/ShakebugSDKImagePickerUtils.m +194 -0
  202. package/ios/MicrophonePermissionManager.h +14 -0
  203. package/ios/MicrophonePermissionManager.m +35 -0
  204. package/ios/NetInfo/RNCConnectionState.h +42 -0
  205. package/ios/NetInfo/RNCConnectionState.m +119 -0
  206. package/ios/NetInfo/RNCConnectionStateWatcher.h +31 -0
  207. package/ios/NetInfo/RNCConnectionStateWatcher.m +136 -0
  208. package/ios/NetInfo/RNCNetInfo.h +13 -0
  209. package/ios/NetInfo/RNCNetInfo.m +269 -0
  210. package/ios/RecordScreen/ShakebugSDKRecordScreen.h +31 -0
  211. package/ios/RecordScreen/ShakebugSDKRecordScreen.m +309 -0
  212. package/ios/ScreenShot/ShakebugSDKRNViewShot.h +6 -0
  213. package/ios/ScreenShot/ShakebugSDKRNViewShot.m +186 -0
  214. package/ios/ScreenshotDetector/ScreenShotDetector.h +12 -0
  215. package/ios/ScreenshotDetector/ScreenShotDetector.m +37 -0
  216. package/ios/Senors/RNSensorsAccelerometer.h +22 -0
  217. package/ios/Senors/RNSensorsAccelerometer.m +162 -0
  218. package/ios/Senors/RNSensorsBarometer.h +22 -0
  219. package/ios/Senors/RNSensorsBarometer.m +141 -0
  220. package/ios/Senors/RNSensorsGravity.h +22 -0
  221. package/ios/Senors/RNSensorsGravity.m +165 -0
  222. package/ios/Senors/RNSensorsGyroscope.h +22 -0
  223. package/ios/Senors/RNSensorsGyroscope.m +160 -0
  224. package/ios/Senors/RNSensorsMagnetometer.h +22 -0
  225. package/ios/Senors/RNSensorsMagnetometer.m +163 -0
  226. package/ios/Senors/RNSensorsOrientation.h +22 -0
  227. package/ios/Senors/RNSensorsOrientation.m +189 -0
  228. package/ios/Senors/RNSensorsUtils.h +7 -0
  229. package/ios/Senors/RNSensorsUtils.m +9 -0
  230. package/ios/Shakebug.h +7 -0
  231. package/ios/Shakebug.m +16 -0
  232. package/ios/Shakebug.xcodeproj/project.pbxproj +872 -0
  233. package/ios/Shakebug.xcodeproj/xcshareddata/xcschemes/Shakebug.xcscheme +66 -0
  234. package/ios/Shakebug.xcworkspace/contents.xcworkspacedata +10 -0
  235. package/ios/Shakebug.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  236. package/ios/SketchCanvas/DrawingView.h +18 -0
  237. package/ios/SketchCanvas/DrawingView.m +96 -0
  238. package/ios/SketchCanvas/DrawingViewManager.h +12 -0
  239. package/ios/SketchCanvas/DrawingViewManager.m +35 -0
  240. package/ios/Storage/SharedPreferencesModule.h +13 -0
  241. package/ios/Storage/SharedPreferencesModule.m +35 -0
  242. package/ios/Thumbnaill/VideoThumbnailManager.h +12 -0
  243. package/ios/Thumbnaill/VideoThumbnailManager.m +73 -0
  244. package/ios/TrimVideo/ShakebugSDKVideoTrim.swift +372 -0
  245. package/ios/TrimVideo/VideoTrim-Bridging-Header.h +10 -0
  246. package/ios/TrimVideo/VideoTrim.m +23 -0
  247. package/ios/TrimVideo/VideoTrimmer.swift +810 -0
  248. package/ios/TrimVideo/VideoTrimmerThumb.swift +119 -0
  249. package/ios/TrimVideo/VideoTrimmerViewController.swift +301 -0
  250. package/ios/VideoPlayer/VideoPlayerModule.h +14 -0
  251. package/ios/VideoPlayer/VideoPlayerModule.m +29 -0
  252. package/ios/VideoPlayer/VideoPlayerViewController.h +18 -0
  253. package/ios/VideoPlayer/VideoPlayerViewController.m +29 -0
  254. package/package.json +45 -0
  255. package/shakebug-react-native.podspec +50 -0
  256. package/src/APIs/AddIssue.js +70 -0
  257. package/src/APIs/EndSession.js +32 -0
  258. package/src/APIs/Event.js +39 -0
  259. package/src/APIs/MatchKey.js +40 -0
  260. package/src/APIs/StartSession.js +84 -0
  261. package/src/Assets/images/OpenSketch.png +0 -0
  262. package/src/Assets/images/Push.png +0 -0
  263. package/src/Assets/images/RemoveTextView.png +0 -0
  264. package/src/Assets/images/black.png +0 -0
  265. package/src/Assets/images/blue.png +0 -0
  266. package/src/Assets/images/borderdBlack.png +0 -0
  267. package/src/Assets/images/borderdBlue.png +0 -0
  268. package/src/Assets/images/borderdGreen.png +0 -0
  269. package/src/Assets/images/borderdRed.png +0 -0
  270. package/src/Assets/images/borderdYellow.png +0 -0
  271. package/src/Assets/images/clear.png +0 -0
  272. package/src/Assets/images/close.png +0 -0
  273. package/src/Assets/images/green.png +0 -0
  274. package/src/Assets/images/next.png +0 -0
  275. package/src/Assets/images/play.png +0 -0
  276. package/src/Assets/images/red.png +0 -0
  277. package/src/Assets/images/shake.png +0 -0
  278. package/src/Assets/images/shakebugLogo.png +0 -0
  279. package/src/Assets/images/stopButton.png +0 -0
  280. package/src/Assets/images/text_icon.png +0 -0
  281. package/src/Assets/images/yellow.png +0 -0
  282. package/src/Componanats/CustomAlert.js +80 -0
  283. package/src/Componanats/ErrorHandler.js +80 -0
  284. package/src/Componanats/GlobalStateContext.js +22 -0
  285. package/src/Componanats/KeyboardAvoidingWrapper.js +43 -0
  286. package/src/Componanats/NavigationContext.js +42 -0
  287. package/src/Componanats/ShakeFunction.js +562 -0
  288. package/src/Componanats/localization.js +482 -0
  289. package/src/Screens/AddDetailsScreen.js +462 -0
  290. package/src/Screens/FirstScreen.js +629 -0
  291. package/src/Screens/Shakebug.js +487 -0
  292. package/src/Screens/StrockView.js +20 -0
  293. package/src/Screens/TrimVideoScreen.js +81 -0
  294. package/src/Screens/TutorialScreen.js +36 -0
  295. package/src/index.tsx +117 -0
  296. package/trimVideo/src/index.tsx +141 -0
@@ -0,0 +1,137 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @format
8
+ */
9
+
10
+ import {NativeEventSubscription} from 'react-native';
11
+ import NativeInterface from './nativeInterface';
12
+ import InternetReachability from './internetReachability';
13
+ import * as Types from './types';
14
+ import * as PrivateTypes from './privateTypes';
15
+
16
+ export default class State {
17
+ private _nativeEventSubscription: NativeEventSubscription | null = null;
18
+ private _subscriptions = new Set<Types.NetInfoChangeHandler>();
19
+ private _latestState: Types.NetInfoState | null = null;
20
+ private _internetReachability: InternetReachability;
21
+
22
+ constructor(configuration: Types.NetInfoConfiguration) {
23
+ // Add the listener to the internet connectivity events
24
+ this._internetReachability = new InternetReachability(
25
+ configuration,
26
+ this._handleInternetReachabilityUpdate,
27
+ );
28
+
29
+ // Add the subscription to the native events
30
+ this._nativeEventSubscription = NativeInterface.eventEmitter.addListener(
31
+ PrivateTypes.DEVICE_CONNECTIVITY_EVENT,
32
+ this._handleNativeStateUpdate,
33
+ );
34
+
35
+ // Fetch the current state from the native module
36
+ this._fetchCurrentState();
37
+ }
38
+
39
+ private _handleNativeStateUpdate = (
40
+ state: PrivateTypes.NetInfoNativeModuleState,
41
+ ): void => {
42
+ // Update the internet reachability module
43
+ this._internetReachability.update(state);
44
+
45
+ // Convert the state from native to JS shape
46
+ const convertedState = this._convertState(state);
47
+
48
+ // Update the listeners
49
+ this._latestState = convertedState;
50
+ this._subscriptions.forEach((handler): void => handler(convertedState));
51
+ };
52
+
53
+ private _handleInternetReachabilityUpdate = (
54
+ isInternetReachable: boolean | null | undefined,
55
+ ): void => {
56
+ if (!this._latestState) {
57
+ return;
58
+ }
59
+
60
+ const nextState = {
61
+ ...this._latestState,
62
+ isInternetReachable,
63
+ } as Types.NetInfoState;
64
+ this._latestState = nextState;
65
+ this._subscriptions.forEach((handler): void => handler(nextState));
66
+ };
67
+
68
+ public _fetchCurrentState = async (
69
+ requestedInterface?: string,
70
+ ): Promise<Types.NetInfoState> => {
71
+ const state = await NativeInterface.getCurrentState(requestedInterface);
72
+
73
+ // Update the internet reachability module
74
+ this._internetReachability.update(state);
75
+ // Convert and store the new state
76
+ const convertedState = this._convertState(state);
77
+ if (!requestedInterface) {
78
+ this._latestState = convertedState;
79
+ this._subscriptions.forEach((handler): void => handler(convertedState));
80
+ }
81
+
82
+ return convertedState;
83
+ };
84
+
85
+ private _convertState = (
86
+ input: PrivateTypes.NetInfoNativeModuleState,
87
+ ): Types.NetInfoState => {
88
+ if (typeof input.isInternetReachable === 'boolean') {
89
+ return input as Types.NetInfoState;
90
+ } else {
91
+ return {
92
+ ...input,
93
+ isInternetReachable: this._internetReachability.currentState(),
94
+ } as Types.NetInfoState;
95
+ }
96
+ };
97
+
98
+ public latest = (
99
+ requestedInterface?: string,
100
+ ): Promise<Types.NetInfoState> => {
101
+ if (requestedInterface) {
102
+ return this._fetchCurrentState(requestedInterface);
103
+ } else if (this._latestState) {
104
+ return Promise.resolve(this._latestState);
105
+ } else {
106
+ return this._fetchCurrentState();
107
+ }
108
+ };
109
+
110
+ public add = (handler: Types.NetInfoChangeHandler): void => {
111
+ // Add the subscription handler to our set
112
+ this._subscriptions.add(handler);
113
+
114
+ // Send it the latest data we have
115
+ if (this._latestState) {
116
+ handler(this._latestState);
117
+ } else {
118
+ this.latest().then(handler);
119
+ }
120
+ };
121
+
122
+ public remove = (handler: Types.NetInfoChangeHandler): void => {
123
+ this._subscriptions.delete(handler);
124
+ };
125
+
126
+ public tearDown = (): void => {
127
+ if (this._internetReachability) {
128
+ this._internetReachability.tearDown();
129
+ }
130
+
131
+ if (this._nativeEventSubscription) {
132
+ this._nativeEventSubscription.remove();
133
+ }
134
+
135
+ this._subscriptions.clear();
136
+ };
137
+ }
@@ -0,0 +1,128 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @format
8
+ */
9
+
10
+ export enum NetInfoStateType {
11
+ unknown = 'unknown',
12
+ none = 'none',
13
+ cellular = 'cellular',
14
+ wifi = 'wifi',
15
+ bluetooth = 'bluetooth',
16
+ ethernet = 'ethernet',
17
+ wimax = 'wimax',
18
+ vpn = 'vpn',
19
+ other = 'other',
20
+ }
21
+
22
+ export type NetInfoMethodType = 'HEAD' | 'GET';
23
+
24
+ export enum NetInfoCellularGeneration {
25
+ '2g' = '2g',
26
+ '3g' = '3g',
27
+ '4g' = '4g',
28
+ '5g' = '5g',
29
+ }
30
+
31
+ export interface NetInfoConnectedDetails {
32
+ isConnectionExpensive: boolean;
33
+ }
34
+
35
+ interface NetInfoConnectedState<
36
+ T extends NetInfoStateType,
37
+ D extends Record<string, unknown> = Record<string, unknown>
38
+ > {
39
+ type: T;
40
+ isConnected: true;
41
+ isInternetReachable: boolean | null;
42
+ details: D & NetInfoConnectedDetails;
43
+ isWifiEnabled?: boolean;
44
+ }
45
+
46
+ interface NetInfoDisconnectedState<T extends NetInfoStateType> {
47
+ type: T;
48
+ isConnected: false;
49
+ isInternetReachable: false;
50
+ details: null;
51
+ isWifiEnabled?: boolean;
52
+ }
53
+
54
+ export interface NetInfoUnknownState {
55
+ type: NetInfoStateType.unknown;
56
+ isConnected: boolean | null;
57
+ isInternetReachable: null;
58
+ details: null;
59
+ isWifiEnabled?: boolean;
60
+ }
61
+
62
+ export type NetInfoNoConnectionState = NetInfoDisconnectedState<
63
+ NetInfoStateType.none
64
+ >;
65
+ export type NetInfoDisconnectedStates =
66
+ | NetInfoUnknownState
67
+ | NetInfoNoConnectionState;
68
+
69
+ export type NetInfoCellularState = NetInfoConnectedState<
70
+ NetInfoStateType.cellular,
71
+ {
72
+ cellularGeneration: NetInfoCellularGeneration | null;
73
+ carrier: string | null;
74
+ }
75
+ >;
76
+ export type NetInfoWifiState = NetInfoConnectedState<
77
+ NetInfoStateType.wifi,
78
+ {
79
+ ssid: string | null;
80
+ bssid: string | null;
81
+ strength: number | null;
82
+ ipAddress: string | null;
83
+ subnet: string | null;
84
+ frequency: number | null;
85
+ linkSpeed: number | null;
86
+ rxLinkSpeed: number | null;
87
+ txLinkSpeed: number | null;
88
+ }
89
+ >;
90
+ export type NetInfoBluetoothState = NetInfoConnectedState<
91
+ NetInfoStateType.bluetooth
92
+ >;
93
+ export type NetInfoEthernetState = NetInfoConnectedState<
94
+ NetInfoStateType.ethernet,
95
+ {
96
+ ipAddress: string | null;
97
+ subnet: string | null;
98
+ }
99
+ >;
100
+ export type NetInfoWimaxState = NetInfoConnectedState<NetInfoStateType.wimax>;
101
+ export type NetInfoVpnState = NetInfoConnectedState<NetInfoStateType.vpn>;
102
+ export type NetInfoOtherState = NetInfoConnectedState<NetInfoStateType.other>;
103
+ export type NetInfoConnectedStates =
104
+ | NetInfoCellularState
105
+ | NetInfoWifiState
106
+ | NetInfoBluetoothState
107
+ | NetInfoEthernetState
108
+ | NetInfoWimaxState
109
+ | NetInfoVpnState
110
+ | NetInfoOtherState;
111
+
112
+ export type NetInfoState = NetInfoDisconnectedStates | NetInfoConnectedStates;
113
+
114
+ export type NetInfoChangeHandler = (state: NetInfoState) => void;
115
+ export type NetInfoSubscription = () => void;
116
+
117
+ export interface NetInfoConfiguration {
118
+ reachabilityUrl: string;
119
+ reachabilityMethod?: NetInfoMethodType;
120
+ reachabilityHeaders?: Record<string, string>;
121
+ reachabilityTest: (response: Response) => Promise<boolean>;
122
+ reachabilityLongTimeout: number;
123
+ reachabilityShortTimeout: number;
124
+ reachabilityRequestTimeout: number;
125
+ reachabilityShouldRun: () => boolean;
126
+ shouldFetchWiFiSSID: boolean;
127
+ useNativeReachability: boolean;
128
+ }
package/README.md ADDED
@@ -0,0 +1,246 @@
1
+ # shakebug-react-native
2
+
3
+
4
+ <a href="https://www.shakebug.com"><img src="https://www.shakebug.com/assets/images/logo.png"></a>
5
+
6
+ Shakebug allows users to report the bug from your mobile phone for your application. Here users just need to shake their mobile and all the data regarding bugs & crashes can be seen by developers through their log in panel easily.
7
+
8
+ For more info, visit [shakebug.com](https://www.shakebug.com).
9
+
10
+
11
+
12
+ ## Installation
13
+
14
+ Navigate to your React Native project directory and install `shakebug-react-native`
15
+
16
+ ```bash
17
+ npm install shakebug-react-native
18
+ ```
19
+
20
+ Or if you prefer to use Yarn instead of npm:
21
+
22
+ ```bash
23
+ yarn add shakebug-react-native
24
+ ```
25
+
26
+ ### iOS
27
+
28
+ 1. You need to provide permissions inside `ios/YourProjectName/info.plist`:
29
+
30
+ ```xml
31
+ <key>NSCameraUsageDescription</key>
32
+ <string></string>
33
+
34
+ <key>NSMicrophoneUsageDescription</key>
35
+ <string></string>
36
+
37
+ <key>NSPhotoLibraryUsageDescription</key>
38
+ <string></string>
39
+ ```
40
+
41
+ 2. CocoaPods installation:
42
+
43
+ ```bash
44
+ cd ios && pod install && cd ..
45
+ ```
46
+
47
+ ### Android
48
+
49
+ Android minSdkVersion 24 required
50
+ You can change it in `android/build.gradle`
51
+
52
+ ```bash
53
+ buildscript {
54
+ ...
55
+ ext {
56
+ ...
57
+ minSdkVersion = 24 or later
58
+ ...
59
+ }
60
+ ...
61
+ }
62
+ ```
63
+
64
+ ## Usage
65
+
66
+ you Need to import ShakebugView in root file of application (App.js)
67
+
68
+
69
+ ```javascript
70
+
71
+ Import ShakebugView from 'shakebug-react-native';
72
+
73
+ export default App = () => {
74
+ return(
75
+ <ShakebugView
76
+ Android_appkey= “your android app key”
77
+ iOS_appkey= “your ios app key”
78
+ other options...
79
+ >
80
+ //Your code...
81
+ </ShakebugView>
82
+ )
83
+ }
84
+ ```
85
+
86
+ If you use NavigationContainer in App.js/root file (where you import ShakebugView) then you need to pass independent as parameter in NavigationContainer
87
+
88
+ ```javascript
89
+
90
+ Import ShakebugView from 'shakebug-react-native';
91
+
92
+ export default App = () => {
93
+ return(
94
+ <ShakebugView
95
+ Android_appkey= “your android app key”
96
+ iOS_appkey= “your ios app key”
97
+ other options…
98
+ >
99
+ <NavigationContainer independent>
100
+ //Your code...
101
+ </NavigationContainer>
102
+ </ShakebugView>
103
+ )
104
+ }
105
+
106
+ ```
107
+ You can add event on click:
108
+
109
+ ```javascript
110
+
111
+ import { Button } from 'react-native';
112
+ import ShakebugView, { addEventKey } from 'react-native-shakebug';
113
+
114
+ export default App = () => {
115
+ return(
116
+ <Button
117
+ title='Prees'
118
+ onPress={() => {
119
+ addEventKey("key_name", value)
120
+ }}
121
+ />
122
+ )
123
+ }
124
+
125
+ ```
126
+
127
+ To ensure the privacy of your users' sensitive information, such as payment details or account information etc.., you can mark any view containing this information as private using ShakebugSdkProtectedView. By doing so, the private view will automatically appear with a black overlay in any screenshots taken and while recording screen:
128
+
129
+ ```javascript
130
+
131
+ import { Button } from 'react-native';
132
+ import { ShakebugSdkProtectedView } from 'react-native-shakebug';
133
+
134
+ export default App = () => {
135
+ return(
136
+ <ShakebugSdkProtectedView>
137
+ <View>
138
+ <Text>This is sensitive information!</Text>
139
+ </View>
140
+ </ShakebugSdkProtectedView>
141
+ )
142
+ }
143
+
144
+ ```
145
+
146
+ ## Properties
147
+
148
+ <table>
149
+ <tr>
150
+ <th>Key Name</th>
151
+ <th>Type</th>
152
+ <th>Description</th>
153
+ <th>Default Value</th>
154
+ <tr>
155
+ <tr>
156
+ <td>Android_appkey</td>
157
+ <td>String(required)</td>
158
+ <td>This initializes Shake Bug with the default invocation event. Be sure to pass <Your Key> your application key which given by ShakeBug website.</td>
159
+ <td></td>
160
+ </tr>
161
+ <tr>
162
+ <td>iOS_appkey</td>
163
+ <td>String(required)</td>
164
+ <td>This initializes Shake Bug with the default invocation event. Be sure to pass <Your Key> your application key which given by ShakeBug website.</td>
165
+ <td></td>
166
+ </tr>
167
+ <tr>
168
+ <td>showTutorialScreenFirstTime</td>
169
+ <td>boolean</td>
170
+ <td>Add the following for enabling/disabling first time tutorial screen.</td>
171
+ <td>true</td>
172
+ </tr>
173
+ <tr>
174
+ <td>ShakebugThemeColor</td>
175
+ <td>String</td>
176
+ <td>Developer can also set custome theme color in Shakebug SDK screens.</td>
177
+ <td></td>
178
+ </tr>
179
+ <tr>
180
+ <td>changeSDKScreenTitle</td>
181
+ <td>Array</td>
182
+ <td>Developer can also set custom title for Shakebug annotate and feedback input screen.</td>
183
+ <td>["Annotate your bug", "Add Details"]</td>
184
+ </tr>
185
+ <tr>
186
+ <td>allowToReportBugByShakingMobile</td>
187
+ <td>boolean</td>
188
+ <td>Add the following to allow report bug by shaking mobile.</td>
189
+ <td>true</td>
190
+ </tr>
191
+ <tr>
192
+ <td>allowToReportBugByScreenCapture</td>
193
+ <td>boolean</td>
194
+ <td>Add the following to allow report bug by screenshot capture event.</td>
195
+ <td>false</td>
196
+ </tr>
197
+ <tr>
198
+ <td>ShakebugLanguage</td>
199
+ <td>String</td>
200
+ <td>If you want to set forcefully any language for the bug reporting screen then use following prop.</td>
201
+ <td>Your Device's language</td>
202
+ </tr>
203
+ <tr>
204
+ <td>allowCrashReport</td>
205
+ <td>boolean</td>
206
+ <td>If you want to allow report crash while app get crashed then use following prop.</td>
207
+ <td>true</td>
208
+ </tr>
209
+ <tr>
210
+ <td>makeLogEnabled</td>
211
+ <td>boolean</td>
212
+ <td>If you want to show any logs on console then use following prop.</td>
213
+ <td>false</td>
214
+ </tr>
215
+ <tr>
216
+ <td>setShakebugSDKEndPointURL</td>
217
+ <td>Array</td>
218
+ <td>If you have on-premise hosting plan then following prop will be used.</td>
219
+ <td></td>
220
+ </tr>
221
+ </table>
222
+
223
+ ## Methods
224
+
225
+ <table>
226
+ <tr>
227
+ <th>Name</th>
228
+ <th>Description</th>
229
+ <th>Usage</th>
230
+ </tr>
231
+ <tr>
232
+ <td>addEventKey</td>
233
+ <td>If you want add event to any screen or activity use following method</td>
234
+ <td>addEventKey("Key_name", value)</td>
235
+ </tr>
236
+ </table>
237
+
238
+ ## Documentation
239
+
240
+ [View our documentation](https://www.shakebug.com/installation#react).
241
+
242
+ ## Contact
243
+
244
+ Visit on: [https://www.shakebug.com](https://www.shakebug.com).
245
+
246
+ Contact us on [support@shakebug.com](mailto:support@shakebug.com) in case of any use.
@@ -0,0 +1,75 @@
1
+ import { NativeModules, Dimensions } from 'react-native';
2
+
3
+ export const RecordingResult = {
4
+ Started: 'started',
5
+ PermissionError: 'permission_error',
6
+ } as const;
7
+
8
+ export type RecordingStartResponse =
9
+ (typeof RecordingResult)[keyof typeof RecordingResult];
10
+
11
+ export type RecordScreenConfigType = {
12
+ fps?: number;
13
+ bitrate?: number;
14
+ mic?: boolean;
15
+ };
16
+
17
+ export type RecordingSuccessResponse = {
18
+ status: 'success';
19
+ result: {
20
+ outputURL: string;
21
+ };
22
+ };
23
+
24
+ export type RecordingErrorResponse = {
25
+ status: 'error';
26
+ result: unknown;
27
+ };
28
+
29
+ export type RecordingResponse =
30
+ | RecordingSuccessResponse
31
+ | RecordingErrorResponse;
32
+
33
+ type RecordScreenNativeModule = {
34
+ setup(
35
+ config: RecordScreenConfigType & { width: number; height: number }
36
+ ): void;
37
+ startRecording(): Promise<RecordingStartResponse>;
38
+ stopRecording(): Promise<RecordingResponse>;
39
+ clean(): Promise<string>;
40
+ };
41
+
42
+ const { ShakebugSDKRecordScreen } = NativeModules;
43
+
44
+ const RS = ShakebugSDKRecordScreen as RecordScreenNativeModule;
45
+
46
+ class ReactNativeRecordScreenClass {
47
+ private setup(config: RecordScreenConfigType = {}): void {
48
+ const { width, height } = Dimensions.get('window');
49
+ RS.setup({
50
+ mic: true,
51
+ width,
52
+ height,
53
+ fps: 60,
54
+ bitrate: 1920 * 1080 * 144,
55
+ ...config,
56
+ });
57
+ }
58
+
59
+ startRecording(config: RecordScreenConfigType = {}) {
60
+ this.setup(config);
61
+ return RS.startRecording();
62
+ }
63
+
64
+ stopRecording() {
65
+ return RS.stopRecording();
66
+ }
67
+
68
+ clean() {
69
+ return RS.clean();
70
+ }
71
+ }
72
+
73
+ const ReactNativeRecordScreen = new ReactNativeRecordScreenClass();
74
+
75
+ export default ReactNativeRecordScreen;
@@ -0,0 +1,3 @@
1
+ //@flow
2
+ import { NativeModules } from "react-native";
3
+ export default NativeModules.ShakebugSDKRNViewShot
@@ -0,0 +1,42 @@
1
+ //@flow
2
+ import html2canvas from "html2canvas";
3
+
4
+ async function captureRef(view, options) {
5
+ if (options.result === "tmpfile") {
6
+ console.warn("Tmpfile is not implemented for web. Try base64 or file.\n"+
7
+ "For compatibility, it currently returns the same result as data-uri");
8
+ }
9
+
10
+ // TODO: implement snapshotContentContainer option
11
+
12
+ const h2cOptions = {};
13
+ let renderedCanvas = await html2canvas(view, h2cOptions);
14
+
15
+ if (options.width && options.height) {
16
+ // Resize result
17
+ const resizedCanvas = document.createElement('canvas');
18
+ const resizedContext = resizedCanvas.getContext('2d');
19
+ resizedCanvas.height = options.height;
20
+ resizedCanvas.width = options.width;
21
+ resizedContext.drawImage(renderedCanvas, 0, 0, resizedCanvas.width, resizedCanvas.height);
22
+ renderedCanvas = resizedCanvas;
23
+ }
24
+
25
+ const dataUrl = renderedCanvas.toDataURL("image/" + options.format, options.quality);
26
+ if (options.result === "data-uri" || options.result === "tmpfile") return dataUrl;
27
+ return dataUrl.replace(/data:image\/(\w+);base64,/, '');
28
+ }
29
+
30
+ function captureScreen(options) {
31
+ return captureRef(window.document.body, options);
32
+ }
33
+
34
+ function releaseCapture(uri) {
35
+ throw new Error("Tmpfile is not implemented for web. Try base64 or file");
36
+ }
37
+
38
+ export default {
39
+ captureRef,
40
+ captureScreen,
41
+ releaseCapture
42
+ }