react-native-visit-rn-sdk 2.0.13 → 2.0.15

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 (159) hide show
  1. package/README.md +144 -0
  2. package/android/build.gradle +2 -0
  3. package/android/gradle.properties +1 -0
  4. package/android/src/main/AndroidManifest.xml +10 -0
  5. package/android/src/main/AndroidManifestNew.xml +10 -0
  6. package/android/src/main/java/com/visitrnsdk/VisitLocationModule.kt +349 -0
  7. package/android/src/main/java/com/visitrnsdk/VisitRnSdkPackage.kt +1 -1
  8. package/ios/VisitLocationModule.h +6 -0
  9. package/ios/VisitLocationModule.m +374 -0
  10. package/lib/commonjs/SecondaryWebView.android.js +145 -0
  11. package/lib/commonjs/SecondaryWebView.android.js.map +1 -0
  12. package/lib/commonjs/SecondaryWebView.ios.js +210 -0
  13. package/lib/commonjs/SecondaryWebView.ios.js.map +1 -0
  14. package/lib/commonjs/Services.js +24 -1
  15. package/lib/commonjs/Services.js.map +1 -1
  16. package/lib/commonjs/androidLocation.js +180 -0
  17. package/lib/commonjs/androidLocation.js.map +1 -0
  18. package/lib/commonjs/index.android.js +89 -120
  19. package/lib/commonjs/index.android.js.map +1 -1
  20. package/lib/commonjs/index.ios.js +77 -14
  21. package/lib/commonjs/index.ios.js.map +1 -1
  22. package/lib/commonjs/iosLocation.js +137 -0
  23. package/lib/commonjs/iosLocation.js.map +1 -0
  24. package/lib/module/SecondaryWebView.android.js +135 -0
  25. package/lib/module/SecondaryWebView.android.js.map +1 -0
  26. package/lib/module/SecondaryWebView.ios.js +201 -0
  27. package/lib/module/SecondaryWebView.ios.js.map +1 -0
  28. package/lib/module/Services.js +22 -0
  29. package/lib/module/Services.js.map +1 -1
  30. package/lib/module/androidLocation.js +170 -0
  31. package/lib/module/androidLocation.js.map +1 -0
  32. package/lib/module/index.android.js +90 -121
  33. package/lib/module/index.android.js.map +1 -1
  34. package/lib/module/index.ios.js +78 -15
  35. package/lib/module/index.ios.js.map +1 -1
  36. package/lib/module/iosLocation.js +127 -0
  37. package/lib/module/iosLocation.js.map +1 -0
  38. package/package.json +7 -3
  39. package/react-native-visit-rn-sdk.podspec +1 -0
  40. package/src/SecondaryWebView.android.js +149 -0
  41. package/src/SecondaryWebView.ios.js +230 -0
  42. package/src/Services.js +29 -0
  43. package/src/androidLocation.js +228 -0
  44. package/src/index.android.js +87 -152
  45. package/src/index.ios.js +86 -22
  46. package/src/iosLocation.js +172 -0
  47. package/android/bin/build/generated/source/buildConfig/debug/com/visitrnsdk/BuildConfig.class +0 -0
  48. package/android/bin/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +0 -7
  49. package/android/bin/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +0 -18
  50. package/android/bin/build/intermediates/aar_main_jar/debug/classes.jar +0 -0
  51. package/android/bin/build/intermediates/aar_metadata/debug/aar-metadata.properties +0 -5
  52. package/android/bin/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +0 -1
  53. package/android/bin/build/intermediates/annotations_typedef_file/debug/typedefs.txt +0 -0
  54. package/android/bin/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
  55. package/android/bin/build/intermediates/compile_r_class_jar/debug/R.jar +0 -0
  56. package/android/bin/build/intermediates/compile_symbol_list/debug/R.txt +0 -1954
  57. package/android/bin/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -1
  58. package/android/bin/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
  59. package/android/bin/build/intermediates/incremental/debug-mergeJavaRes/merge-state +0 -0
  60. package/android/bin/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
  61. package/android/bin/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
  62. package/android/bin/build/intermediates/incremental/packageDebugAssets/merger.xml +0 -2
  63. package/android/bin/build/intermediates/library_java_res/debug/res.jar +0 -0
  64. package/android/bin/build/intermediates/local_only_symbol_list/debug/R-def.txt +0 -2
  65. package/android/bin/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +0 -8
  66. package/android/bin/build/intermediates/merged_java_res/debug/feature-react-native-visit-rn-sdk.jar +0 -0
  67. package/android/bin/build/intermediates/merged_manifest/debug/AndroidManifest.xml +0 -7
  68. package/android/bin/build/intermediates/navigation_json/debug/navigation.json +0 -1
  69. package/android/bin/build/intermediates/packaged_manifests/debug/output-metadata.json +0 -18
  70. package/android/bin/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
  71. package/android/bin/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +0 -1447
  72. package/android/bin/build/intermediates/variant_model/debug/variant_model.json +0 -0
  73. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
  74. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
  75. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
  76. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
  77. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
  78. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
  79. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
  80. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
  81. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
  82. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
  83. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
  84. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
  85. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
  86. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
  87. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
  88. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
  89. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
  90. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
  91. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
  92. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
  93. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
  94. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
  95. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
  96. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
  97. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
  98. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
  99. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
  100. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
  101. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
  102. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
  103. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
  104. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
  105. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  106. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
  107. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
  108. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  109. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
  110. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
  111. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
  112. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  113. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
  114. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
  115. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
  116. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
  117. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
  118. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
  119. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
  120. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
  121. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
  122. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
  123. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
  124. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
  125. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
  126. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
  127. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
  128. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
  129. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +0 -2
  130. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
  131. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
  132. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
  133. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
  134. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
  135. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
  136. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
  137. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
  138. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
  139. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
  140. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
  141. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
  142. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
  143. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
  144. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
  145. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
  146. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  147. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
  148. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
  149. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
  150. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
  151. package/android/bin/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
  152. package/android/bin/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
  153. package/android/bin/build/outputs/aar/react-native-visit-rn-sdk-debug.aar +0 -0
  154. package/android/bin/build/outputs/logs/manifest-merger-debug-report.txt +0 -25
  155. package/android/bin/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  156. package/android/bin/build/tmp/kotlin-classes/debug/META-INF/react-native-visit-rn-sdk_debug.kotlin_module +0 -0
  157. package/android/bin/local.properties +0 -8
  158. package/lib/typescript/index.test.d.ts +0 -1
  159. package/lib/typescript/index.test.d.ts.map +0 -1
