@situm/react-native 3.15.19-beta.0 → 3.15.20
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/README.md +187 -0
- package/android/src/main/java/com/situm/plugin/PluginHelper.java +0 -42
- package/android/src/main/java/com/situm/plugin/SitumMapper.java +0 -5
- package/android/src/main/java/com/situm/plugin/SitumPlugin.java +0 -2
- package/android/src/main/java/com/situm/plugin/SitumPluginImpl.java +7 -33
- package/ios/RNSitumReactNativePlugin.xcodeproj/project.pbxproj +0 -6
- package/ios/SitumPlugin.m +0 -47
- package/lib/commonjs/sdk/index.js +0 -13
- package/lib/commonjs/sdk/index.js.map +1 -1
- package/lib/commonjs/sdk/nativeInterface.js.map +1 -1
- package/lib/commonjs/sdk/types/index.js +0 -6
- package/lib/commonjs/sdk/types/index.js.map +1 -1
- package/lib/commonjs/wayfinding/components/MapView.js +2 -12
- package/lib/commonjs/wayfinding/components/MapView.js.map +1 -1
- package/lib/commonjs/wayfinding/utils/index.js.map +1 -1
- package/lib/commonjs/wayfinding/utils/mapper.js +0 -3
- package/lib/commonjs/wayfinding/utils/mapper.js.map +1 -1
- package/lib/module/sdk/index.js +0 -13
- package/lib/module/sdk/index.js.map +1 -1
- package/lib/module/sdk/nativeInterface.js.map +1 -1
- package/lib/module/sdk/types/index.js +0 -6
- package/lib/module/sdk/types/index.js.map +1 -1
- package/lib/module/wayfinding/components/MapView.js +2 -12
- package/lib/module/wayfinding/components/MapView.js.map +1 -1
- package/lib/module/wayfinding/utils/index.js.map +1 -1
- package/lib/module/wayfinding/utils/mapper.js +0 -3
- package/lib/module/wayfinding/utils/mapper.js.map +1 -1
- package/lib/typescript/sdk/index.d.ts +1 -9
- package/lib/typescript/sdk/index.d.ts.map +1 -1
- package/lib/typescript/sdk/nativeInterface.d.ts +2 -5
- package/lib/typescript/sdk/nativeInterface.d.ts.map +1 -1
- package/lib/typescript/sdk/types/index.d.ts +2 -25
- package/lib/typescript/sdk/types/index.d.ts.map +1 -1
- package/lib/typescript/wayfinding/components/MapView.d.ts.map +1 -1
- package/lib/typescript/wayfinding/types/index.d.ts +1 -11
- package/lib/typescript/wayfinding/types/index.d.ts.map +1 -1
- package/lib/typescript/wayfinding/utils/index.d.ts.map +1 -1
- package/lib/typescript/wayfinding/utils/mapper.d.ts +1 -2
- package/lib/typescript/wayfinding/utils/mapper.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/sdk/index.ts +0 -14
- package/src/sdk/nativeInterface.ts +1 -7
- package/src/sdk/types/index.ts +2 -26
- package/src/wayfinding/components/MapView.tsx +2 -17
- package/src/wayfinding/types/index.ts +3 -14
- package/src/wayfinding/utils/index.ts +1 -4
- package/src/wayfinding/utils/mapper.ts +3 -7
- package/android/src/main/java/com/situm/plugin/tts/TextToSpeechManager.java +0 -87
- package/ios/RNSitumReactNativePlugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/ios/RNSitumReactNativePlugin.xcodeproj/project.xcworkspace/xcuserdata/situm.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/RNSitumReactNativePlugin.xcodeproj/xcuserdata/situm.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
- package/ios/SitumTextToSpeechSpeaker.h +0 -27
- package/ios/SitumTextToSpeechSpeaker.m +0 -82
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// SITTextToSpeechManager.m
|
|
3
|
-
// SitumSDK
|
|
4
|
-
//
|
|
5
|
-
// Created by Cristian on 26/8/25.
|
|
6
|
-
// Copyright © 2025 Situm. All rights reserved.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
#import <AVFoundation/AVFoundation.h>
|
|
10
|
-
|
|
11
|
-
#import "SitumTextToSpeechSpeaker.h"
|
|
12
|
-
|
|
13
|
-
@interface SitumTextToSpeechSpeaker () <AVSpeechSynthesizerDelegate>
|
|
14
|
-
@property (nonatomic, strong) AVSpeechSynthesizer *synthesizer;
|
|
15
|
-
@property (nonatomic) bool canSpeak;
|
|
16
|
-
@end
|
|
17
|
-
|
|
18
|
-
@implementation SitumTextToSpeechSpeaker
|
|
19
|
-
|
|
20
|
-
- (instancetype)init {
|
|
21
|
-
self = [super init];
|
|
22
|
-
if (self) {
|
|
23
|
-
self.synthesizer = [AVSpeechSynthesizer new];
|
|
24
|
-
self.synthesizer.delegate = self;
|
|
25
|
-
}
|
|
26
|
-
return self;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
- (void)speakWithPayload:(NSDictionary<id,id> *)payload {
|
|
30
|
-
|
|
31
|
-
if (![payload isKindOfClass:[NSDictionary class]]) return;
|
|
32
|
-
|
|
33
|
-
NSString *text = payload[@"text"];
|
|
34
|
-
NSString *lang = payload[@"lang"];
|
|
35
|
-
NSNumber *pitchNum = payload[@"pitch"];
|
|
36
|
-
NSNumber *rateNum = payload[@"rate"];
|
|
37
|
-
|
|
38
|
-
if (![text isKindOfClass:[NSString class]] ||
|
|
39
|
-
![lang isKindOfClass:[NSString class]] ||
|
|
40
|
-
![pitchNum isKindOfClass:[NSNumber class]] ||
|
|
41
|
-
![rateNum isKindOfClass:[NSNumber class]]) {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
float pitch = pitchNum.floatValue;
|
|
46
|
-
float rate = rateNum.floatValue;
|
|
47
|
-
|
|
48
|
-
[self speakText:text language:lang rate:rate pitch:pitch];
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
- (void)speakText:(NSString *)text language:(NSString *)language rate:(float)rate pitch:(float)pitch {
|
|
52
|
-
if (text.length == 0) return;
|
|
53
|
-
|
|
54
|
-
AVSpeechUtterance *utt = [[AVSpeechUtterance alloc] initWithString:text];
|
|
55
|
-
utt.rate = rate;
|
|
56
|
-
utt.pitchMultiplier = pitch;
|
|
57
|
-
|
|
58
|
-
AVSpeechSynthesisVoice *voice = [AVSpeechSynthesisVoice voiceWithLanguage:language];
|
|
59
|
-
if (voice) {
|
|
60
|
-
utt.voice = voice;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
dispatch_async(dispatch_get_main_queue(), ^{
|
|
64
|
-
if ([self.synthesizer isSpeaking]) {
|
|
65
|
-
[self.synthesizer stopSpeakingAtBoundary:AVSpeechBoundaryImmediate];
|
|
66
|
-
}
|
|
67
|
-
if (self.canSpeak) {
|
|
68
|
-
[self.synthesizer speakUtterance:utt];
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
- (void)setCanSpeak:(bool) value {
|
|
74
|
-
_canSpeak = value;
|
|
75
|
-
if (!_canSpeak) {
|
|
76
|
-
dispatch_async(dispatch_get_main_queue(), ^{
|
|
77
|
-
[self.synthesizer stopSpeakingAtBoundary:AVSpeechBoundaryImmediate];
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
@end
|