Sending messages :)

This commit is contained in:
Rodrigo Nascimento 2017-08-06 21:34:35 -03:00
parent f1a2290ac2
commit f836982b09
15 changed files with 486 additions and 150 deletions

View File

@ -133,6 +133,7 @@ android {
}
dependencies {
compile project(':react-native-zeroconf')
compile project(':realm')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"

View File

@ -3,6 +3,7 @@ package com.rocketchatrn;
import android.app.Application;
import com.facebook.react.ReactApplication;
import com.balthazargronon.RCTZeroconf.ZeroconfReactPackage;
import io.realm.react.RealmReactPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
@ -24,6 +25,7 @@ public class MainApplication extends Application implements ReactApplication {
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new ZeroconfReactPackage(),
new RealmReactPackage()
);
}

View File

@ -1,4 +1,6 @@
rootProject.name = 'RocketChatRN'
include ':react-native-zeroconf'
project(':react-native-zeroconf').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-zeroconf/android')
include ':realm'
project(':realm').projectDir = new File(rootProject.projectDir, '../node_modules/realm/android')

View File

@ -1,8 +1,8 @@
import React from 'react';
import PropTypes from 'prop-types';
import { View, TextInput, StyleSheet } from 'react-native';
import { View, TextInput, StyleSheet, KeyboardAvoidingView } from 'react-native';
import realm from './realm';
import { loginWithPassword } from './meteor';
import { loginWithPassword, loadSubscriptions, Accounts } from './meteor';
const styles = StyleSheet.create({
@ -14,7 +14,6 @@ const styles = StyleSheet.create({
},
input: {
height: 40,
// flex: 1,
borderColor: '#aaa',
marginLeft: 20,
marginRight: 20,
@ -38,36 +37,26 @@ export default class LoginView extends React.Component {
super(props);
this.state = {
username: 'rodrigo',
password: 'rodrigo'
username: '',
password: ''
};
const { navigate } = this.props.navigation;
this.submit = () => {
loginWithPassword({ username: this.state.username }, this.state.password, () => {
Accounts.onLogin(() => {
loadSubscriptions(() => {
navigate('Rooms');
});
});
// let url = this.state.text.trim();
// if (!url) {
// url = defaultServer;
// }
// // TODO: validate URL
// realm.write(() => {
// realm.objects('servers').filtered('current = true').forEach(item => item.current = false);
// realm.create('servers', {id: url, current: true}, true);
// });
// navigate('Login');
this.submit = () => {
loginWithPassword({ username: this.state.username }, this.state.password);
};
}
render() {
return (
<View style={styles.view}>
<KeyboardAvoidingView style={styles.view} behavior='padding'>
<TextInput
style={styles.input}
onChangeText={username => this.setState({ username })}
@ -89,43 +78,7 @@ export default class LoginView extends React.Component {
onSubmitEditing={this.submit}
placeholder='Password'
/>
</View>
</KeyboardAvoidingView>
);
}
}
// export class LoginView extends React.Component {
// renderRow(setting) {
// return (
// <Text>{setting._id}</Text>
// );
// }
// constructor(props) {
// super(props);
// connect();
// const ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});
// const getState = () => {
// return {
// dataSource: ds.cloneWithRows(realm.objects('settings'))
// };
// };
// realm.addListener('change', () => this.setState(getState()));
// this.state = getState();
// }
// render() {
// return (
// <View>
// <Text>Title</Text>
// <ListView
// dataSource={this.state.dataSource}
// renderRow={this.renderRow}
// />
// </View>
// );
// }
// }

View File

@ -1,6 +1,9 @@
import Meteor from 'react-native-meteor';
import Random from 'react-native-meteor/lib/Random';
import realm from './realm';
export { Accounts } from 'react-native-meteor';
export function connect(cb) {
const currentServer = realm.objects('servers').filtered('current = true')[0];
const url = `${ currentServer.id }/websocket`;
@ -31,11 +34,29 @@ export function connect(cb) {
cb();
});
Meteor.ddp.on("changed", ddbMessage => {
console.log('changed', ddbMessage);
if (ddbMessage.collection === 'stream-room-messages') {
setTimeout(function() {
realm.write(() => {
const message = ddbMessage.fields.args[0];
message.temp = false;
realm.create('messages', message, true);
});
}, 1000)
}
});
});
}
export function loginWithPassword(selector, password, cb) {
Meteor.loginWithPassword(selector, password, () => {
Meteor.loginWithPassword(selector, password, (err, data) => {
cb && cb();
});
}
export function loadSubscriptions(cb) {
Meteor.call('subscriptions/get', (err, data) => {
if (err) {
console.error(err);
@ -52,8 +73,8 @@ export function loginWithPassword(selector, password, cb) {
realm.create('subscriptions', subscription, true);
});
});
});
cb();
cb && cb();
});
}
@ -66,8 +87,35 @@ export function loadMessagesForRoom(rid) {
realm.write(() => {
data.messages.forEach((message) => {
message.temp = false;
realm.create('messages', message, true);
});
});
});
Meteor.subscribe('stream-room-messages', rid, false);
}
export function sendMessage(rid, msg, cb) {
const _id = Random.id();
const user = Meteor.user();
realm.write(() => {
realm.create('messages', {
_id,
rid,
msg,
ts: new Date,
_updatedAt: new Date,
temp: true,
u: {
_id: user._id,
username: user.username
}
}, true);
});
Meteor.call('sendMessage', {_id, rid, msg}, (err, data) => {
cb && cb();
});
}

