Skip to content

Commit 7fe72e4

Browse files
committed
fix: delete region change
1 parent 113bbc7 commit 7fe72e4

File tree

5 files changed

+13
-56
lines changed

5 files changed

+13
-56
lines changed

README.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,6 @@ MyTracker.forcingPeriod(30);
5252
// 1 or 2 = true - track the user's location
5353
MyTracker.trackLocation(0);
5454

55-
//for IOS:
56-
// 0 = MRRegionNotSet — default value
57-
// 1 = MRRegionRu — server located on the territory of the Russian Federation
58-
// 2 = MRRegionEu — server located in Europe
59-
// for Android:
60-
// 0 - default value
61-
// 1 = Region.RU — server located on the territory of the Russian Federation
62-
// 2 = Region.EU — server located in Europe
63-
MyTracker.region(0);
64-
6555
MyTracker.setDebugMode(false);
6656

6757
//MyTracker Events

android/src/main/java/com/mytracker/MytrackerModule.kt

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,22 @@ class MytrackerModule(reactContext: ReactApplicationContext) :
2828
}
2929

3030
@ReactMethod
31-
fun initTracker(SDK_KEY: String?) {
31+
fun initTracker(SDK_KEY: String) {
3232
MyTracker.initTracker(SDK_KEY, application)
3333
}
3434

3535
@ReactMethod
36-
fun trackEvent(name: String?) {
36+
fun trackEvent(name: String) {
3737
MyTracker.trackEvent(name)
3838
}
3939

4040
@ReactMethod
41-
fun trackLoginEvent(userId: String?, vkConnectId: String?) {
41+
fun trackLoginEvent(userId: String, vkConnectId: String?) {
4242
MyTracker.trackLoginEvent(userId, vkConnectId)
4343
}
4444

4545
@ReactMethod
46-
fun trackLoginEventWithParams(userId: String?, vkConnectId: String?, attributes: ReadableMap) {
46+
fun trackLoginEventWithParams(userId: String, vkConnectId: String?, attributes: ReadableMap) {
4747
val map: Map<String, Any> = attributes.toHashMap()
4848
val params: MutableMap<String, String> = HashMap()
4949
for ((key, value) in map) {
@@ -55,7 +55,7 @@ class MytrackerModule(reactContext: ReactApplicationContext) :
5555
}
5656

5757
@ReactMethod
58-
fun trackEventWithParams(name: String?, attributes: ReadableMap) {
58+
fun trackEventWithParams(name: String, attributes: ReadableMap) {
5959
val map: Map<String, Any> = attributes.toHashMap()
6060
val params: MutableMap<String, String> = HashMap()
6161
for ((key, value) in map) {
@@ -95,13 +95,13 @@ class MytrackerModule(reactContext: ReactApplicationContext) :
9595
}
9696

9797
@ReactMethod
98-
fun trackRegistrationEvent(userId: String?, vkConnectId: String?) {
98+
fun trackRegistrationEvent(userId: String, vkConnectId: String?) {
9999
MyTracker.trackRegistrationEvent(userId, vkConnectId)
100100
}
101101

102102
@ReactMethod
103103
fun trackRegistrationEventWithParams(
104-
userId: String?,
104+
userId: String,
105105
vkConnectId: String?,
106106
attributes: ReadableMap
107107
) {
@@ -178,17 +178,6 @@ class MytrackerModule(reactContext: ReactApplicationContext) :
178178
}
179179
}
180180

181-
@ReactMethod
182-
fun region(number: Int) {
183-
val trackerConfig = MyTracker.getTrackerConfig()
184-
if (number == 1) {
185-
trackerConfig.setRegion(MyTrackerConfig.Region.RU)
186-
}
187-
if (number == 2) {
188-
trackerConfig.setRegion(MyTrackerConfig.Region.EU)
189-
}
190-
}
191-
192181
@ReactMethod
193182
fun setDebugMode(enable: Boolean) {
194183
MyTracker.setDebugMode(enable)

example/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ PODS:
303303
- React-jsinspector (0.70.5)
304304
- React-logger (0.70.5):
305305
- glog
306-
- react-native-mytracker (0.11.1):
306+
- react-native-mytracker (0.14.0):
307307
- myTrackerSDK (= 3.2.0)
308308
- React-Core
309309
- React-perflogger (0.70.5)
@@ -566,7 +566,7 @@ SPEC CHECKSUMS:
566566
React-jsiexecutor: 31564fa6912459921568e8b0e49024285a4d584b
567567
React-jsinspector: badd81696361249893a80477983e697aab3c1a34
568568
React-logger: fdda34dd285bdb0232e059b19d9606fa0ec3bb9c
569-
react-native-mytracker: 80d7e7c0c052f273313871c89081c04b04beb721
569+
react-native-mytracker: a86df2aeb6c2f383a317e72debdc11ca96d33940
570570
React-perflogger: e68d3795cf5d247a0379735cbac7309adf2fb931
571571
React-RCTActionSheet: 05452c3b281edb27850253db13ecd4c5a65bc247
572572
React-RCTAnimation: 578eebac706428e68466118e84aeacf3a282b4da

ios/Mytracker.mm

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -121,20 +121,6 @@ @implementation Mytracker
121121
}
122122
}
123123

124-
RCT_EXPORT_METHOD(region:(double)number)
125-
{
126-
MRMyTrackerConfig *trackerConfig = [MRMyTracker trackerConfig];
127-
if(number == 0) {
128-
trackerConfig.region = MRRegionNotSet;
129-
}
130-
if (number == 1) {
131-
trackerConfig.region = MRRegionRu;
132-
}
133-
if (number == 2) {
134-
trackerConfig.region = MRRegionEu;
135-
}
136-
}
137-
138124
RCT_EXPORT_METHOD(setDebugMode:(BOOL *)enable)
139125
{
140126
[MRMyTracker setDebugMode:enable];
@@ -144,13 +130,13 @@ @implementation Mytracker
144130

145131
RCT_EXPORT_METHOD(getInstanceId: (RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
146132
{
147-
133+
148134
NSString *instanceId = [MRMyTracker instanceId];
149-
135+
150136
resolve(instanceId);
151137
}
152-
153-
138+
139+
154140

155141
// Don't compile this code when we build for the old architecture.
156142
#ifdef RCT_NEW_ARCH_ENABLED

src/index.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,6 @@ If your application requests access to the device's location, you can enable thi
104104
* 1 or 2 - track the user's location;
105105
*/
106106
trackLocation(number: 0 | 1 | 2): void;
107-
/**
108-
* The region where the statistics collection server is located. The need to change the region may arise, for example, due to legal requirements. Available values:
109-
* @default 0
110-
* 0 — region not set(default value)
111-
* 1 — server located on the territory of the Russian Federation
112-
* 2 — server located in Europe
113-
*/
114-
region(region: 0 | 1 | 2): void;
115107
/**
116108
* Enables/disables debug mode. The default is false.
117109
* @default 0

0 commit comments

Comments
 (0)