1
- import { useState } from "react" ;
2
- import { Button , Modal , StyleSheet , View } from "react-native" ;
3
1
import { SafeKeyboardDetector } from "@bam.tech/react-native-app-security" ;
2
+ import { useState } from "react" ;
3
+ import { Button , Modal , Platform , StyleSheet , View } from "react-native" ;
4
4
5
5
export default function App ( ) {
6
6
const [ isModalVisible , setIsModalVisible ] = useState ( false ) ;
@@ -19,7 +19,12 @@ export default function App() {
19
19
< Button title = "fetch - valid certificates" onPress = { fetchValid } />
20
20
< Button title = "fetch - invalid certificates" onPress = { fetchInvalid } />
21
21
< Button title = "Is current keyboard safe?" onPress = { checkIsKeyboardSafe } />
22
- < Button title = "show keyboard picker" onPress = { showInputMethodPicker } />
22
+ { Platform . OS === "android" ? (
23
+ < Button
24
+ title = "show keyboard picker"
25
+ onPress = { ( ) => SafeKeyboardDetector . showInputMethodPicker ( ) }
26
+ />
27
+ ) : null }
23
28
</ View >
24
29
) ;
25
30
}
@@ -66,11 +71,3 @@ const checkIsKeyboardSafe = () => {
66
71
const isKeyboardSafe = SafeKeyboardDetector . isCurrentKeyboardSafe ( ) ;
67
72
console . warn ( "is Keyboard safe" , isKeyboardSafe ) ;
68
73
} ;
69
-
70
- const showInputMethodPicker = ( ) => {
71
- try {
72
- SafeKeyboardDetector . showInputMethodPicker ( ) ;
73
- } catch ( error ) {
74
- console . warn ( "showInputMethodPicker threw. Did you call it on iOS?" , error ) ;
75
- }
76
- } ;
0 commit comments