Skip to content

Instantly share code, notes, and snippets.

View ayberkanilatsiz's full-sized avatar

Ayberk ayberkanilatsiz

View GitHub Profile
@ayberkanilatsiz
ayberkanilatsiz / build.gradle
Created August 29, 2023 11:03
react-native-alarm EvalIssueException: compileSdkVersion
// 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:
@ayberkanilatsiz
ayberkanilatsiz / createSequelizeModelAPI.js
Created May 11, 2020 11:14
Create API from sequelize model
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;
}
@ayberkanilatsiz
ayberkanilatsiz / setCurrentScreen.js
Created January 16, 2020 15:07
setCurrentScreen
componentDidMount() {
firebase.analytics().setCurrentScreen("home");
}
@ayberkanilatsiz
ayberkanilatsiz / buttonAction.js
Created January 16, 2020 14:48
Event button press action
buttonPress = () => {
alert("Event Gönderildi");
firebase.analytics().logEvent("monkeys");
}
@ayberkanilatsiz
ayberkanilatsiz / App.js
Created October 11, 2017 11:12
renderUsernameView
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}
@ayberkanilatsiz
ayberkanilatsiz / App.js
Created October 11, 2017 10:59
app render func
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)}
@ayberkanilatsiz
ayberkanilatsiz / App.js
Created October 11, 2017 10:51
socket handlers
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;
@ayberkanilatsiz
ayberkanilatsiz / App.js
Last active October 12, 2017 07:03
createSocket
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);
}
@ayberkanilatsiz
ayberkanilatsiz / reactnativeWhatsappShareFunc.js
Created September 13, 2017 10:15
React Native WhatsApp Text Share
//import Linking
shareWhatsApp(text){
text = encodeURIComponent(text);
Linking.openURL('whatsapp://send?text='+text).then((resp)=>{
console.log('resp',resp)
}).catch((e)=>{
console.log('e',e)
});
}
import { NativeModules } from 'react-native'
var InAppUtils = require('NativeModules').InAppUtils;
class inApp {
myProductIds = [
'inApp.product.id'
]
loadProdcts(){