Last active
March 24, 2020 09:33
-
-
Save duytq94/0af663e92f08b3d95de77dad67371d39 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 {BackHandler, 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 { | |
BackHandler.exitApp(); | |
} | |
}, | |
}; | |
export default TestConnectNative; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment