-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathApp.js
More file actions
23 lines (21 loc) · 760 Bytes
/
App.js
File metadata and controls
23 lines (21 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import React, { Component } from "react";
import { Platform, View, Text, NativeModules, TouchableOpacity } from "react-native";
const HelloWorld = NativeModules.HelloWorldModule;
export default class App extends Component{
render(){
return(
<View style={{flex:1, alignItems: "center", justifyContent:'center'}}>
<TouchableOpacity onPress={()=>{
if(Platform.OS == "android"){
NativeModules.HelloWorldModule.ShowMessage("This is first time we are creating bridge. :)", 5000);
}
else if(Platform.OS == "ios"){
NativeModules.HelloWorld.ShowMessage("Awesome!its working!", 0.5);
}
}}>
<Text>Click Me!</Text>
</TouchableOpacity>
</View>
)
}
}