View File

@ -1,22 +1,38 @@
import { StackNavigator } from 'react-navigation';
import LoginView from './login';
import NewServerView from './new-server';
import NewServerView from './servers/new';
import ListServerView from './servers/list';
import RoomsView from './rooms';
import RoomView from './room';
const navigationOptions = {
// headerStyle: {
// backgroundColor: '#c1272d'
// },
// headerTitleStyle: {
// color: '#fff'
// }
};
export default new StackNavigator({
// Room: { screen: RoomView },
Home: {
navigationOptions: {
header: null
ListServer: {
screen: ListServerView,
navigationOptions
},
screen: NewServerView
NewServer: {
screen: NewServerView,
navigationOptions
},
Login: { screen: LoginView },
Rooms: { screen: RoomsView },
Room: { screen: RoomView }
Room: {
screen: RoomView
// navigationOptions: {
// header: null
// }
}
}, {
// initialRouteName: 'Room',
cardStyle: {
backgroundColor: '#fff'
}

View File

@ -24,16 +24,16 @@ const subscriptionSchema = {
properties: {
_id: 'string',
t: 'string',
ts: 'date',
ls: 'date',
ts: { type: 'date', optional: true },
ls: { type: 'date', optional: true },
name: 'string',
fname: { type: 'string', optional: true },
rid: 'string',
// u: { _id: 'hKCY2XGzHYk89SAaM', username: 'rodrigo', name: null },
open: 'bool',
alert: 'bool',
open: { type: 'bool', optional: true },
alert: { type: 'bool', optional: true },
// roles: [ 'owner' ],
unread: 'int'
unread: { type: 'int', optional: true }
// userMentions: 0,
// groupMentions: 0,
// _updatedAt: Fri Jul 28 2017 18:31:35 GMT-0300 (-03),
@ -61,10 +61,12 @@ const messagesSchema = {
u: 'users',
// mentions: [],
// channels: [],
_updatedAt: 'date'
_updatedAt: 'date',
temp: { type: 'bool', optional: true }
}
};
// Realm.clearTestState();
const realm = new Realm({

View File

@ -1,16 +1,17 @@
import React from 'react';
import PropTypes from 'prop-types';
import { View, Text, FlatList, StyleSheet, Image } from 'react-native';
import { View, KeyboardAvoidingView, Text, TextInput, FlatList, StyleSheet, Image } from 'react-native';
// import Markdown from 'react-native-simple-markdown';
import realm from './realm';
import { loadMessagesForRoom } from './meteor';
import { loadMessagesForRoom, sendMessage } from './meteor';
const styles = StyleSheet.create({
roomItem: {
borderColor: '#aaa',
padding: 14,
flexDirection: 'row'
flexDirection: 'row',
transform: [{ scaleY: -1 }]
},
avatar: {
backgroundColor: '#ccc',
@ -23,14 +24,33 @@ const styles = StyleSheet.create({
fontWeight: 'bold',
marginBottom: 5
},
texts: {
flex: 1
},
msg: {
flex: 1
},
container: {
flex: 1
},
list: {
flex: 1,
transform: [{ scaleY: -1 }]
},
separator: {
height: 1,
// width: "86%",
backgroundColor: '#CED0CE'
// marginLeft: "14%"
},
textBox: {
paddingTop: 1,
backgroundColor: '#ccc'
},
textBoxInput: {
height: 40,
backgroundColor: '#fff',
paddingLeft: 15
}
});
@ -40,14 +60,19 @@ class RoomItem extends React.PureComponent {
}
render() {
const extraStyle = {};
if (this.props.item.temp) {
extraStyle.opacity = .3;
}
return (
<View style={styles.roomItem}>
<View style={[styles.roomItem, extraStyle]}>
<Image style={styles.avatar} source={{ uri: `http://localhost:3000/avatar/${ this.props.item.u.username }` }} />
<View>
<View style={styles.texts}>
<Text onPress={this._onPress} style={styles.username}>
{this.props.item.u.username}
</Text>
<Text>
<Text style={styles.msg}>
{this.props.item.msg}
</Text>
{/* <Markdown whitelist={['link', 'url']}>
@ -73,16 +98,26 @@ export default class RoomView extends React.Component {
this.rid = realm.objectForPrimaryKey('subscriptions', props.navigation.state.params.sid).rid;
// this.rid = 'GENERAL';
this.state = this.getState();
loadMessagesForRoom(this.rid);
const getState = () => ({
selected: new Map(),
dataSource: realm.objects('messages').filtered('rid = $0', this.rid)
this.state = this.getState();
}
getState = () => ({
...this.state,
dataSource: realm.objects('messages').filtered('rid = $0', this.rid).sorted('ts', true)
});
realm.addListener('change', () => this.setState(getState()));
updateState = () => (this.setState(this.getState()))
this.state = getState();
componentDidMount() {
realm.addListener('change', this.updateState);
}
componentWillUnmount() {
realm.removeListener('change', this.updateState);
}
renderItem = ({ item }) => (
@ -96,17 +131,44 @@ export default class RoomView extends React.Component {
<View style={styles.separator} />
);
submit = () => {
console.log(this.state.text);
if (this.state.text.trim() === '') {
return;
}
sendMessage(this.rid, this.state.text);
this.setState({
...this.state,
text: ''
});
}
render() {
return (
<View style={styles.container}>
<KeyboardAvoidingView style={styles.container} behavior='padding' keyboardVerticalOffset={64}>
<FlatList
ref={ref => this.listView = ref}
style={styles.list}
data={this.state.dataSource}
extraData={this.state}
renderItem={this.renderItem}
keyExtractor={item => item._id}
ItemSeparatorComponent={this.renderSeparator}
/>
<View style={styles.textBox}>
<TextInput
style={styles.textBoxInput}
value={this.state.text}
onChangeText={text => this.setState({ text })}
returnKeyType='send'
onSubmitEditing={this.submit}
autoFocus
placeholder='New message'
></TextInput>
</View>
</KeyboardAvoidingView>
);
}
}

View File

@ -50,7 +50,7 @@ export default class RoomsView extends React.Component {
const getState = () => ({
selected: new Map(),
dataSource: realm.objects('subscriptions')
dataSource: realm.objects('subscriptions').sorted('name')
});
realm.addListener('change', () => this.setState(getState()));

170
app/servers/list.js Normal file
View File

@ -0,0 +1,170 @@
import React from 'react';
import PropTypes from 'prop-types';
import Zeroconf from 'react-native-zeroconf';
import { H1, View, TouchableOpacity, Text, TextInput, SectionList, Button, StyleSheet } from 'react-native';
import realm from '../realm';
import { connect } from '../meteor';
const styles = StyleSheet.create({
view: {
flex: 1,
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'stretch'
},
input: {
height: 40,
borderColor: '#aaa',
margin: 20,
padding: 5,
borderWidth: 0,
backgroundColor: '#f8f8f8'
},
text: {
textAlign: 'center',
color: '#888'
},
listItem: {
lineHeight: 18,
borderTopWidth: 2,
color: '#666',
padding: 14
},
container: {
flex: 1
},
separator: {
height: 1,
backgroundColor: '#eee'
},
headerStyle: {
backgroundColor: '#eee',
lineHeight: 24,
paddingLeft: 14,
color: '#888'
}
});
const zeroconf = new Zeroconf();
export default class ListServerView extends React.Component {
static propTypes = {
navigation: PropTypes.object.isRequired
}
static navigationOptions = ({navigation}) => ({
title: 'Servers',
headerRight: (
<Button
title = "Add"
onPress = {() => navigation.navigate('NewServer')}
/>
)
});
constructor(props) {
super(props);
this.state = {
sections: []
};
}
componentDidMount() {
const getState = () => {
const sections = [{
title: 'My servers',
data: realm.objects('servers')
}];
if (this.state.nearBy) {
const nearBy = Object.keys(this.state.nearBy).filter(key => this.state.nearBy[key].addresses);
if (nearBy.length) {
sections.push({
title: 'Nearby',
data: nearBy.map((key) => {
const server = this.state.nearBy[key];
const address = `http://${ server.addresses[0] }:${ server.port }`
return {
id: address
}
})
});
}
}
return {
...this.state,
sections
};
};
const { navigation } = this.props;
if (navigation && navigation.state.params && navigation.state.params.newServer) {
return navigation.navigate('Login');
}
const currentServer = realm.objects('servers').filtered('current = true')[0];
if (currentServer) {
connect(() => {
navigation.navigate('Login')
});
}
zeroconf.on('update', () => {
this.state.nearBy = zeroconf.getServices();
this.setState(getState());
});
zeroconf.scan('http', 'tcp', 'local.');
realm.addListener('change', () => this.setState(getState()));
this.state = getState();
}
onPressItem(item) {
const { navigate } = this.props.navigation;
realm.write(() => {
realm.objects('servers').filtered('current = true').forEach(item => (item.current = false));
realm.create('servers', { id: item.id, current: true }, true);
});
connect(() => {
navigate('Login');
});
}
renderItem = ({ item }) => (
<Text
style={styles.listItem}
onPress={() => {this.onPressItem(item)}}
>
{item.id}
</Text>
);
renderSectionHeader = ({ section }) => (
<Text style={styles.headerStyle}>{section.title}</Text>
);
renderSeparator = () => (
<View style={styles.separator} />
);
render() {
return (
<View style={styles.view}>
<SectionList
style={styles.list}
sections={this.state.sections}
renderItem={this.renderItem}
renderSectionHeader={this.renderSectionHeader}
keyExtractor={(item) => item.id}
ItemSeparatorComponent={this.renderSeparator}
/>
</View>
);
}
}

View File

@ -1,37 +1,48 @@
import React from 'react';
import PropTypes from 'prop-types';
import { View, TextInput, StyleSheet } from 'react-native';
import realm from './realm';
import { connect } from './meteor';
import Zeroconf from 'react-native-zeroconf';
import { View, Text, TextInput, Button, StyleSheet, KeyboardAvoidingView } from 'react-native';
import { NavigationActions } from 'react-navigation'
import realm from '../realm';
import { connect } from '../meteor';
const styles = StyleSheet.create({
view: {
flex: 1,
flexDirection: 'row',
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center'
alignItems: 'stretch'
},
input: {
height: 40,
flex: 1,
borderColor: '#aaa',
margin: 20,
padding: 5,
borderWidth: 0,
backgroundColor: '#f8f8f8'
},
text: {
textAlign: 'center',
color: '#888'
}
});
const defaultServer = 'http://localhost:3000';
const zeroconf = new Zeroconf();
export default class NewServerView extends React.Component {
static propTypes = {
navigation: PropTypes.object.isRequired
}
static navigationOptions = ({navigation}) => ({
title: 'New Server Connection'
});
constructor(props) {
super(props);
this.state = {
defaultServer: 'https://demo.rocket.chat',
text: ''
};
@ -40,10 +51,17 @@ export default class NewServerView extends React.Component {
this.submit = () => {
let url = this.state.text.trim();
if (!url) {
url = defaultServer;
url = this.state.defaultServer;
}
// TODO: validate URL
if (url.indexOf('.') === -1) {
url = `https://${ url }.rocket.chat`;
}
if (/^https?:\/\//.test(url) === false) {
url = `https://${ url }`;
}
realm.write(() => {
realm.objects('servers').filtered('current = true').forEach(item => (item.current = false));
@ -51,15 +69,14 @@ export default class NewServerView extends React.Component {
});
connect(() => {
console.log('Site_Name', realm.objectForPrimaryKey('settings', 'Site_Name'));
navigate('Login');
navigate('ListServer', {newServer: url});
});
};
}
render() {
return (
<View style={styles.view}>
<KeyboardAvoidingView style={styles.view} behavior='padding'>
<TextInput
style={styles.input}
onChangeText={text => this.setState({ text })}
@ -69,10 +86,9 @@ export default class NewServerView extends React.Component {
autoCapitalize='none'
autoFocus
onSubmitEditing={this.submit}
placeholder={defaultServer}
placeholder={this.state.defaultServer}
/>
</View>
</KeyboardAvoidingView>
);
}
}

View File

@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
@ -22,6 +22,19 @@
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
@ -36,19 +49,5 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
<key>NSAppTransportSecurity</key>
<!--See http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/ -->
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
</dict>
</plist>

View File

@ -36,6 +36,7 @@
2D02E4C81E0B4AEC006451C7 /* libRCTWebSocket-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */; };
2D02E4C91E0B4AEC006451C7 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3EA31DF850E9000B6D8A /* libReact.a */; };
2DCD954D1E0B4F2C00145EB5 /* RocketChatRNTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* RocketChatRNTests.m */; };
33647F7997A2493E9E1343B3 /* libRNZeroconf.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BAAE4B947F5D44959F0A9D5A /* libRNZeroconf.a */; };
5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; };
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
EF736EF520A64AE8820E684A /* libRealmReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DF26CC845883492D8AC8869B /* libRealmReact.a */; };
@ -217,6 +218,13 @@
remoteGlobalIDString = 2D2A28201D9B03D100D4039D;
remoteInfo = "RCTAnimation-tvOS";
};
607C68951F36522C0096975F /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 41FE03CD3B554249859F01BA /* RNZeroconf.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 0DE485BD1BDD49E400020698;
remoteInfo = RNZeroconf;
};
607D610C1F325B7E00F639C4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
@ -291,11 +299,13 @@
146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = "<group>"; };
2D02E47B1E0B4A5D006451C7 /* RocketChatRN-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "RocketChatRN-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
2D02E4901E0B4A5D006451C7 /* RocketChatRN-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "RocketChatRN-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
41FE03CD3B554249859F01BA /* RNZeroconf.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNZeroconf.xcodeproj; path = "../node_modules/react-native-zeroconf/ios/RNZeroconf.xcodeproj"; sourceTree = "<group>"; };
5A8684E7C27E426C9206E980 /* RealmReact.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RealmReact.xcodeproj; path = "../node_modules/realm/react-native/ios/RealmReact.xcodeproj"; sourceTree = "<group>"; };
5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = "<group>"; };
78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = "<group>"; };
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = "<group>"; };
B37C79D9BD0742CE936B6982 /* libc++.tbd */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; };
BAAE4B947F5D44959F0A9D5A /* libRNZeroconf.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNZeroconf.a; sourceTree = "<group>"; };
DF26CC845883492D8AC8869B /* libRealmReact.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRealmReact.a; sourceTree = "<group>"; };
/* End PBXFileReference section */
@ -326,6 +336,7 @@
EF736EF520A64AE8820E684A /* libRealmReact.a in Frameworks */,
0C6E2DE448364EA896869ADF /* libc++.tbd in Frameworks */,
24A2AEF2383D44B586D31C01 /* libz.tbd in Frameworks */,
33647F7997A2493E9E1343B3 /* libRNZeroconf.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -473,6 +484,14 @@
name = Products;
sourceTree = "<group>";
};
607C68741F36522C0096975F /* Products */ = {
isa = PBXGroup;
children = (
607C68961F36522C0096975F /* libRNZeroconf.a */,
);
name = Products;
sourceTree = "<group>";
};
607D60ED1F325B7D00F639C4 /* Products */ = {
isa = PBXGroup;
children = (
@ -505,6 +524,7 @@
00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */,
139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,
5A8684E7C27E426C9206E980 /* RealmReact.xcodeproj */,
41FE03CD3B554249859F01BA /* RNZeroconf.xcodeproj */,
);
name = Libraries;
sourceTree = "<group>";
@ -637,14 +657,21 @@
TargetAttributes = {
00E356ED1AD99517003FC87E = {
CreatedOnToolsVersion = 6.2;
DevelopmentTeam = S6UPZG7ZR3;
TestTargetID = 13B07F861A680F5B00A75B9A;
};
13B07F861A680F5B00A75B9A = {
DevelopmentTeam = S6UPZG7ZR3;
ProvisioningStyle = Automatic;
};
2D02E47A1E0B4A5D006451C7 = {
CreatedOnToolsVersion = 8.2.1;
DevelopmentTeam = S6UPZG7ZR3;
ProvisioningStyle = Automatic;
};
2D02E48F1E0B4A5D006451C7 = {
CreatedOnToolsVersion = 8.2.1;
DevelopmentTeam = S6UPZG7ZR3;
ProvisioningStyle = Automatic;
TestTargetID = 2D02E47A1E0B4A5D006451C7;
};
@ -710,6 +737,10 @@
ProductGroup = 607D60ED1F325B7D00F639C4 /* Products */;
ProjectRef = 5A8684E7C27E426C9206E980 /* RealmReact.xcodeproj */;
},
{
ProductGroup = 607C68741F36522C0096975F /* Products */;
ProjectRef = 41FE03CD3B554249859F01BA /* RNZeroconf.xcodeproj */;
},
);
projectRoot = "";
targets = (
@ -883,6 +914,13 @@
remoteRef = 5E9157341DD0AC6500FF2AA8 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
607C68961F36522C0096975F /* libRNZeroconf.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libRNZeroconf.a;
remoteRef = 607C68951F36522C0096975F /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
607D610D1F325B7E00F639C4 /* libthird-party.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
@ -1066,6 +1104,7 @@
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
DEVELOPMENT_TEAM = S6UPZG7ZR3;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
@ -1073,6 +1112,7 @@
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/realm/src/**",
"$(SRCROOT)/../node_modules/react-native-zeroconf/ios/RNZeroconf",
);
INFOPLIST_FILE = RocketChatRNTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
@ -1080,6 +1120,7 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
OTHER_LDFLAGS = (
"-ObjC",
@ -1095,9 +1136,11 @@
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
COPY_PHASE_STRIP = NO;
DEVELOPMENT_TEAM = S6UPZG7ZR3;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/realm/src/**",
"$(SRCROOT)/../node_modules/react-native-zeroconf/ios/RNZeroconf",
);
INFOPLIST_FILE = RocketChatRNTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
@ -1105,6 +1148,7 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
OTHER_LDFLAGS = (
"-ObjC",
@ -1119,11 +1163,14 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = S6UPZG7ZR3;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/realm/src/**",
"$(SRCROOT)/../node_modules/react-native-zeroconf/ios/RNZeroconf",
);
INFOPLIST_FILE = RocketChatRN/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
@ -1132,7 +1179,10 @@
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = chat.rocket.rn;
PRODUCT_NAME = RocketChatRN;
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
@ -1141,10 +1191,13 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = S6UPZG7ZR3;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/realm/src/**",
"$(SRCROOT)/../node_modules/react-native-zeroconf/ios/RNZeroconf",
);
INFOPLIST_FILE = RocketChatRN/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
@ -1153,7 +1206,9 @@
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = chat.rocket.rn;
PRODUCT_NAME = RocketChatRN;
PROVISIONING_PROFILE_SPECIFIER = "";
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
@ -1168,23 +1223,26 @@
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = S6UPZG7ZR3;
ENABLE_TESTABILITY = YES;
GCC_NO_COMMON_BLOCKS = YES;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/realm/src/**",
"$(SRCROOT)/../node_modules/react-native-zeroconf/ios/RNZeroconf",
);
INFOPLIST_FILE = "RocketChatRN-tvOS/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
OTHER_LDFLAGS = (
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.RocketChatRN-tvOS";
PRODUCT_BUNDLE_IDENTIFIER = "chat.rocket.rn-tvOS";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
TARGETED_DEVICE_FAMILY = 3;
@ -1203,22 +1261,25 @@
CLANG_WARN_SUSPICIOUS_MOVE = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = S6UPZG7ZR3;
GCC_NO_COMMON_BLOCKS = YES;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/realm/src/**",
"$(SRCROOT)/../node_modules/react-native-zeroconf/ios/RNZeroconf",
);
INFOPLIST_FILE = "RocketChatRN-tvOS/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
OTHER_LDFLAGS = (
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.RocketChatRN-tvOS";
PRODUCT_BUNDLE_IDENTIFIER = "chat.rocket.rn-tvOS";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
TARGETED_DEVICE_FAMILY = 3;
@ -1235,6 +1296,7 @@
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = S6UPZG7ZR3;
ENABLE_TESTABILITY = YES;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "RocketChatRN-tvOSTests/Info.plist";
@ -1242,6 +1304,7 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.RocketChatRN-tvOSTests";
PRODUCT_NAME = "$(TARGET_NAME)";
@ -1261,12 +1324,14 @@
CLANG_WARN_SUSPICIOUS_MOVE = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = S6UPZG7ZR3;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "RocketChatRN-tvOSTests/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.RocketChatRN-tvOSTests";
PRODUCT_NAME = "$(TARGET_NAME)";

View File

@ -5,11 +5,11 @@
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>RocketChatRN</string>
<string>Rocket.Chat.RN</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
@ -24,6 +24,19 @@
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
@ -38,19 +51,5 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
<key>NSAppTransportSecurity</key>
<!--See http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/ -->
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
</dict>
</plist>

View File

@ -14,6 +14,7 @@
"react": "16.0.0-alpha.12",
"react-native": "0.46.1",
"react-native-meteor": "^1.1.0",
"react-native-zeroconf": "^0.7.1",
"react-navigation": "^1.0.0-beta.11",
"realm": "^1.10.1"
},