@@ -0,0 +1,374 @@
1
+ #import "VisitLocationModule.h"
2
+
3
+ #import <math.h>
4
+
5
+ static NSString *const VisitLocationErrorServicesDisabled = @"E_LOCATION_SERVICES_DISABLED";
6
+ static NSString *const VisitLocationErrorPermissionDenied = @"E_LOCATION_PERMISSION_DENIED";
7
+ static NSString *const VisitLocationErrorPermissionDeniedPreviously = @"E_LOCATION_PERMISSION_DENIED_PREVIOUSLY";
8
+ static NSString *const VisitLocationErrorPermissionRestricted = @"E_LOCATION_PERMISSION_RESTRICTED";
9
+ static NSString *const VisitLocationErrorUsageDescriptionMissing = @"E_LOCATION_USAGE_DESCRIPTION_MISSING";
10
+ static NSString *const VisitLocationErrorTimeout = @"E_LOCATION_TIMEOUT";
11
+ static NSString *const VisitLocationErrorUnavailable = @"E_LOCATION_UNAVAILABLE";
12
+ static NSString *const VisitLocationErrorRequestFailed = @"E_LOCATION_REQUEST_FAILED";
13
+
14
+ static NSTimeInterval const VisitLocationDefaultMaximumAgeMs = 60000.0;
15
+ static NSTimeInterval const VisitLocationMaximumAllowedAgeMs = 300000.0;
16
+ static NSTimeInterval const VisitLocationDefaultTimeoutMs = 10000.0;
17
+ static NSTimeInterval const VisitLocationMinimumTimeoutMs = 1000.0;
18
+ static NSTimeInterval const VisitLocationMaximumTimeoutMs = 60000.0;
19
+
20
+ @interface VisitLocationModule ()
21
+
22
+ @property(nonatomic, strong) CLLocationManager *locationManager;
23
+ @property(nonatomic, strong) NSMutableArray *pendingResolvers;
24
+ @property(nonatomic, strong) NSMutableArray *pendingRejecters;
25
+ @property(nonatomic, strong) NSTimer *locationTimeoutTimer;
26
+ @property(nonatomic, assign) BOOL requestInProgress;
27
+ @property(nonatomic, assign) BOOL locationAcquisitionStarted;
28
+ @property(nonatomic, assign) NSTimeInterval maximumAgeMs;
29
+ @property(nonatomic, assign) NSTimeInterval timeoutMs;
30
+
31
+ @end
32
+
33
+ @implementation VisitLocationModule
34
+
35
+ RCT_EXPORT_MODULE(VisitLocationModule)
36
+
37
+ + (BOOL)requiresMainQueueSetup
38
+ {
39
+ return YES;
40
+ }
41
+
42
+ - (dispatch_queue_t)methodQueue
43
+ {
44
+ return dispatch_get_main_queue();
45
+ }
46
+
47
+ - (instancetype)init
48
+ {
49
+ self = [super init];
50
+ if (self) {
51
+ _locationManager = [[CLLocationManager alloc] init];
52
+ _locationManager.delegate = self;
53
+ _pendingResolvers = [NSMutableArray array];
54
+ _pendingRejecters = [NSMutableArray array];
55
+ }
56
+ return self;
57
+ }
58
+
59
+ RCT_REMAP_METHOD(getCurrentLocation,
60
+ getCurrentLocationWithOptions:(NSDictionary *)options
61
+ resolver:(RCTPromiseResolveBlock)resolve
62
+ rejecter:(RCTPromiseRejectBlock)reject)
63
+ {
64
+ if (![self hasLocationUsageDescription]) {
65
+ reject(VisitLocationErrorUsageDescriptionMissing,
66
+ @"NSLocationWhenInUseUsageDescription must contain a user-facing purpose string",
67
+ nil);
68
+ return;
69
+ }
70
+
71
+ if (![CLLocationManager locationServicesEnabled]) {
72
+ reject(VisitLocationErrorServicesDisabled,
73
+ @"Location Services are disabled on this device",
74
+ nil);
75
+ return;
76
+ }
77
+
78
+ CLAuthorizationStatus status = [self currentAuthorizationStatus];
79
+ if (status == kCLAuthorizationStatusDenied) {
80
+ reject(VisitLocationErrorPermissionDeniedPreviously,
81
+ @"Location permission was previously denied",
82
+ nil);
83
+ return;
84
+ }
85
+
86
+ if (status == kCLAuthorizationStatusRestricted) {
87
+ reject(VisitLocationErrorPermissionRestricted,
88
+ @"Location permission is restricted on this device",
89
+ nil);
90
+ return;
91
+ }
92
+
93
+ [self.pendingResolvers addObject:[resolve copy]];
94
+ [self.pendingRejecters addObject:[reject copy]];
95
+
96
+ if (self.requestInProgress) {
97
+ return;
98
+ }
99
+
100
+ self.requestInProgress = YES;
101
+ self.maximumAgeMs = [self optionFrom:options
102
+ key:@"maximumAgeMs"
103
+ defaultValue:VisitLocationDefaultMaximumAgeMs
104
+ minimumValue:0.0
105
+ maximumValue:VisitLocationMaximumAllowedAgeMs];
106
+ self.timeoutMs = [self optionFrom:options
107
+ key:@"timeoutMs"
108
+ defaultValue:VisitLocationDefaultTimeoutMs
109
+ minimumValue:VisitLocationMinimumTimeoutMs
110
+ maximumValue:VisitLocationMaximumTimeoutMs];
111
+
112
+ if (status == kCLAuthorizationStatusNotDetermined) {
113
+ [self.locationManager requestWhenInUseAuthorization];
114
+ return;
115
+ }
116
+
117
+ [self beginLocationAcquisition];
118
+ }
119
+
120
+ - (BOOL)hasLocationUsageDescription
121
+ {
122
+ id value = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"NSLocationWhenInUseUsageDescription"];
123
+ if (![value isKindOfClass:[NSString class]]) {
124
+ return NO;
125
+ }
126
+
127
+ NSString *description = [(NSString *)value stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
128
+ return description.length > 0;
129
+ }
130
+
131
+ - (CLAuthorizationStatus)currentAuthorizationStatus
132
+ {
133
+ if (@available(iOS 14.0, *)) {
134
+ return self.locationManager.authorizationStatus;
135
+ }
136
+
137
+ return [CLLocationManager authorizationStatus];
138
+ }
139
+
140
+ - (NSTimeInterval)optionFrom:(NSDictionary *)options
141
+ key:(NSString *)key
142
+ defaultValue:(NSTimeInterval)defaultValue
143
+ minimumValue:(NSTimeInterval)minimumValue
144
+ maximumValue:(NSTimeInterval)maximumValue
145
+ {
146
+ id value = [options isKindOfClass:[NSDictionary class]] ? options[key] : nil;
147
+ if (![value isKindOfClass:[NSNumber class]]) {
148
+ return defaultValue;
149
+ }
150
+
151
+ double number = [(NSNumber *)value doubleValue];
152
+ if (!isfinite(number)) {
153
+ return defaultValue;
154
+ }
155
+
156
+ return MIN(MAX(number, minimumValue), maximumValue);
157
+ }
158
+
159
+ - (void)beginLocationAcquisition
160
+ {
161
+ if (!self.requestInProgress || self.locationAcquisitionStarted) {
162
+ return;
163
+ }
164
+
165
+ self.locationAcquisitionStarted = YES;
166
+
167
+ CLLocation *cachedLocation = self.locationManager.location;
168
+ if ([self isValidLocation:cachedLocation] && [self isCacheFresh:cachedLocation]) {
169
+ [self finishWithLocation:cachedLocation];
170
+ return;
171
+ }
172
+
173
+ if (@available(iOS 14.0, *)) {
174
+ self.locationManager.desiredAccuracy =
175
+ self.locationManager.accuracyAuthorization == CLAccuracyAuthorizationReducedAccuracy
176
+ ? kCLLocationAccuracyReduced
177
+ : kCLLocationAccuracyBest;
178
+ } else {
179
+ self.locationManager.desiredAccuracy = kCLLocationAccuracyBest;
180
+ }
181
+
182
+ self.locationTimeoutTimer = [NSTimer scheduledTimerWithTimeInterval:self.timeoutMs / 1000.0
183
+ target:self
184
+ selector:@selector(locationRequestTimedOut)
185
+ userInfo:nil
186
+ repeats:NO];
187
+ [self.locationManager requestLocation];
188
+ }
189
+
190
+ - (BOOL)isValidLocation:(CLLocation *)location
191
+ {
192
+ if (location == nil || location.timestamp == nil) {
193
+ return NO;
194
+ }
195
+
196
+ CLLocationCoordinate2D coordinate = location.coordinate;
197
+ return CLLocationCoordinate2DIsValid(coordinate) &&
198
+ isfinite(coordinate.latitude) &&
199
+ isfinite(coordinate.longitude) &&
200
+ isfinite(location.horizontalAccuracy) &&
201
+ location.horizontalAccuracy >= 0.0 &&
202
+ isfinite(location.timestamp.timeIntervalSince1970) &&
203
+ location.timestamp.timeIntervalSince1970 > 0.0;
204
+ }
205
+
206
+ - (BOOL)isCacheFresh:(CLLocation *)location
207
+ {
208
+ NSTimeInterval ageMs = [[NSDate date] timeIntervalSinceDate:location.timestamp] * 1000.0;
209
+ return ageMs >= -5000.0 && ageMs <= self.maximumAgeMs;
210
+ }
211
+
212
+ - (NSString *)currentPrecision
213
+ {
214
+ if (@available(iOS 14.0, *)) {
215
+ return self.locationManager.accuracyAuthorization == CLAccuracyAuthorizationReducedAccuracy
216
+ ? @"approximate"
217
+ : @"precise";
218
+ }
219
+
220
+ return @"precise";
221
+ }
222
+
223
+ - (void)locationRequestTimedOut
224
+ {
225
+ [self finishWithErrorCode:VisitLocationErrorTimeout
226
+ message:@"Timed out while waiting for the current location"
227
+ error:nil];
228
+ }
229
+
230
+ - (void)finishWithLocation:(CLLocation *)location
231
+ {
232
+ if (!self.requestInProgress) {
233
+ return;
234
+ }
235
+
236
+ NSDictionary *payload = @{
237
+ @"latitude": @(location.coordinate.latitude),
238
+ @"longitude": @(location.coordinate.longitude),
239
+ @"accuracy": @(location.horizontalAccuracy),
240
+ @"timestamp": @(location.timestamp.timeIntervalSince1970 * 1000.0),
241
+ @"precision": [self currentPrecision],
242
+ @"source": @"ios-core-location",
243
+ };
244
+ NSArray *resolvers = [self.pendingResolvers copy];
245
+ [self resetRequestState];
246
+
247
+ for (RCTPromiseResolveBlock resolve in resolvers) {
248
+ resolve(payload);
249
+ }
250
+ }
251
+
252
+ - (void)finishWithErrorCode:(NSString *)code
253
+ message:(NSString *)message
254
+ error:(NSError *)error
255
+ {
256
+ if (!self.requestInProgress) {
257
+ return;
258
+ }
259
+
260
+ NSArray *rejecters = [self.pendingRejecters copy];
261
+ [self resetRequestState];
262
+
263
+ for (RCTPromiseRejectBlock reject in rejecters) {
264
+ reject(code, message, error);
265
+ }
266
+ }
267
+
268
+ - (void)resetRequestState
269
+ {
270
+ [self.locationTimeoutTimer invalidate];
271
+ self.locationTimeoutTimer = nil;
272
+ [self.locationManager stopUpdatingLocation];
273
+ [self.pendingResolvers removeAllObjects];
274
+ [self.pendingRejecters removeAllObjects];
275
+ self.requestInProgress = NO;
276
+ self.locationAcquisitionStarted = NO;
277
+ }
278
+
279
+ - (void)handleAuthorizationStatus:(CLAuthorizationStatus)status
280
+ {
281
+ if (!self.requestInProgress) {
282
+ return;
283
+ }
284
+
285
+ switch (status) {
286
+ case kCLAuthorizationStatusAuthorizedAlways:
287
+ case kCLAuthorizationStatusAuthorizedWhenInUse:
288
+ [self beginLocationAcquisition];
289
+ break;
290
+ case kCLAuthorizationStatusDenied:
291
+ [self finishWithErrorCode:VisitLocationErrorPermissionDenied
292
+ message:@"Location permission was denied"
293
+ error:nil];
294
+ break;
295
+ case kCLAuthorizationStatusRestricted:
296
+ [self finishWithErrorCode:VisitLocationErrorPermissionRestricted
297
+ message:@"Location permission is restricted on this device"
298
+ error:nil];
299
+ break;
300
+ case kCLAuthorizationStatusNotDetermined:
301
+ break;
302
+ }
303
+ }
304
+
305
+ - (void)locationManagerDidChangeAuthorization:(CLLocationManager *)manager
306
+ {
307
+ if (@available(iOS 14.0, *)) {
308
+ [self handleAuthorizationStatus:manager.authorizationStatus];
309
+ }
310
+ }
311
+
312
+ - (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status
313
+ {
314
+ if (@available(iOS 14.0, *)) {
315
+ return;
316
+ }
317
+
318
+ [self handleAuthorizationStatus:status];
319
+ }
320
+
321
+ - (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray<CLLocation *> *)locations
322
+ {
323
+ CLLocation *validLocation = nil;
324
+ for (CLLocation *location in [locations reverseObjectEnumerator]) {
325
+ if ([self isValidLocation:location]) {
326
+ validLocation = location;
327
+ break;
328
+ }
329
+ }
330
+
331
+ if (validLocation == nil) {
332
+ [self finishWithErrorCode:VisitLocationErrorUnavailable
333
+ message:@"Core Location returned invalid coordinates"
334
+ error:nil];
335
+ return;
336
+ }
337
+
338
+ [self finishWithLocation:validLocation];
339
+ }
340
+
341
+ - (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
342
+ {
343
+ if (error.code == kCLErrorDenied) {
344
+ NSString *code = [CLLocationManager locationServicesEnabled]
345
+ ? VisitLocationErrorPermissionDenied
346
+ : VisitLocationErrorServicesDisabled;
347
+ [self finishWithErrorCode:code message:error.localizedDescription error:error];
348
+ return;
349
+ }
350
+
351
+ if (error.code == kCLErrorLocationUnknown) {
352
+ [self finishWithErrorCode:VisitLocationErrorUnavailable
353
+ message:error.localizedDescription
354
+ error:error];
355
+ return;
356
+ }
357
+
358
+ [self finishWithErrorCode:VisitLocationErrorRequestFailed
359
+ message:error.localizedDescription ?: @"Unable to request the current location"
360
+ error:error];
361
+ }
362
+
363
+ - (void)invalidate
364
+ {
365
+ [self.locationTimeoutTimer invalidate];
366
+ self.locationTimeoutTimer = nil;
367
+ [self.locationManager stopUpdatingLocation];
368
+ self.locationManager.delegate = nil;
369
+ [self.pendingResolvers removeAllObjects];
370
+ [self.pendingRejecters removeAllObjects];
371
+ self.requestInProgress = NO;
372
+ }
373
+
374
+ @end
@@ -0,0 +1,145 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _reactNativeEventListeners = require("react-native-event-listeners");
10
+ var _reactNativeWebview = _interopRequireDefault(require("react-native-webview"));
11
+ var _androidLocation = require("./androidLocation");
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
14
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
+ const getHttpUrl = url => {
16
+ const link = typeof url === 'string' ? url.trim() : '';
17
+ return /^https?:\/\/[^\s/?#]+(?:[/?#][^\s]*)?$/i.test(link) ? link : '';
18
+ };
19
+ const isWebViewLocalUrl = url => /^(about|data|blob):/i.test(typeof url === 'string' ? url.trim() : '');
20
+ const runBeforeFirst = `
21
+ window.isNativeApp = true;
22
+ window.platform = "ANDROID";
23
+ window.setSdkPlatform('ANDROID');
24
+ true; // note: this is required, or you'll sometimes get silent failures
25
+ `;
26
+ const SecondaryWebView = _ref => {
27
+ let {
28
+ link,
29
+ isLoggingEnabled,
30
+ onClose
31
+ } = _ref;
32
+ const webviewRef = (0, _react.useRef)(null);
33
+ const locationRequestInFlightRef = (0, _react.useRef)(false);
34
+ const [canGoBack, setCanGoBack] = (0, _react.useState)(false);
35
+ const requestLocationPermission = async locationResponseVersion => {
36
+ if (locationRequestInFlightRef.current) {
37
+ return;
38
+ }
39
+ locationRequestInFlightRef.current = true;
40
+ try {
41
+ await (0, _androidLocation.requestAndroidLocation)({
42
+ webviewRef,
43
+ locationResponseVersion,
44
+ isLoggingEnabled
45
+ });
46
+ } finally {
47
+ locationRequestInFlightRef.current = false;
48
+ }
49
+ };
50
+ const handleMessage = event => {
51
+ if (event.nativeEvent.data != null) {
52
+ try {
53
+ if (isLoggingEnabled) {
54
+ console.log('Secondary WebView event received');
55
+ }
56
+ const parsedObject = JSON.parse(event.nativeEvent.data);
57
+ switch (parsedObject.method) {
58
+ case 'GET_LOCATION_PERMISSIONS':
59
+ requestLocationPermission(parsedObject.locationResponseVersion);
60
+ break;
61
+ case 'OPEN_PDF':
62
+ _reactNative.Linking.openURL(parsedObject.url);
63
+ break;
64
+ case 'OPEN_FACE_SCAN_FLOW':
65
+ _reactNativeEventListeners.EventRegister.emitEvent('visit-event', {
66
+ message: 'OPEN_FACE_SCAN_FLOW'
67
+ });
68
+ break;
69
+ case 'CLOSE_VIEW':
70
+ onClose();
71
+ break;
72
+ case 'OPEN_SECONDARY_WEB_VIEW':
73
+ break;
74
+ default:
75
+ break;
76
+ }
77
+ } catch (exception) {
78
+ console.log('Exception occured:' + exception.message);
79
+ }
80
+ }
81
+ };
82
+ const handleRequestClose = (0, _react.useCallback)(() => {
83
+ if (canGoBack && webviewRef.current) {
84
+ webviewRef.current.goBack();
85
+ return;
86
+ }
87
+ onClose();
88
+ }, [canGoBack, onClose]);
89
+ const source = getHttpUrl(link);
90
+ if (!source) {
91
+ return null;
92
+ }
93
+ return /*#__PURE__*/_react.default.createElement(_reactNative.Modal, {
94
+ animationType: "slide",
95
+ onRequestClose: handleRequestClose,
96
+ visible: true
97
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.SafeAreaView, {
98
+ style: styles.container
99
+ }, /*#__PURE__*/_react.default.createElement(_reactNativeWebview.default, {
100
+ ref: webviewRef,
101
+ source: {
102
+ uri: source,
103
+ headers: {
104
+ platform: 'ANDROID'
105
+ }
106
+ },
107
+ onShouldStartLoadWithRequest: request => {
108
+ if (request.isTopFrame === false) {
109
+ return true;
110
+ }
111
+ if (getHttpUrl(request.url) || isWebViewLocalUrl(request.url)) {
112
+ return true;
113
+ }
114
+ _reactNative.Linking.openURL(request.url).catch(error => {
115
+ if (isLoggingEnabled) {
116
+ console.warn('Linking.openURL error: ', error);
117
+ }
118
+ });
119
+ return false;
120
+ },
121
+ onMessage: handleMessage,
122
+ injectedJavaScriptBeforeContentLoaded: runBeforeFirst,
123
+ javaScriptEnabled: true,
124
+ mediaPlaybackRequiresUserAction: false,
125
+ onLoadProgress: event => setCanGoBack(event.nativeEvent.canGoBack),
126
+ onError: errorMessage => {
127
+ _reactNativeEventListeners.EventRegister.emitEvent('visit-event', {
128
+ message: 'web-view-error',
129
+ errorMessage: errorMessage
130
+ });
131
+ if (isLoggingEnabled) {
132
+ console.warn('Webview error: ', errorMessage);
133
+ }
134
+ }
135
+ })));
136
+ };
137
+ const styles = _reactNative.StyleSheet.create({
138
+ container: {
139
+ flex: 1,
140
+ backgroundColor: 'white'
141
+ }
142
+ });
143
+ var _default = SecondaryWebView;
144
+ exports.default = _default;
145
+ //# sourceMappingURL=SecondaryWebView.android.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeEventListeners","_reactNativeWebview","_interopRequireDefault","_androidLocation","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","getHttpUrl","url","link","trim","test","isWebViewLocalUrl","runBeforeFirst","SecondaryWebView","_ref","isLoggingEnabled","onClose","webviewRef","useRef","locationRequestInFlightRef","canGoBack","setCanGoBack","useState","requestLocationPermission","locationResponseVersion","current","requestAndroidLocation","handleMessage","event","nativeEvent","data","console","log","parsedObject","JSON","parse","method","Linking","openURL","EventRegister","emitEvent","message","exception","handleRequestClose","useCallback","goBack","source","createElement","Modal","animationType","onRequestClose","visible","SafeAreaView","style","styles","container","ref","uri","headers","platform","onShouldStartLoadWithRequest","request","isTopFrame","catch","error","warn","onMessage","injectedJavaScriptBeforeContentLoaded","javaScriptEnabled","mediaPlaybackRequiresUserAction","onLoadProgress","onError","errorMessage","StyleSheet","create","flex","backgroundColor","_default","exports"],"sourceRoot":"../../src","sources":["SecondaryWebView.android.js"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,0BAAA,GAAAF,OAAA;AACA,IAAAG,mBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAL,OAAA;AAA2D,SAAAI,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAX,wBAAAO,GAAA,EAAAI,WAAA,SAAAA,WAAA,IAAAJ,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAQ,KAAA,GAAAL,wBAAA,CAAAC,WAAA,OAAAI,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAT,GAAA,YAAAQ,KAAA,CAAAE,GAAA,CAAAV,GAAA,SAAAW,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAhB,GAAA,QAAAgB,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAnB,GAAA,EAAA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