react-native-steerpath-smart-map 1.29.4 → 2.0.0-alpha.1
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/.eslintrc.js +66 -0
- package/.prettierrc +7 -0
- package/CHANGELOG.md +39 -0
- package/README.md +7 -0
- package/android/bin/src/main/java/com/steerpath/rnsmartmap/RNEventKeys.class +0 -0
- package/android/bin/src/main/java/com/steerpath/rnsmartmap/RNSmartGeofenceManager.class +0 -0
- package/android/bin/src/main/java/com/steerpath/rnsmartmap/RNSmartLocationManager.class +0 -0
- package/android/bin/src/main/java/com/steerpath/rnsmartmap/RNSmartMapManager.class +0 -0
- package/android/bin/src/main/java/com/steerpath/rnsmartmap/RNSmartMapModule.class +0 -0
- package/android/bin/src/main/java/com/steerpath/rnsmartmap/RNSmartMapPackage.class +0 -0
- package/android/bin/src/main/java/com/steerpath/rnsmartmap/RNSmartMapPackage.kt +28 -0
- package/android/bin/src/main/java/com/steerpath/rnsmartmap/RNSmartMapView.class +0 -0
- package/android/bin/src/main/java/com/steerpath/rnsmartmap/RNSmartMapViewManager.class +0 -0
- package/android/bin/src/main/java/com/steerpath/rnsmartmap/Utils.class +0 -0
- package/android/build.gradle +22 -33
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/android/src/main/java/com/steerpath/rnsmartmap/RNSmartLocationManager.java +22 -14
- package/android/src/main/java/com/steerpath/rnsmartmap/RNSmartMapManager.java +9 -31
- package/android/src/main/java/com/steerpath/rnsmartmap/RNSmartMapPackage.java +11 -9
- package/android/src/main/java/com/steerpath/rnsmartmap/Utils.java +36 -36
- package/ios/RNSmartLocationManager.m +28 -3
- package/ios/RNSmartMapManager.m +10 -22
- package/lib/commonjs/SmartLocationManager.js +50 -0
- package/lib/commonjs/SmartLocationManager.js.map +1 -0
- package/lib/commonjs/SmartLocationManager.web.js +11 -0
- package/lib/commonjs/SmartLocationManager.web.js.map +1 -0
- package/lib/commonjs/SmartMapManager.js +59 -0
- package/lib/commonjs/SmartMapManager.js.map +1 -0
- package/lib/commonjs/SmartMapManager.web.js +24 -0
- package/lib/commonjs/SmartMapManager.web.js.map +1 -0
- package/lib/commonjs/index.js +28 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/module/SmartLocationManager.js +46 -0
- package/lib/module/SmartLocationManager.js.map +1 -0
- package/lib/module/SmartLocationManager.web.js +7 -0
- package/lib/module/SmartLocationManager.web.js.map +1 -0
- package/lib/module/SmartMapManager.js +54 -0
- package/lib/module/SmartMapManager.js.map +1 -0
- package/lib/module/SmartMapManager.web.js +20 -0
- package/lib/module/SmartMapManager.web.js.map +1 -0
- package/lib/module/index.js +5 -0
- package/lib/module/index.js.map +1 -0
- package/lib/typescript/SmartLocationManager.d.ts +19 -0
- package/lib/typescript/SmartLocationManager.d.ts.map +1 -0
- package/{dist → lib/typescript}/SmartLocationManager.web.d.ts +1 -0
- package/lib/typescript/SmartLocationManager.web.d.ts.map +1 -0
- package/{dist → lib/typescript}/SmartMapManager.d.ts +13 -15
- package/lib/typescript/SmartMapManager.d.ts.map +1 -0
- package/lib/typescript/SmartMapManager.web.d.ts +8 -0
- package/lib/typescript/SmartMapManager.web.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +5 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/package.json +38 -13
- package/react-native-steerpath-smart-map.podspec +15 -12
- package/src/SmartLocationManager.ts +25 -9
- package/src/SmartMapManager.ts +12 -19
- package/src/SmartMapManager.web.ts +3 -24
- package/src/index.ts +3 -4
- package/tsconfig.json +14 -9
- package/.eslintrc.json +0 -81
- package/android/src/main/java/com/steerpath/rnsmartmap/RNEventKeys.java +0 -29
- package/android/src/main/java/com/steerpath/rnsmartmap/RNSmartGeofenceManager.java +0 -103
- package/android/src/main/java/com/steerpath/rnsmartmap/RNSmartMapModule.java +0 -284
- package/android/src/main/java/com/steerpath/rnsmartmap/RNSmartMapView.java +0 -470
- package/android/src/main/java/com/steerpath/rnsmartmap/RNSmartMapViewManager.java +0 -307
- package/dist/SmartGeofenceManager.d.ts +0 -17
- package/dist/SmartGeofenceManager.js +0 -61
- package/dist/SmartGeofenceManager.web.d.ts +0 -9
- package/dist/SmartGeofenceManager.web.js +0 -10
- package/dist/SmartLocationManager.d.ts +0 -11
- package/dist/SmartLocationManager.js +0 -22
- package/dist/SmartLocationManager.web.js +0 -4
- package/dist/SmartMapEventManager.web.d.ts +0 -5
- package/dist/SmartMapEventManager.web.js +0 -10
- package/dist/SmartMapManager.js +0 -53
- package/dist/SmartMapManager.web.d.ts +0 -12
- package/dist/SmartMapManager.web.js +0 -33
- package/dist/SmartMapView.d.ts +0 -3
- package/dist/SmartMapView.js +0 -294
- package/dist/SmartMapView.web.d.ts +0 -3
- package/dist/SmartMapView.web.js +0 -270
- package/dist/SmartMapViewProps.d.ts +0 -267
- package/dist/SmartMapViewProps.js +0 -76
- package/dist/index.d.ts +0 -5
- package/dist/index.js +0 -5
- package/dist/internalUtils.d.ts +0 -1
- package/dist/internalUtils.js +0 -5
- package/ios/RCTConvert+SmartMapView.h +0 -35
- package/ios/RCTConvert+SmartMapView.m +0 -295
- package/ios/RNSmartGeofenceManager.h +0 -24
- package/ios/RNSmartGeofenceManager.m +0 -110
- package/ios/RNSmartMapUserTaskEventManager.h +0 -19
- package/ios/RNSmartMapUserTaskEventManager.m +0 -46
- package/ios/RNSmartMapView.h +0 -37
- package/ios/RNSmartMapView.m +0 -21
- package/ios/RNSmartMapViewManager.h +0 -27
- package/ios/RNSmartMapViewManager.m +0 -608
- package/package-lock.json +0 -6570
- package/src/SmartGeofenceManager.ts +0 -94
- package/src/SmartGeofenceManager.web.ts +0 -11
- package/src/SmartMapEventManager.web.ts +0 -13
- package/src/SmartMapView.tsx +0 -377
- package/src/SmartMapView.web.tsx +0 -342
- package/src/SmartMapViewProps.ts +0 -338
- package/src/internalUtils.ts +0 -5
- package/src/typings/steerpath-smart-sdk.d.ts +0 -5
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// RNSmartGeofenceManager.h
|
|
3
|
-
// SteerpathOfficeApp
|
|
4
|
-
//
|
|
5
|
-
// Created by Jarvis Luong on 26/07/2019.
|
|
6
|
-
// Copyright © 2019 Facebook. All rights reserved.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
#ifndef RNSmartGeofenceManager_h
|
|
10
|
-
#define RNSmartGeofenceManager_h
|
|
11
|
-
|
|
12
|
-
#import <React/RCTBridgeModule.h>
|
|
13
|
-
#import <React/RCTEventEmitter.h>
|
|
14
|
-
#import <React/RCTConvert.h>
|
|
15
|
-
|
|
16
|
-
#import "RCTConvert+SmartMapView.h"
|
|
17
|
-
|
|
18
|
-
@import SteerpathSmartSDK;
|
|
19
|
-
|
|
20
|
-
@interface RNSmartGeofenceManager : RCTEventEmitter <RCTBridgeModule, SPSmartGeofenceManagerDelegate>
|
|
21
|
-
|
|
22
|
-
@end
|
|
23
|
-
|
|
24
|
-
#endif /* RNSmartGeofenceManager_h */
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// RNSmartGeofenceManager.m
|
|
3
|
-
// SteerpathOfficeApp
|
|
4
|
-
//
|
|
5
|
-
// Created by Jarvis Luong on 26/07/2019.
|
|
6
|
-
// Copyright © 2019 Facebook. All rights reserved.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
#import "RNSmartGeofenceManager.h"
|
|
10
|
-
|
|
11
|
-
@implementation RNSmartGeofenceManager
|
|
12
|
-
{
|
|
13
|
-
bool hasListeners;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
RCT_EXPORT_MODULE(RNSmartGeofenceManager);
|
|
17
|
-
|
|
18
|
-
// Will be called when this module's first listener is added.
|
|
19
|
-
-(void)startObserving {
|
|
20
|
-
hasListeners = YES;
|
|
21
|
-
[[SPSmartGeofenceManager sharedInstance] addDelegate:self];
|
|
22
|
-
// Set up any upstream listeners or background tasks as necessary
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// Will be called when this module's last listener is removed, or on dealloc.
|
|
26
|
-
-(void)stopObserving {
|
|
27
|
-
hasListeners = NO;
|
|
28
|
-
[[SPSmartGeofenceManager sharedInstance] removeDelegate:self];
|
|
29
|
-
// Remove upstream listeners, stop unnecessary background tasks
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
- (NSArray<NSString *> *)supportedEvents
|
|
33
|
-
{
|
|
34
|
-
return @[@"GeofenceEntered", @"GeofenceExited", @"BeaconfenceEntered", @"BeaconfenceExited"];
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
RCT_EXPORT_METHOD(addGeofence:(nonnull NSString *) localRef
|
|
38
|
-
buildingRef:(nonnull NSString*) buildingRef
|
|
39
|
-
callback:(RCTResponseSenderBlock) callback)
|
|
40
|
-
{
|
|
41
|
-
SPSmartGeofenceManager* manager = [SPSmartGeofenceManager sharedInstance];
|
|
42
|
-
|
|
43
|
-
[manager addGeofence:localRef building:buildingRef completion:^(SPSmartGeofenceResponseType response) {
|
|
44
|
-
callback(@[[NSNull null], [RCTConvert SPSmartGeofenceResponseType:response]]);
|
|
45
|
-
}];
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
RCT_EXPORT_METHOD(removeGeofence:(nonnull NSString *) localRef
|
|
49
|
-
buildingRef:(nonnull NSString*) buildingRef)
|
|
50
|
-
{
|
|
51
|
-
SPSmartGeofenceManager* manager = [SPSmartGeofenceManager sharedInstance];
|
|
52
|
-
|
|
53
|
-
[manager removeGeofence:localRef building:buildingRef];
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
RCT_EXPORT_METHOD(addBeaconfence:(nonnull NSString *)beaconId
|
|
57
|
-
radius:(nonnull NSNumber*)radiusInMeter
|
|
58
|
-
loiteringDelay:(nonnull NSNumber*)loiteringDelayInSecond
|
|
59
|
-
callback:(RCTResponseSenderBlock) callback)
|
|
60
|
-
{
|
|
61
|
-
SPSmartGeofenceManager* manager = [SPSmartGeofenceManager sharedInstance];
|
|
62
|
-
|
|
63
|
-
[manager addBeaconfence:beaconId radius:[radiusInMeter integerValue] loiteringDelay:[loiteringDelayInSecond doubleValue] completion:^(SPSmartGeofenceResponseType response) {
|
|
64
|
-
callback(@[[NSNull null], [RCTConvert SPSmartGeofenceResponseType:response]]);
|
|
65
|
-
}];
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
RCT_EXPORT_METHOD(removeBeaconfence:(nonnull NSString *)beaconId)
|
|
69
|
-
{
|
|
70
|
-
SPSmartGeofenceManager* manager = [SPSmartGeofenceManager sharedInstance];
|
|
71
|
-
|
|
72
|
-
[manager removeBeaconfence:beaconId];
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
- (void)spSmartGeofenceManager:(SPSmartGeofenceManager *)manager
|
|
76
|
-
didEnterGeofence:(NSString *)localRef
|
|
77
|
-
building:(NSString *)buildingRef
|
|
78
|
-
{
|
|
79
|
-
if (hasListeners) { // Only send events if anyone is listening
|
|
80
|
-
[self sendEventWithName:@"GeofenceEntered" body:@{@"localRef": localRef, @"buildingRef": buildingRef}];
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
- (void)spSmartGeofenceManager:(SPSmartGeofenceManager *)manager
|
|
85
|
-
didExitGeofence:(NSString *)localRef
|
|
86
|
-
building:(NSString *)buildingRef
|
|
87
|
-
{
|
|
88
|
-
if (hasListeners) { // Only send events if anyone is listening
|
|
89
|
-
[self sendEventWithName:@"GeofenceExited" body:@{@"localRef": localRef, @"buildingRef": buildingRef}];
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
- (void)spSmartGeofenceManager:(SPSmartGeofenceManager *)manager
|
|
94
|
-
didEnterBeaconfence:(NSString *)beaconId
|
|
95
|
-
{
|
|
96
|
-
if (hasListeners) { // Only send events if anyone is listening
|
|
97
|
-
[self sendEventWithName:@"BeaconfenceEntered" body:@{@"beaconId": beaconId}];
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
- (void)spSmartGeofenceManager:(SPSmartGeofenceManager *)manager
|
|
102
|
-
didExitBeaconfence:(NSString *)beaconId
|
|
103
|
-
{
|
|
104
|
-
if (hasListeners) { // Only send events if anyone is listening
|
|
105
|
-
[self sendEventWithName:@"BeaconfenceExited" body:@{@"beaconId": beaconId}];
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
@end
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// RNSmartMapUserTaskEventManager.h
|
|
3
|
-
// Pods
|
|
4
|
-
//
|
|
5
|
-
// Created by Jarvis Luong on 18.11.2019.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
#ifndef RNSmartMapUserTaskEventManager_h
|
|
9
|
-
#define RNSmartMapUserTaskEventManager_h
|
|
10
|
-
|
|
11
|
-
@interface RNSmartMapUserTaskEventManager : NSObject <SPSmartMapUserTaskDelegate>
|
|
12
|
-
|
|
13
|
-
-(instancetype)initWithMapView:(RNSmartMapView*)mapView;
|
|
14
|
-
|
|
15
|
-
@property (nonatomic) RNSmartMapView* mapView;
|
|
16
|
-
|
|
17
|
-
@end
|
|
18
|
-
|
|
19
|
-
#endif /* RNSmartMapUserTaskEventManager_h */
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// RNSmartMapEventManager.m
|
|
3
|
-
// SteerpathSmartMapSdk
|
|
4
|
-
//
|
|
5
|
-
// Created by Jarvis Luong on 07/08/2019.
|
|
6
|
-
// Copyright © 2019 Facebook. All rights reserved.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
#import <Foundation/Foundation.h>
|
|
10
|
-
#import "RNSmartMapView.h"
|
|
11
|
-
#import "RCTConvert+SmartMapView.h"
|
|
12
|
-
|
|
13
|
-
@interface RNSmartMapUserTaskEventManager : NSObject <SPSmartMapUserTaskDelegate>
|
|
14
|
-
|
|
15
|
-
-(instancetype)initWithMapView:(RNSmartMapView*)mapView;
|
|
16
|
-
|
|
17
|
-
@property (nonatomic) RNSmartMapView* mapView;
|
|
18
|
-
|
|
19
|
-
@end
|
|
20
|
-
|
|
21
|
-
@implementation RNSmartMapUserTaskEventManager
|
|
22
|
-
@synthesize mapView = mapView;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
-(instancetype)initWithMapView:(RNSmartMapView *)mapView
|
|
26
|
-
{
|
|
27
|
-
self = [self init];
|
|
28
|
-
self.mapView = mapView;
|
|
29
|
-
return self;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
#pragma mark UserTaskEvent
|
|
33
|
-
// Put user task event delegate here
|
|
34
|
-
|
|
35
|
-
- (void)spSmartMapUserTask:(SPSmartMapUserTask *)userTask onUserTaskResponse:(SPSmartMapUserTaskResponse)response
|
|
36
|
-
{
|
|
37
|
-
if (mapView.onUserTaskResponse) {
|
|
38
|
-
mapView.onUserTaskResponse(@{
|
|
39
|
-
@"response": [RCTConvert SPSmartMapUserTaskResponse:response],
|
|
40
|
-
@"userTask": [RCTConvert convertUserTaskToJSONWith:userTask]
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
@end
|
package/ios/RNSmartMapView.h
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// RNSmartMapView.h
|
|
3
|
-
// SteerpathSmartMapSdk
|
|
4
|
-
//
|
|
5
|
-
// Created by Jarvis Luong on 07/08/2019.
|
|
6
|
-
// Copyright © 2019 Facebook. All rights reserved.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
#import <SteerpathSmartSDK/SteerpathSmartSDK.h>
|
|
10
|
-
#import <React/RCTComponent.h>
|
|
11
|
-
|
|
12
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
13
|
-
|
|
14
|
-
@interface RNSmartMapView : SPSmartMapView
|
|
15
|
-
|
|
16
|
-
@property(nonatomic, copy) RCTBubblingEventBlock onMapLoaded;
|
|
17
|
-
@property(nonatomic, copy) RCTBubblingEventBlock onMapClicked;
|
|
18
|
-
@property(nonatomic, copy) RCTBubblingEventBlock onUserFloorChanged;
|
|
19
|
-
@property(nonatomic, copy) RCTBubblingEventBlock onVisibleFloorChanged;
|
|
20
|
-
|
|
21
|
-
@property(nonatomic, copy) RCTBubblingEventBlock onViewStatusChanged;
|
|
22
|
-
@property(nonatomic, copy) RCTBubblingEventBlock onBottomSheetStateChanged;
|
|
23
|
-
|
|
24
|
-
@property(nonatomic, copy) RCTBubblingEventBlock onNavigationEnded;
|
|
25
|
-
@property(nonatomic, copy) RCTBubblingEventBlock onNavigationFailed;
|
|
26
|
-
@property(nonatomic, copy) RCTBubblingEventBlock onNavigationStarted;
|
|
27
|
-
@property(nonatomic, copy) RCTBubblingEventBlock onNavigationPreviewAppeared;
|
|
28
|
-
@property(nonatomic, copy) RCTBubblingEventBlock onNavigationDestinationReached;
|
|
29
|
-
|
|
30
|
-
@property(nonatomic, copy) RCTBubblingEventBlock onUserTaskResponse;
|
|
31
|
-
|
|
32
|
-
@property(nonatomic, copy) RCTBubblingEventBlock onSearchResultSelected;
|
|
33
|
-
@property(nonatomic, copy) RCTBubblingEventBlock onSearchCategorySelected;
|
|
34
|
-
|
|
35
|
-
@end
|
|
36
|
-
|
|
37
|
-
NS_ASSUME_NONNULL_END
|
package/ios/RNSmartMapView.m
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// RNSmartMapView.m
|
|
3
|
-
// SteerpathSmartMapSdk
|
|
4
|
-
//
|
|
5
|
-
// Created by Jarvis Luong on 07/08/2019.
|
|
6
|
-
// Copyright © 2019 Facebook. All rights reserved.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
#import "RNSmartMapView.h"
|
|
10
|
-
|
|
11
|
-
@implementation RNSmartMapView
|
|
12
|
-
|
|
13
|
-
/*
|
|
14
|
-
// Only override drawRect: if you perform custom drawing.
|
|
15
|
-
// An empty implementation adversely affects performance during animation.
|
|
16
|
-
- (void)drawRect:(CGRect)rect {
|
|
17
|
-
// Drawing code
|
|
18
|
-
}
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
@end
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// RNSmartMapViewManager.h
|
|
3
|
-
// SteerpathOfficeApp
|
|
4
|
-
//
|
|
5
|
-
// Created by Jarvis Luong on 30/07/2019.
|
|
6
|
-
// Copyright © 2019 Facebook. All rights reserved.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
#ifndef RNSmartMapViewManager_h
|
|
10
|
-
#define RNSmartMapViewManager_h
|
|
11
|
-
|
|
12
|
-
#import <React/RCTViewManager.h>
|
|
13
|
-
#import <React/RCTUIManager.h>
|
|
14
|
-
#import <React/RCTConvert.h>
|
|
15
|
-
#import <SteerpathSmartSDK/SteerpathSmartSDK.h>
|
|
16
|
-
#import <Foundation/Foundation.h>
|
|
17
|
-
|
|
18
|
-
#import "RCTConvert+SmartMapView.h"
|
|
19
|
-
#import "RNSmartMapView.h"
|
|
20
|
-
#import "RNSmartMapUserTaskEventManager.h"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
@interface RNSmartMapViewManager : RCTViewManager<SPSmartMapViewDelegate>
|
|
24
|
-
|
|
25
|
-
@end
|
|
26
|
-
|
|
27
|
-
#endif /* RNSmartMapViewManager_h */
|