Last active
March 28, 2020 14:01
-
-
Save duytq94/9df1a0b08d69f2c95dd258932957cc2c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// If TestConnectNative is an package from npm, you can think this is index.js file | |
import {NativeModules, Platform} from 'react-native'; | |
const testConnectNative = NativeModules.TestConnectNative; | |
const TestConnectNative = { | |
sendMessage: msg => { | |
testConnectNative.sendMessageToNative(msg); | |
}, | |
sendCallback: callback => { | |
testConnectNative.sendCallbackToNative(callback); | |
}, | |
exitRN: tag => { | |
if (Platform.OS === 'ios') { | |
testConnectNative.dismissPresentedViewController(tag); | |
} else { | |
testConnectNative.finishActivity(); | |
} | |
}, | |
}; | |
export default TestConnectNative; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment