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
// android/build.gradle | |
// based on: | |
// | |
// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle | |
// original location: | |
// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle | |
// | |
// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle | |
// original location: |
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
function createAPI(obj,seq_obj,obj_name){ | |
const router = Router(); | |
const keys = Object.keys(obj) | |
let pk = "DESC"; | |
for(let i = 0; i < keys.length; i++){ | |
const key = keys[i]; | |
const _current_obj = obj[key]; | |
if(_current_obj.primaryKey){ | |
pk = key; | |
} |
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
componentDidMount() { | |
firebase.analytics().setCurrentScreen("home"); | |
} |
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
renderUsernameView(){ | |
return( | |
<View style={ styles.container }> | |
<View style={ styles.textInputContainer }> | |
<TextInput | |
style={styles.textInput} | |
placeholder={'Username'} | |
onChangeText={(username) => this.setState({username})} | |
underlineColorAndroid={'transparent'} | |
value={this.state.text} |
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
render() { | |
const { userId, isReady } = this.state; | |
if(!isReady){ | |
return this.renderUsernameView(); | |
} | |
return ( | |
<GiftedChat | |
messages={this.state.messages} | |
onSend={this.onSend} | |
onPressAvatar={ (user)=> alert(user.name)} |
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
onReceivedMessage(mes){ | |
const arrMes = [{...mes.messages}]; | |
this.setState((previousState) => ({ | |
messages: GiftedChat.append(previousState.messages, arrMes), | |
})); | |
} | |
onSend(messages){ | |
const mes = messages[0]; | |
const { username } = this.state; |
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
constructor(props){ | |
this.socket = SocketIOClient('http://192.168.1.183:3000'); //Local ip'niz yada http://locahost:3000 olmalı | |
this.socket.on('messages', this.onReceivedMessage); | |
this.socket.on('userId', this.getUserId); | |
} |
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
import { NativeModules } from 'react-native' | |
var InAppUtils = require('NativeModules').InAppUtils; | |
class inApp { | |
myProductIds = [ | |
'inApp.product.id' | |
] | |
loadProdcts(){ |
NewerOlder