代码拉取完成,页面将自动刷新
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
import React, {
AppRegistry,
Component,
StyleSheet,
Text,
View,
Image,
NativeModules,
TouchableHighlight
} from 'react-native';
var shareRN = NativeModules.shareSDKForRN;
var umengRN = NativeModules.umengForRN;
class AwesomeProject extends Component {
shareForTittle(){
shareRN. shareForTittle('Birthday Party', 'Birthday Party');
}
shareToQQForTittleACT(){
shareRN.shareToQQForTittle('Birthday Party', 'Birthday Party');
}
shareToQzoneForTittleACT(){
shareRN.shareToQzoneForTittle('Birthday Party', 'Birthday Party');
}
shareToWechatSessionForTittleACT(){
shareRN.shareToWechatSessionForTittle('Birthday Party', 'Birthday Party');
}
shareToWechatTimelineForTittleACT(){
shareRN.shareToWechatTimelineForTittle('Birthday Party', 'Birthday Party');
}
loginByWechatACT(){
shareRN.loginByWechat();
}
loginByQQACT(){
shareRN.loginByQQ();
}
logoutByQQACT(){
shareRN. logoutByQQ();
}
logoutByWechatACT(){
shareRN. logoutByWechat();
}
umengBegin(){
umengRN. umengBegin();
}
umengEnd(){
umengRN. umengEnd();
}
render() {
return (
<View style={styles.container}>
<TouchableHighlight activeOpacity={0.7} underlayColor="#ccc" onPress={()=>{
this. umengBegin();}}>
<Text style={{width: 320, height: 40}}> 友盟begin </Text>
</TouchableHighlight>
<TouchableHighlight activeOpacity={0.7} underlayColor="#ccc" onPress={()=>{
this. umengEnd();}}>
<Text style={{width: 320, height: 40}}> 友盟end </Text>
</TouchableHighlight>
<TouchableHighlight activeOpacity={0.7} underlayColor="#ccc" onPress={()=>{
this. shareForTittle();}}>
<Text style={{width: 320, height: 40}}> 原生UI </Text>
</TouchableHighlight>
<TouchableHighlight activeOpacity={0.7} underlayColor="#ccc" onPress={()=>{
this. shareToQQForTittleACT();}}>
<Text style={{width: 320, height: 40}}> QQ好友分享 </Text>
</TouchableHighlight>
<TouchableHighlight activeOpacity={0.7} underlayColor="#ccc" onPress={()=>{
this.shareToQzoneForTittleACT();}}>
<Text style={{width: 320, height: 40}}> Qzone分享 </Text>
</TouchableHighlight>
<TouchableHighlight activeOpacity={0.7} underlayColor="#ccc" onPress={()=>{
this. shareToWechatSessionForTittleACT();}}>
<Text style={{width: 320, height: 40}}> 微信好友分享 </Text>
</TouchableHighlight>
<TouchableHighlight activeOpacity={0.7} underlayColor="#ccc" onPress={()=>{
this.shareToWechatTimelineForTittleACT();}}>
<Text style={{width: 320, height: 40}}> 微信朋友圈分享 </Text>
</TouchableHighlight>
<TouchableHighlight activeOpacity={0.7} underlayColor="#ccc" onPress={()=>{
this. loginByWechatACT();}}>
<Text style={{width: 320, height: 40}}> 微信登录 </Text>
</TouchableHighlight>
<TouchableHighlight activeOpacity={0.7} underlayColor="#ccc" onPress={()=>{
this. logoutByWechatACT();}}>
<Text style={{width: 320, height: 40}}> 微信退出登录 </Text>
</TouchableHighlight>
<TouchableHighlight activeOpacity={0.7} underlayColor="#ccc" onPress={()=>{
this. loginByQQACT();}}>
<Text style={{width: 320, height: 40}}> QQ登录 </Text>
</TouchableHighlight>
<TouchableHighlight activeOpacity={0.7} underlayColor="#ccc" onPress={()=>{
this. logoutByQQACT();}}>
<Text style={{width: 320, height: 40}}> QQ退出登录 </Text>
</TouchableHighlight>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});
AppRegistry.registerComponent('AwesomeProject', () => AwesomeProject);
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。