├── .flowconfig
├── .gitignore
├── .watchmanconfig
├── Components
├── Feed.ios.js
├── Link.js
├── Story.ios.js
├── StoryDetail.ios.js
└── VideoPlaceHolder.js
├── README.md
├── XMLToReactMap.js
├── android
├── app
│ ├── build.gradle
│ ├── proguard-rules.pro
│ ├── react.gradle
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── bbcnews
│ │ │ └── MainActivity.java
│ │ └── res
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ └── values
│ │ ├── strings.xml
│ │ └── styles.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
├── index.android.js
├── index.ios.js
├── ios
├── AngularActivityIndicatorViewManager.h
├── AngularActivityIndicatorViewManager.m
├── BBCNews.xcodeproj
│ ├── project.pbxproj
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── BBCNews.xcscheme
├── BBCNews
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── Base.lproj
│ │ └── LaunchScreen.xib
│ ├── Images.xcassets
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── Info.plist
│ └── main.m
├── BBCNewsTests
│ ├── BBCNewsTests.m
│ └── Info.plist
├── PCAngularActivityIndicatorView.h
├── PCAngularActivityIndicatorView.m
└── main.jsbundle
└── package.json
/.flowconfig:
--------------------------------------------------------------------------------
1 | [ignore]
2 |
3 | # We fork some components by platform.
4 | .*/*.web.js
5 | .*/*.android.js
6 |
7 | # Some modules have their own node_modules with overlap
8 | .*/node_modules/node-haste/.*
9 |
10 | # Ugh
11 | .*/node_modules/babel.*
12 | .*/node_modules/babylon.*
13 | .*/node_modules/invariant.*
14 |
15 | # Ignore react and fbjs where there are overlaps, but don't ignore
16 | # anything that react-native relies on
17 | .*/node_modules/fbjs/lib/Map.js
18 | .*/node_modules/fbjs/lib/Promise.js
19 | .*/node_modules/fbjs/lib/fetch.js
20 | .*/node_modules/fbjs/lib/ExecutionEnvironment.js
21 | .*/node_modules/fbjs/lib/isEmpty.js
22 | .*/node_modules/fbjs/lib/crc32.js
23 | .*/node_modules/fbjs/lib/ErrorUtils.js
24 |
25 | # Flow has a built-in definition for the 'react' module which we prefer to use
26 | # over the currently-untyped source
27 | .*/node_modules/react/react.js
28 | .*/node_modules/react/lib/React.js
29 | .*/node_modules/react/lib/ReactDOM.js
30 |
31 | # Ignore commoner tests
32 | .*/node_modules/commoner/test/.*
33 |
34 | # See https://github.com/facebook/flow/issues/442
35 | .*/react-tools/node_modules/commoner/lib/reader.js
36 |
37 | # Ignore jest
38 | .*/node_modules/jest-cli/.*
39 |
40 | # Ignore Website
41 | .*/website/.*
42 |
43 | [include]
44 |
45 | [libs]
46 | node_modules/react-native/Libraries/react-native/react-native-interface.js
47 |
48 | [options]
49 | module.system=haste
50 |
51 | munge_underscores=true
52 |
53 | module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub'
54 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.png$' -> 'RelativeImageStub'
55 |
56 | suppress_type=$FlowIssue
57 | suppress_type=$FlowFixMe
58 | suppress_type=$FixMe
59 |
60 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-0]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
61 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-0]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
62 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
63 |
64 | [version]
65 | 0.20.1
66 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # OSX
2 | #
3 | .DS_Store
4 |
5 | # Xcode
6 | #
7 | build/
8 | *.pbxuser
9 | !default.pbxuser
10 | *.mode1v3
11 | !default.mode1v3
12 | *.mode2v3
13 | !default.mode2v3
14 | *.perspectivev3
15 | !default.perspectivev3
16 | xcuserdata
17 | *.xccheckout
18 | *.moved-aside
19 | DerivedData
20 | *.hmap
21 | *.ipa
22 | *.xcuserstate
23 | project.xcworkspace
24 |
25 | # Android/IJ
26 | #
27 | .idea
28 | .gradle
29 | local.properties
30 |
31 | # node.js
32 | #
33 | node_modules/
34 | npm-debug.log
35 |
--------------------------------------------------------------------------------
/.watchmanconfig:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/Components/Feed.ios.js:
--------------------------------------------------------------------------------
1 | var React = require('react-native');
2 | var {
3 | StyleSheet,
4 | View,
5 | ListView,
6 | TimerMixin,
7 | RefreshControl
8 | } = React;
9 |
10 | var Loader = require('react-native-angular-activity-indicator');
11 | var Story = require('./Story');
12 | var Feed = React.createClass({
13 |
14 |
15 | getInitialState() {
16 | return {
17 | dataSource: new ListView.DataSource({
18 | rowHasChanged: (row1, row2) => row1 !== row2,
19 | }),
20 | loaded: false,
21 | isAnimating: true,
22 | isRefreshing: false,
23 | };
24 | },
25 |
26 | componentDidMount() {
27 | this.fetchData()
28 | },
29 |
30 | filterNews(news = []) {
31 | return new Promise((res, rej) => {
32 | const filtered = news.filter( item => {
33 | return item.content.format === 'bbc.mobile.news.format.textual'
34 | })
35 | res(filtered);
36 | })
37 |
38 | },
39 |
40 | fetchData() {
41 | this.setState({isRefreshing: true});
42 |
43 | fetch(`http://trevor-producer-cdn.api.bbci.co.uk/content${this.props.collection || '/cps/news/world'}`)
44 | .then((response) => response.json())
45 | .then((responseData) => this.filterNews(responseData.relations))
46 | .then((newsItems) =>
47 | {
48 | this.setState({
49 | dataSource: this.state.dataSource.cloneWithRows(newsItems),
50 | loaded: true,
51 | isRefreshing: false,
52 | isAnimating: false
53 | })
54 |
55 |
56 | }).done();
57 | },
58 |
59 | renderLoading() {
60 | return (
61 |
62 |
63 |
64 | );
65 | },
66 |
67 | renderStories(story) {
68 | return (
69 |
70 | );
71 | },
72 |
73 | render: function() {
74 |
75 | if (!this.state.loaded) {
76 | return this.renderLoading();
77 | }
78 |
79 | return (
80 |
81 |
99 | }
100 | />
101 | )
102 | }
103 | });
104 |
105 | var styles = StyleSheet.create({
106 |
107 | loadingView: {
108 | marginTop: 30,
109 | marginRight:50,
110 | backgroundColor: '#ff00ff',
111 | },
112 |
113 | listView: {
114 | backgroundColor: '#eee'
115 | },
116 |
117 | });
118 |
119 | export default Feed;
--------------------------------------------------------------------------------
/Components/Link.js:
--------------------------------------------------------------------------------
1 | var React = require('react-native');
2 | var {
3 | AppRegistry,
4 | StyleSheet,
5 | Text,
6 | LinkingIOS
7 | } = React;
8 |
9 | var StoryDetail = require('./StoryDetail');
10 |
11 | var moment = require('moment');
12 |
13 | export default class Story extends React.Component {
14 | static propTypes = {
15 | name: React.PropTypes.string,
16 | };
17 |
18 | constructor(props) {
19 | super(props);
20 | }
21 |
22 | pressedURL() {
23 | console.log('hi', this.props.url)
24 |
25 | LinkingIOS.openURL(this.props.url)
26 | }
27 |
28 | render() {
29 |
30 | return (
31 | {this.props.children}
32 | );
33 | }
34 | }
35 |
36 | var styles = StyleSheet.create({
37 | hyperlink: {
38 | color: 'black',
39 | fontWeight: 'bold',
40 | textDecorationLine: 'underline'
41 | }
42 | });
43 |
44 | module.exports = Story;
45 |
--------------------------------------------------------------------------------
/Components/Story.ios.js:
--------------------------------------------------------------------------------
1 | var React = require('react-native');
2 | var {
3 | AppRegistry,
4 | StyleSheet,
5 | Text,
6 | View,
7 | Image,
8 | TouchableHighlight,
9 | } = React;
10 |
11 | import Feed from './Feed';
12 | var StoryDetail = require('./StoryDetail');
13 |
14 | var moment = require('moment');
15 |
16 | export default class Story extends React.Component {
17 |
18 | static propTypes = {
19 | name: React.PropTypes.string,
20 | };
21 |
22 | constructor(props) {
23 | super(props);
24 | }
25 |
26 | getCollectionForStory(story) {
27 | console.log('STORY', story)
28 | if (story.content.relations && story.content.relations.length) {
29 |
30 | return story.content.relations.find( item => {
31 | return item.primaryType === 'bbc.mobile.news.collection'
32 | })
33 |
34 | } else {
35 | throw "No collection found"
36 | }
37 | }
38 |
39 | pressedCollection(collection) {
40 | this.props.navigator.push({
41 | component: Feed,
42 | title: collection.content.name,
43 | passProps: {collection: collection.content.id, navigator: this.props.navigator}
44 | })
45 | }
46 |
47 | truncateTitle(title) {
48 | if (title.length > 15) {
49 | return `${title.substring(0, 15)}...`
50 | } else {
51 | return title;
52 | }
53 | }
54 |
55 | pressedStory(story) {
56 | this.props.navigator.push({
57 | component: StoryDetail,
58 | title: this.truncateTitle(story.content.name),
59 | passProps: {story, navigator: this.props.navigator}
60 | });
61 | }
62 |
63 | render() {
64 | var story = this.props.story;
65 | var time = moment.unix((story.content.lastUpdated / 1000 )).fromNow();
66 | var collection = this.getCollectionForStory(story) || {}
67 |
68 | console.log(collection)
69 |
70 | return (
71 | this.pressedStory(story)}>
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 | {story.content.name}
81 |
82 | {time}
83 | |
84 | this.pressedCollection(collection)} >
85 | {collection.content ? collection.content.name : ""}
86 |
87 |
88 |
89 |
90 |
91 | );
92 | }
93 | }
94 |
95 | var styles = StyleSheet.create({
96 | container: {
97 | flex: 1,
98 | marginLeft: 5,
99 | marginRight: 5,
100 | alignItems: 'center',
101 | flexDirection: 'row',
102 | backgroundColor: 'white',
103 |
104 | },
105 |
106 | textView: {
107 | flex: 1,
108 | paddingTop: 5,
109 | paddingLeft: 5,
110 | paddingRight: 5,
111 | marginLeft: 5,
112 | marginRight: 5,
113 | backgroundColor: 'white',
114 | marginBottom: 5,
115 | },
116 |
117 | details: {
118 | flex:1,
119 | justifyContent: 'flex-start',
120 | flexDirection: 'row',
121 | },
122 |
123 | headline: {
124 | flex: 0,
125 | fontWeight: 'bold',
126 | fontSize: 20,
127 | margin: 3,
128 |
129 | },
130 |
131 | timeStamp: {
132 | flex: 0,
133 | margin: 3,
134 | },
135 |
136 | collection: {
137 | flex: 0,
138 | color: '#9d0a0e',
139 | margin: 3,
140 | },
141 |
142 | border: {
143 | padding: 3,
144 | borderLeftWidth: 1,
145 | borderLeftColor: 'black',
146 | borderStyle: 'solid'
147 | },
148 |
149 | imageContainer: {
150 | flex:1,
151 | height: 200,
152 | alignItems: 'stretch'
153 | },
154 |
155 | thumbnail: {
156 | flex:1
157 | }
158 |
159 | });
160 |
161 | module.exports = Story;
162 |
--------------------------------------------------------------------------------
/Components/StoryDetail.ios.js:
--------------------------------------------------------------------------------
1 | var React = require('react-native');
2 | var {
3 | AppRegistry,
4 | StyleSheet,
5 | Text,
6 | View,
7 | Image,
8 | TouchableHighlight,
9 | ScrollView,
10 | LinkingIOS
11 | } = React;
12 |
13 | var moment = require('moment');
14 | var Link = require('./Link');
15 | var htmlparser = require('htmlparser');
16 | var XMLToReactMap = require('../XMLToReactMap');
17 |
18 | export default class StoryDetail extends React.Component {
19 |
20 | constructor(props) {
21 | super(props);
22 |
23 | this.state = {
24 | paragraph: "",
25 | loading: true,
26 | elements: null
27 | }
28 | }
29 |
30 | parseXMLBody(body,cb) {
31 | var handler = new Tautologistics.NodeHtmlParser.DefaultHandler(function (error, dom) {
32 | cb(dom)
33 | }, {enforceEmptyTags: false, ignoreWhitespace: true});
34 | var parser = new Tautologistics.NodeHtmlParser.Parser(handler);
35 | parser.parseComplete(body);
36 |
37 | }
38 |
39 |
40 | fetchStoryData(cb) {
41 | fetch(`http://trevor-producer-cdn.api.bbci.co.uk/content${this.props.story.content.id}`)
42 | .then((response) => response.json())
43 | .then((responseData) => {
44 |
45 | const images = responseData.relations.filter( item => {
46 | return item.primaryType === 'bbc.mobile.news.image';
47 | })
48 |
49 | const videos = responseData.relations.filter( item => {
50 | return item.primaryType === 'bbc.mobile.news.video';
51 | })
52 |
53 | const relations = {images, videos}
54 |
55 | this.parseXMLBody(responseData.body, (result) => {
56 |
57 | cb(result, relations)
58 | })
59 | })
60 | .done();
61 | }
62 |
63 | componentDidMount() {
64 | this.fetchStoryData((result, media) => {
65 | const rootElement = result.find(item => {
66 | return item.name === 'body'
67 | })
68 |
69 | XMLToReactMap.createReactElementsWithXMLRoot(rootElement, media).then(array => {
70 | var scroll = React.createElement(ScrollView, {contentInset:{top: 0, left: 0, bottom: 64, right: 0}, style:{flex: 1, flexDirection: 'column', backgroundColor: 'white'}, accessibilityLabel:"Story Detail"}, array)
71 |
72 | this.setState({loading: false, elements:scroll})
73 | })
74 | })
75 | }
76 |
77 | render() {
78 | if (this.state.loading) {
79 | return (
80 | Loading
81 | )
82 | }
83 | return this.state.elements
84 |
85 | }
86 | }
87 |
88 | var styles = StyleSheet.create({
89 |
90 | container: {
91 | },
92 |
93 | paragraph: {
94 | padding: 40,
95 | fontSize: 16,
96 | lineHeight: 20*1.2
97 | },
98 |
99 | headline: {
100 | position: 'absolute',
101 | bottom: 10,
102 | left: 0,
103 | paddingLeft: 30,
104 | paddingRight: 30,
105 | fontSize: 26,
106 | fontWeight: 'bold',
107 | color: 'white'
108 |
109 | },
110 |
111 | overlay: {
112 | flex:1,
113 | backgroundColor: 'transparent',
114 | height:200
115 | },
116 |
117 | thumbnail: {
118 | flex: 1,
119 | },
120 |
121 | imageContainer: {
122 | flex:1,
123 | height: 300,
124 | alignItems: 'stretch'
125 | }
126 | })
127 |
128 | module.exports = StoryDetail;
129 |
--------------------------------------------------------------------------------
/Components/VideoPlaceHolder.js:
--------------------------------------------------------------------------------
1 | var React = require('react-native');
2 | var {
3 | AppRegistry,
4 | StyleSheet,
5 | View,
6 | TouchableHighlight,
7 | Image
8 | } = React;
9 |
10 | var Video = require('react-native-video');
11 |
12 | export default class VideoPlaceHolder extends React.Component {
13 | static propTypes = {
14 | video: React.PropTypes.object.isRequired,
15 | };
16 |
17 | constructor(props) {
18 | super(props);
19 | this.state = {
20 | loadVideo: false,
21 | imageUrl: ''
22 | }
23 | }
24 |
25 | componentWillMount() {
26 | if (this.props.video.content.relations.length > 0) {
27 | const image = this.props.video.content.relations.find(video => {
28 | return video.primaryType === 'bbc.mobile.news.image';
29 | })
30 |
31 | if (image) {
32 | console.log('image tag', image);
33 | this.setState({imageUrl:image.content.href, image: image});
34 | }
35 | }
36 | }
37 |
38 | pressedPlaceholder() {
39 | this.fetchVideoInfo(this.props.video.content.externalId, (url) => {
40 | this.setState({loadVideo: true, videoUrl: url})
41 | })
42 | }
43 |
44 |
45 | fetchVideoInfo(videoId, completion) {
46 | fetch(`http://open.live.bbc.co.uk/mediaselector/5/select/version/2.0/format/json/mediaset/journalism-http-tablet/vpid/${videoId}/proto/http/transferformat/hls/`)
47 | .then((response) => response.json())
48 | .then((responseData) => {
49 | console.log(responseData)
50 | completion(responseData.media[0].connection[0].href);
51 | })
52 | .done();
53 | }
54 |
55 | render() {
56 | if (this.state.loadVideo) {
57 | return (
58 |
66 | );
67 | }
68 |
69 | return (
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 | );
79 | }
80 | }
81 |
82 | var styles = StyleSheet.create({
83 | placeholder: {
84 | flex: 1,
85 | height: 200,
86 | alignItems: 'center',
87 | justifyContent: 'center'
88 | },
89 |
90 | playButton:{
91 | width: 0,
92 | height: 0,
93 | backgroundColor: 'transparent',
94 | borderStyle: 'solid',
95 | borderLeftWidth: 25,
96 | borderRightWidth: 25,
97 | borderBottomWidth: 40,
98 | borderLeftColor: 'transparent',
99 | borderRightColor: 'transparent',
100 | borderBottomColor: 'white',
101 | transform: [ {rotate: '90deg'}],
102 | marginLeft: 10
103 | },
104 |
105 | buttonCircle: {
106 | width: 100,
107 | height: 100,
108 | borderRadius: 50,
109 | backgroundColor: '#bb1919',
110 | alignItems: 'center',
111 | justifyContent: 'center'
112 | }
113 | });
114 |
115 | module.exports = VideoPlaceHolder;
116 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Unofficial BBC News App in React Native
2 |
3 | 
4 |
5 |
6 | A basic implementation of the BBC News app built using React Native, the project helped with understanding how react native works, and how to begin building real apps with it.
7 |
8 | The app uses the same BBC News API as the official one, but is subject to change at any time so could break at any time.
9 |
10 | The app parses the BBC's XML story structure and maps each item to react components.
11 | The app defaults to the topic of world news,pressing the topics under stories will laod those feeds, a way to view specific news feeds will be implemented soon.
12 |
13 | Supports:
14 | - Videos
15 | - Images
16 | - Text
17 | - External Links
18 |
19 | To-do:
20 | - Internal article links
21 | - Select a news feed topic
22 |
23 |
24 | The app is currently iOS only, but I would like to expand to android in the future.
25 |
26 | ## Setup for developing
27 |
28 | - git clone this repo
29 | - run `npm install`
30 | - run the app from Xcode
31 |
--------------------------------------------------------------------------------
/XMLToReactMap.js:
--------------------------------------------------------------------------------
1 | var React = require('react-native');
2 | var {
3 | AppRegistry,
4 | StyleSheet,
5 | Text,
6 | View,
7 | Image,
8 | TouchableHighlight,
9 | ScrollView
10 | } = React;
11 |
12 |
13 | var Video = require('react-native-video');
14 | var Link = require('./Components/Link');
15 | var VideoPlaceHolder = require('./Components/VideoPlaceHolder');
16 |
17 | module.exports = {
18 |
19 | media: null,
20 |
21 | createReactElementsWithXMLRoot(xmlRootElement, media) {
22 | this.media = media;
23 | return new Promise((resolve, reject) => {
24 | this.mapToReact(xmlRootElement, (reactElementsArray, error) => {
25 | if (error) {
26 | reject(error);
27 | } else {
28 | resolve(reactElementsArray);
29 | }
30 | });
31 | })
32 | },
33 |
34 |
35 | mapToReact(rootElement, completion) {
36 | Promise.all(rootElement.children.map( (tag, index) => {
37 |
38 | return this.createReactElementForTag(tag, index)
39 | .then((result) => {
40 | return result;
41 | });
42 | })).then( results => {
43 | completion(results, false)
44 | })
45 | },
46 |
47 | createReactElementForTag(tag, index) {
48 | return new Promise((resolve, reject) => {
49 |
50 | if (tag.type === 'text') {
51 | resolve(tag.raw)
52 | }
53 | switch(tag.name) {
54 |
55 | case 'image': {
56 | this.createImageElement(tag, index, ( element ) => {
57 | resolve(element)
58 | })
59 | }
60 | break;
61 |
62 | case 'paragraph': {
63 | this.createParagraphElement(tag, index, ( element ) => {
64 | resolve(element)
65 | })
66 | }
67 | break;
68 |
69 | case 'bold': {
70 | this.createBoldTextElement(tag, index, ( element ) => {
71 | resolve(element)
72 | })
73 | }
74 | break;
75 |
76 | case 'italic': {
77 | this.createItalicTextElement(tag, index, ( element ) => {
78 | resolve(element)
79 | })
80 | }
81 | break;
82 |
83 | case 'crosshead': {
84 | this.createCrossheadTextElement(tag, index, ( element ) => {
85 | resolve(element)
86 | })
87 | }
88 | break;
89 |
90 | case 'link': {
91 | this.createLinkElement(tag, index, ( element ) => {
92 | resolve(element)
93 | })
94 | }
95 | break;
96 |
97 | case 'list': {
98 | this.createListElement(tag, index, ( element )=> {
99 | resolve(element)
100 | })
101 | }
102 | break;
103 |
104 | case 'listItem': {
105 | this.createListItemElement(tag, index, ( element )=> {
106 | resolve(element)
107 | })
108 | }
109 | break;
110 |
111 | case 'video': {
112 | this.createVideoElement(tag, index, ( element )=> {
113 | resolve(element)
114 | })
115 | }
116 | break;
117 |
118 | default:
119 |
120 | resolve(React.createElement(Text, {style:[styles.text, styles.paragraph] , key: index}, "ELEMENT NOT FOUND"));
121 | }
122 | })
123 | },
124 |
125 | createImageElement(tag, index, completion) {
126 |
127 | const image = this.imageForId(tag.attribs.id);
128 | const height = image.content.height < 200 ? image.content.height : 200
129 |
130 | const imageElement = React.createElement(Image,
131 | {
132 | style: {flex: 1, backgroundColor: '#eeeeee'},
133 | source:{uri: image.content.href},
134 | key: index
135 | }, []);
136 |
137 | completion(React.createElement(View,
138 | {
139 | style: [styles.image, {height}],
140 | key: index
141 | }, imageElement));
142 | },
143 |
144 | createParagraphElement(tag, index, completion) {
145 | this.mapToReact(tag, (childElements => {
146 | completion(React.createElement(Text, {style:[styles.text, styles.paragraph] , key: index}, childElements));
147 | }));
148 |
149 | },
150 |
151 | createBoldTextElement(tag, index, completion) {
152 | this.mapToReact(tag, (childElements => {
153 | completion(React.createElement(Text, {style:[styles.text, styles.bold] , key: index}, childElements));
154 | }));
155 |
156 | },
157 |
158 | createItalicTextElement(tag, index, completion) {
159 | this.mapToReact(tag, (childElements => {
160 | completion(React.createElement(Text, {style: [styles.text, styles.italic], key: index}, childElements));
161 | }));
162 | },
163 |
164 | createCrossheadTextElement(tag, index, completion) {
165 | this.mapToReact(tag, (childElements => {
166 | completion(React.createElement(Text, {style: [styles.crosshead], key: index}, childElements));
167 | }));
168 | },
169 |
170 | createLinkElement(tag, index, completion) {
171 | const caption = tag.children.find( child => {
172 | return child.name === 'caption';
173 | })
174 |
175 | const url = tag.children.find( child => {
176 | return child.name === 'url';
177 | })
178 |
179 | const text = React.createElement(Text, {}, caption.children[0].raw);
180 |
181 | completion(React.createElement(Link, {url:url.attribs.href, key: index}, text));
182 | },
183 |
184 | createListElement(tag, index, completion) {
185 | this.mapToReact(tag, (childElements => {
186 | completion(React.createElement(View, {style: [styles.list], key: index}, childElements));
187 | }));
188 |
189 | },
190 |
191 | createListItemElement(tag, index, completion) {
192 | const bulletPoint = React.createElement(Text, {style: [styles.text], key: 'bullet'+index}, ["• "])
193 |
194 | this.mapToReact(tag, (childElements => {
195 | const text = React.createElement(Text, {style: [styles.text, {flex: 1}], key: index}, childElements);
196 | completion(React.createElement(View, {style: [styles.listItem], key: index}, [bulletPoint, text]));
197 | }));
198 | },
199 |
200 | createVideoElement(tag, index, completion) {
201 |
202 | const foundVideo = this.media.videos.find(video => {
203 | return video.content.id === tag.attribs.id
204 | });
205 |
206 | const videoPlaceHolder = React.createElement(VideoPlaceHolder, {video: foundVideo}, []);
207 |
208 | completion(React.createElement(View, { style: [styles.video], key: index }, videoPlaceHolder));
209 | },
210 |
211 |
212 |
213 |
214 | /*** Util Functions ***/
215 |
216 | imageForId(imageId) {
217 | return this.media.images.find(image => {
218 | return image.content.id === imageId
219 | });
220 | },
221 |
222 |
223 | handleImageUrl(id) {
224 | if (id.indexOf('/cpsprodpb/') > -1) {
225 | return `http://c.files.bbci.co.uk/${id.substring('/cpsprodpb/'.length)}`
226 | } else {
227 | return 'http://c.files.bbci.co.uk/C8EE/production/_87983415_464x2.jpg'
228 | }
229 |
230 | },
231 |
232 | fetchVideoInfo(videoId, completion) {
233 | fetch(`http://open.live.bbc.co.uk/mediaselector/5/select/version/2.0/format/json/mediaset/journalism-http-tablet/vpid/${videoId}/proto/http/transferformat/hls/`)
234 | .then((response) => response.json())
235 | .then((responseData) => {
236 | completion(responseData.media[0].connection[0].href);
237 | })
238 | .done();
239 | },
240 | }
241 |
242 |
243 |
244 | var styles = StyleSheet.create({
245 | text: {
246 | color: 'black',
247 | fontSize: 16,
248 | },
249 |
250 | paragraph: {
251 | flex: 1,
252 | marginVertical: 10,
253 | marginHorizontal: 15
254 | },
255 |
256 | bold: {
257 | fontWeight: 'bold'
258 | },
259 |
260 | italic: {
261 | fontStyle: 'italic',
262 | },
263 |
264 | crosshead: {
265 | fontWeight: 'bold',
266 | fontSize: 22,
267 | marginVertical: 10,
268 | marginHorizontal: 15
269 | },
270 |
271 | list: {
272 | flex: 1,
273 | flexDirection: 'column',
274 | marginVertical: 10,
275 | marginHorizontal: 15
276 | },
277 |
278 | listItem: {
279 | flex: 1,
280 | flexDirection: 'row',
281 | marginVertical: 10,
282 | marginHorizontal: 15
283 | },
284 |
285 | video: {
286 | flex:1,
287 | height: 200,
288 | },
289 |
290 | image: {
291 | flex:2,
292 | marginVertical: 10,
293 | }
294 |
295 |
296 | })
--------------------------------------------------------------------------------
/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: "com.android.application"
2 |
3 | import com.android.build.OutputFile
4 |
5 | /**
6 | * The react.gradle file registers two tasks: bundleDebugJsAndAssets and bundleReleaseJsAndAssets.
7 | * These basically call `react-native bundle` with the correct arguments during the Android build
8 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
9 | * bundle directly from the development server. Below you can see all the possible configurations
10 | * and their defaults. If you decide to add a configuration block, make sure to add it before the
11 | * `apply from: "react.gradle"` line.
12 | *
13 | * project.ext.react = [
14 | * // the name of the generated asset file containing your JS bundle
15 | * bundleAssetName: "index.android.bundle",
16 | *
17 | * // the entry file for bundle generation
18 | * entryFile: "index.android.js",
19 | *
20 | * // whether to bundle JS and assets in debug mode
21 | * bundleInDebug: false,
22 | *
23 | * // whether to bundle JS and assets in release mode
24 | * bundleInRelease: true,
25 | *
26 | * // the root of your project, i.e. where "package.json" lives
27 | * root: "../../",
28 | *
29 | * // where to put the JS bundle asset in debug mode
30 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
31 | *
32 | * // where to put the JS bundle asset in release mode
33 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release",
34 | *
35 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
36 | * // require('./image.png')), in debug mode
37 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
38 | *
39 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
40 | * // require('./image.png')), in release mode
41 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
42 | *
43 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means
44 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
45 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle
46 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
47 | * // for example, you might want to remove it from here.
48 | * inputExcludes: ["android/**", "ios/**"]
49 | * ]
50 | */
51 |
52 | apply from: "react.gradle"
53 |
54 | /**
55 | * Set this to true to create three separate APKs instead of one:
56 | * - A universal APK that works on all devices
57 | * - An APK that only works on ARM devices
58 | * - An APK that only works on x86 devices
59 | * The advantage is the size of the APK is reduced by about 4MB.
60 | * Upload all the APKs to the Play Store and people will download
61 | * the correct one based on the CPU architecture of their device.
62 | */
63 | def enableSeparateBuildPerCPUArchitecture = false
64 |
65 | /**
66 | * Run Proguard to shrink the Java bytecode in release builds.
67 | */
68 | def enableProguardInReleaseBuilds = false
69 |
70 | android {
71 | compileSdkVersion 23
72 | buildToolsVersion "23.0.1"
73 |
74 | defaultConfig {
75 | applicationId "com.bbcnews"
76 | minSdkVersion 16
77 | targetSdkVersion 22
78 | versionCode 1
79 | versionName "1.0"
80 | ndk {
81 | abiFilters "armeabi-v7a", "x86"
82 | }
83 | }
84 | splits {
85 | abi {
86 | enable enableSeparateBuildPerCPUArchitecture
87 | universalApk true
88 | reset()
89 | include "armeabi-v7a", "x86"
90 | }
91 | }
92 | buildTypes {
93 | release {
94 | minifyEnabled enableProguardInReleaseBuilds
95 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
96 | }
97 | }
98 | // applicationVariants are e.g. debug, release
99 | applicationVariants.all { variant ->
100 | variant.outputs.each { output ->
101 | // For each separate APK per architecture, set a unique version code as described here:
102 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
103 | def versionCodes = ["armeabi-v7a":1, "x86":2]
104 | def abi = output.getFilter(OutputFile.ABI)
105 | if (abi != null) { // null for the universal-debug, universal-release variants
106 | output.versionCodeOverride =
107 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
108 | }
109 | }
110 | }
111 | }
112 |
113 | dependencies {
114 | compile fileTree(dir: "libs", include: ["*.jar"])
115 | compile "com.android.support:appcompat-v7:23.0.1"
116 | compile "com.facebook.react:react-native:0.18.+"
117 | }
118 |
--------------------------------------------------------------------------------
/android/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | # Disabling obfuscation is useful if you collect stack traces from production crashes
20 | # (unless you are using a system that supports de-obfuscate the stack traces).
21 | -dontobfuscate
22 |
23 | # React Native
24 |
25 | # Keep our interfaces so they can be used by other ProGuard rules.
26 | # See http://sourceforge.net/p/proguard/bugs/466/
27 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
28 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
29 |
30 | # Do not strip any method/class that is annotated with @DoNotStrip
31 | -keep @com.facebook.proguard.annotations.DoNotStrip class *
32 | -keepclassmembers class * {
33 | @com.facebook.proguard.annotations.DoNotStrip *;
34 | }
35 |
36 | -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
37 | void set*(***);
38 | *** get*();
39 | }
40 |
41 | -keep class * extends com.facebook.react.bridge.JavaScriptModule { *; }
42 | -keep class * extends com.facebook.react.bridge.NativeModule { *; }
43 | -keepclassmembers,includedescriptorclasses class * { native ; }
44 | -keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; }
45 | -keepclassmembers class * { @com.facebook.react.uimanager.ReactProp ; }
46 | -keepclassmembers class * { @com.facebook.react.uimanager.ReactPropGroup ; }
47 |
48 | -dontwarn com.facebook.react.**
49 |
50 | # okhttp
51 |
52 | -keepattributes Signature
53 | -keepattributes *Annotation*
54 | -keep class com.squareup.okhttp.** { *; }
55 | -keep interface com.squareup.okhttp.** { *; }
56 | -dontwarn com.squareup.okhttp.**
57 |
58 | # okio
59 |
60 | -keep class sun.misc.Unsafe { *; }
61 | -dontwarn java.nio.file.*
62 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
63 | -dontwarn okio.**
64 |
65 | # stetho
66 |
67 | -dontwarn com.facebook.stetho.**
68 |
--------------------------------------------------------------------------------
/android/app/react.gradle:
--------------------------------------------------------------------------------
1 | import org.apache.tools.ant.taskdefs.condition.Os
2 |
3 | def config = project.hasProperty("react") ? project.react : [];
4 |
5 | def bundleAssetName = config.bundleAssetName ?: "index.android.bundle"
6 | def entryFile = config.entryFile ?: "index.android.js"
7 |
8 | // because elvis operator
9 | def elvisFile(thing) {
10 | return thing ? file(thing) : null;
11 | }
12 |
13 | def reactRoot = elvisFile(config.root) ?: file("../../")
14 | def jsBundleDirDebug = elvisFile(config.jsBundleDirDebug) ?:
15 | file("$buildDir/intermediates/assets/debug")
16 | def jsBundleDirRelease = elvisFile(config.jsBundleDirRelease) ?:
17 | file("$buildDir/intermediates/assets/release")
18 | def resourcesDirDebug = elvisFile(config.resourcesDirDebug) ?:
19 | file("$buildDir/intermediates/res/merged/debug")
20 | def resourcesDirRelease = elvisFile(config.resourcesDirRelease) ?:
21 | file("$buildDir/intermediates/res/merged/release")
22 | def inputExcludes = config.inputExcludes ?: ["android/**", "ios/**"]
23 |
24 | def jsBundleFileDebug = file("$jsBundleDirDebug/$bundleAssetName")
25 | def jsBundleFileRelease = file("$jsBundleDirRelease/$bundleAssetName")
26 |
27 | task bundleDebugJsAndAssets(type: Exec) {
28 | // create dirs if they are not there (e.g. the "clean" task just ran)
29 | doFirst {
30 | jsBundleDirDebug.mkdirs()
31 | resourcesDirDebug.mkdirs()
32 | }
33 |
34 | // set up inputs and outputs so gradle can cache the result
35 | inputs.files fileTree(dir: reactRoot, excludes: inputExcludes)
36 | outputs.dir jsBundleDirDebug
37 | outputs.dir resourcesDirDebug
38 |
39 | // set up the call to the react-native cli
40 | workingDir reactRoot
41 | if (Os.isFamily(Os.FAMILY_WINDOWS)) {
42 | commandLine "cmd", "/c", "react-native", "bundle", "--platform", "android", "--dev", "true", "--entry-file",
43 | entryFile, "--bundle-output", jsBundleFileDebug, "--assets-dest", resourcesDirDebug
44 | } else {
45 | commandLine "react-native", "bundle", "--platform", "android", "--dev", "true", "--entry-file",
46 | entryFile, "--bundle-output", jsBundleFileDebug, "--assets-dest", resourcesDirDebug
47 | }
48 |
49 | enabled config.bundleInDebug ?: false
50 | }
51 |
52 | task bundleReleaseJsAndAssets(type: Exec) {
53 | // create dirs if they are not there (e.g. the "clean" task just ran)
54 | doFirst {
55 | jsBundleDirRelease.mkdirs()
56 | resourcesDirRelease.mkdirs()
57 | }
58 |
59 | // set up inputs and outputs so gradle can cache the result
60 | inputs.files fileTree(dir: reactRoot, excludes: inputExcludes)
61 | outputs.dir jsBundleDirRelease
62 | outputs.dir resourcesDirRelease
63 |
64 | // set up the call to the react-native cli
65 | workingDir reactRoot
66 | if (Os.isFamily(Os.FAMILY_WINDOWS)) {
67 | commandLine "cmd","/c", "react-native", "bundle", "--platform", "android", "--dev", "false", "--entry-file",
68 | entryFile, "--bundle-output", jsBundleFileRelease, "--assets-dest", resourcesDirRelease
69 | } else {
70 | commandLine "react-native", "bundle", "--platform", "android", "--dev", "false", "--entry-file",
71 | entryFile, "--bundle-output", jsBundleFileRelease, "--assets-dest", resourcesDirRelease
72 | }
73 |
74 | enabled config.bundleInRelease ?: true
75 | }
76 |
77 | void runBefore(String dependentTaskName, Task task) {
78 | Task dependentTask = tasks.findByPath(dependentTaskName);
79 | if (dependentTask != null) {
80 | dependentTask.dependsOn task
81 | }
82 | }
83 |
84 | gradle.projectsEvaluated {
85 |
86 | // hook bundleDebugJsAndAssets into the android build process
87 |
88 | bundleDebugJsAndAssets.dependsOn mergeDebugResources
89 | bundleDebugJsAndAssets.dependsOn mergeDebugAssets
90 |
91 | runBefore('processArmeabi-v7aDebugResources', bundleDebugJsAndAssets)
92 | runBefore('processX86DebugResources', bundleDebugJsAndAssets)
93 | runBefore('processUniversalDebugResources', bundleDebugJsAndAssets)
94 | runBefore('processDebugResources', bundleDebugJsAndAssets)
95 |
96 | // hook bundleReleaseJsAndAssets into the android build process
97 |
98 | bundleReleaseJsAndAssets.dependsOn mergeReleaseResources
99 | bundleReleaseJsAndAssets.dependsOn mergeReleaseAssets
100 |
101 | runBefore('processArmeabi-v7aReleaseResources', bundleReleaseJsAndAssets)
102 | runBefore('processX86ReleaseResources', bundleReleaseJsAndAssets)
103 | runBefore('processUniversalReleaseResources', bundleReleaseJsAndAssets)
104 | runBefore('processReleaseResources', bundleReleaseJsAndAssets)
105 |
106 | }
107 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
11 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/android/app/src/main/java/com/bbcnews/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.bbcnews;
2 |
3 | import com.facebook.react.ReactActivity;
4 | import com.facebook.react.ReactPackage;
5 | import com.facebook.react.shell.MainReactPackage;
6 |
7 | import java.util.Arrays;
8 | import java.util.List;
9 |
10 | public class MainActivity extends ReactActivity {
11 |
12 | /**
13 | * Returns the name of the main component registered from JavaScript.
14 | * This is used to schedule rendering of the component.
15 | */
16 | @Override
17 | protected String getMainComponentName() {
18 | return "BBCNews";
19 | }
20 |
21 | /**
22 | * Returns whether dev mode should be enabled.
23 | * This enables e.g. the dev menu.
24 | */
25 | @Override
26 | protected boolean getUseDeveloperSupport() {
27 | return BuildConfig.DEBUG;
28 | }
29 |
30 | /**
31 | * A list of packages used by the app. If the app uses additional views
32 | * or modules besides the default ones, add more packages here.
33 | */
34 | @Override
35 | protected List getPackages() {
36 | return Arrays.asList(
37 | new MainReactPackage());
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/joeltrew/BBCNews-React-Native/be3f63f30a9ec8db60472f4e0ab824995103b9d5/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/joeltrew/BBCNews-React-Native/be3f63f30a9ec8db60472f4e0ab824995103b9d5/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/joeltrew/BBCNews-React-Native/be3f63f30a9ec8db60472f4e0ab824995103b9d5/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/joeltrew/BBCNews-React-Native/be3f63f30a9ec8db60472f4e0ab824995103b9d5/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | BBCNews
3 |
4 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:1.3.1'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | mavenLocal()
18 | jcenter()
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
19 |
20 | android.useDeprecatedNdk=true
21 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/joeltrew/BBCNews-React-Native/be3f63f30a9ec8db60472f4e0ab824995103b9d5/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
6 |
--------------------------------------------------------------------------------
/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # For Cygwin, ensure paths are in UNIX format before anything is touched.
46 | if $cygwin ; then
47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48 | fi
49 |
50 | # Attempt to set APP_HOME
51 | # Resolve links: $0 may be a link
52 | PRG="$0"
53 | # Need this for relative symlinks.
54 | while [ -h "$PRG" ] ; do
55 | ls=`ls -ld "$PRG"`
56 | link=`expr "$ls" : '.*-> \(.*\)$'`
57 | if expr "$link" : '/.*' > /dev/null; then
58 | PRG="$link"
59 | else
60 | PRG=`dirname "$PRG"`"/$link"
61 | fi
62 | done
63 | SAVED="`pwd`"
64 | cd "`dirname \"$PRG\"`/" >&-
65 | APP_HOME="`pwd -P`"
66 | cd "$SAVED" >&-
67 |
68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69 |
70 | # Determine the Java command to use to start the JVM.
71 | if [ -n "$JAVA_HOME" ] ; then
72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73 | # IBM's JDK on AIX uses strange locations for the executables
74 | JAVACMD="$JAVA_HOME/jre/sh/java"
75 | else
76 | JAVACMD="$JAVA_HOME/bin/java"
77 | fi
78 | if [ ! -x "$JAVACMD" ] ; then
79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80 |
81 | Please set the JAVA_HOME variable in your environment to match the
82 | location of your Java installation."
83 | fi
84 | else
85 | JAVACMD="java"
86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87 |
88 | Please set the JAVA_HOME variable in your environment to match the
89 | location of your Java installation."
90 | fi
91 |
92 | # Increase the maximum file descriptors if we can.
93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94 | MAX_FD_LIMIT=`ulimit -H -n`
95 | if [ $? -eq 0 ] ; then
96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97 | MAX_FD="$MAX_FD_LIMIT"
98 | fi
99 | ulimit -n $MAX_FD
100 | if [ $? -ne 0 ] ; then
101 | warn "Could not set maximum file descriptor limit: $MAX_FD"
102 | fi
103 | else
104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105 | fi
106 | fi
107 |
108 | # For Darwin, add options to specify how the application appears in the dock
109 | if $darwin; then
110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111 | fi
112 |
113 | # For Cygwin, switch paths to Windows format before running java
114 | if $cygwin ; then
115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'BBCNews'
2 |
3 | include ':app'
4 |
--------------------------------------------------------------------------------
/index.android.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Sample React Native App
3 | * https://github.com/facebook/react-native
4 | */
5 | 'use strict';
6 |
7 | var React = require('react-native');
8 | var {
9 | AppRegistry,
10 | StyleSheet,
11 | Text,
12 | View,
13 | } = React;
14 |
15 | var BBCNews = React.createClass({
16 | render: function() {
17 | return (
18 |
19 |
20 | Welcome to React Native!
21 |
22 |
23 | To get started, edit index.android.js
24 |
25 |
26 | Shake or press menu button for dev menu
27 |
28 |
29 | );
30 | }
31 | });
32 |
33 | var styles = StyleSheet.create({
34 | container: {
35 | flex: 1,
36 | justifyContent: 'center',
37 | alignItems: 'center',
38 | backgroundColor: '#F5FCFF',
39 | },
40 | welcome: {
41 | fontSize: 20,
42 | textAlign: 'center',
43 | margin: 10,
44 | },
45 | instructions: {
46 | textAlign: 'center',
47 | color: '#333333',
48 | marginBottom: 5,
49 | },
50 | });
51 |
52 | AppRegistry.registerComponent('BBCNews', () => BBCNews);
53 |
--------------------------------------------------------------------------------
/index.ios.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Sample React Native App
3 | * https://github.com/facebook/react-native
4 | */
5 | 'use strict';
6 |
7 | var React = require('react-native');
8 | var {
9 | AppRegistry,
10 | StyleSheet,
11 | View,
12 | NavigatorIOS,
13 | Text,
14 | StatusBarIOS,
15 | TouchableOpacity
16 | } = React;
17 |
18 | import Feed from './Components/Feed';
19 |
20 | var BBCNews = React.createClass({
21 |
22 | _renderScene(route, navigator) {
23 | var Component = route.component;
24 | StatusBarIOS.setStyle('light-content');
25 | return (
26 |
27 | );
28 | },
29 |
30 | componentWillMount() {
31 | StatusBarIOS.setStyle('light-content');
32 | },
33 |
34 | render() {
35 | return (
36 |
48 | );
49 | }
50 | });
51 |
52 |
53 |
54 | AppRegistry.registerComponent('BBCNews', () => BBCNews);
55 |
--------------------------------------------------------------------------------
/ios/AngularActivityIndicatorViewManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // AngularActivityIndicatorViewManager.h
3 | // BBCNews
4 | //
5 | // Created by Joel Trew on 18/01/2016.
6 | // Copyright © 2016 Facebook. All rights reserved.
7 | //
8 |
9 | #import "RCTViewManager.h"
10 |
11 | @interface AngularActivityIndicatorViewManager : RCTViewManager
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/ios/AngularActivityIndicatorViewManager.m:
--------------------------------------------------------------------------------
1 | //
2 | // AngularActivityIndicatorViewManager.m
3 | // BBCNews
4 | //
5 | // Created by Joel Trew on 18/01/2016.
6 | // Copyright © 2016 Facebook. All rights reserved.
7 | //
8 |
9 | #import "AngularActivityIndicatorViewManager.h"
10 | #import "PCAngularActivityIndicatorView.h"
11 | @import UIKit;
12 |
13 | @implementation AngularActivityIndicatorViewManager
14 |
15 | RCT_EXPORT_MODULE()
16 |
17 | - (UIView *)view
18 | {
19 |
20 | PCAngularActivityIndicatorView *loadingView = [[PCAngularActivityIndicatorView alloc]initWithActivityIndicatorStyle:PCAngularActivityIndicatorViewStyleLarge];
21 |
22 | return loadingView;
23 |
24 | }
25 |
26 | RCT_CUSTOM_VIEW_PROPERTY(isAnimating, BOOL, PCAngularActivityIndicatorView)
27 | {
28 | if (view.isAnimating) {
29 | [view stopAnimating];
30 | } else {
31 | [view startAnimating];
32 | }
33 | }
34 |
35 | RCT_CUSTOM_VIEW_PROPERTY(color, UIColor, PCAngularActivityIndicatorView)
36 | {
37 | view.color = [RCTConvert UIColor:json];
38 | }
39 |
40 |
41 |
42 |
43 |
44 | @end
45 |
--------------------------------------------------------------------------------
/ios/BBCNews.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; };
11 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; };
12 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; };
13 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; };
14 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; };
15 | 00E356F31AD99517003FC87E /* BBCNewsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* BBCNewsTests.m */; };
16 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; };
17 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; };
18 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; };
19 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
20 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };
21 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
22 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
23 | 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };
24 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
25 | FF65B65C1C5D7768000EB54D /* libRCTVideo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FF65B6581C5D7740000EB54D /* libRCTVideo.a */; };
26 | FFD776151C96C14500522A2D /* libAngularActivityLoadingIndicator.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FFD776141C96C13600522A2D /* libAngularActivityLoadingIndicator.a */; };
27 | /* End PBXBuildFile section */
28 |
29 | /* Begin PBXContainerItemProxy section */
30 | 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = {
31 | isa = PBXContainerItemProxy;
32 | containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */;
33 | proxyType = 2;
34 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
35 | remoteInfo = RCTActionSheet;
36 | };
37 | 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = {
38 | isa = PBXContainerItemProxy;
39 | containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */;
40 | proxyType = 2;
41 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
42 | remoteInfo = RCTGeolocation;
43 | };
44 | 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = {
45 | isa = PBXContainerItemProxy;
46 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;
47 | proxyType = 2;
48 | remoteGlobalIDString = 58B5115D1A9E6B3D00147676;
49 | remoteInfo = RCTImage;
50 | };
51 | 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = {
52 | isa = PBXContainerItemProxy;
53 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */;
54 | proxyType = 2;
55 | remoteGlobalIDString = 58B511DB1A9E6C8500147676;
56 | remoteInfo = RCTNetwork;
57 | };
58 | 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = {
59 | isa = PBXContainerItemProxy;
60 | containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */;
61 | proxyType = 2;
62 | remoteGlobalIDString = 832C81801AAF6DEF007FA2F7;
63 | remoteInfo = RCTVibration;
64 | };
65 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = {
66 | isa = PBXContainerItemProxy;
67 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
68 | proxyType = 1;
69 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A;
70 | remoteInfo = BBCNews;
71 | };
72 | 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = {
73 | isa = PBXContainerItemProxy;
74 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;
75 | proxyType = 2;
76 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
77 | remoteInfo = RCTSettings;
78 | };
79 | 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = {
80 | isa = PBXContainerItemProxy;
81 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
82 | proxyType = 2;
83 | remoteGlobalIDString = 3C86DF461ADF2C930047B81A;
84 | remoteInfo = RCTWebSocket;
85 | };
86 | 146834031AC3E56700842450 /* PBXContainerItemProxy */ = {
87 | isa = PBXContainerItemProxy;
88 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
89 | proxyType = 2;
90 | remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192;
91 | remoteInfo = React;
92 | };
93 | 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = {
94 | isa = PBXContainerItemProxy;
95 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */;
96 | proxyType = 2;
97 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
98 | remoteInfo = RCTLinking;
99 | };
100 | 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = {
101 | isa = PBXContainerItemProxy;
102 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;
103 | proxyType = 2;
104 | remoteGlobalIDString = 58B5119B1A9E6C1200147676;
105 | remoteInfo = RCTText;
106 | };
107 | FF65B6571C5D7740000EB54D /* PBXContainerItemProxy */ = {
108 | isa = PBXContainerItemProxy;
109 | containerPortal = FF65B6491C5D7740000EB54D /* RCTVideo.xcodeproj */;
110 | proxyType = 2;
111 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
112 | remoteInfo = RCTVideo;
113 | };
114 | FFD776131C96C13600522A2D /* PBXContainerItemProxy */ = {
115 | isa = PBXContainerItemProxy;
116 | containerPortal = FFD7760F1C96C13600522A2D /* AngularActivityLoadingIndicator.xcodeproj */;
117 | proxyType = 2;
118 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
119 | remoteInfo = AngularActivityLoadingIndicator;
120 | };
121 | /* End PBXContainerItemProxy section */
122 |
123 | /* Begin PBXFileReference section */
124 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; };
125 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; };
126 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; };
127 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; };
128 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; };
129 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; };
130 | 00E356EE1AD99517003FC87E /* BBCNewsTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BBCNewsTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
131 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
132 | 00E356F21AD99517003FC87E /* BBCNewsTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BBCNewsTests.m; sourceTree = ""; };
133 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; };
134 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; };
135 | 13B07F961A680F5B00A75B9A /* BBCNews.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BBCNews.app; sourceTree = BUILT_PRODUCTS_DIR; };
136 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = BBCNews/AppDelegate.h; sourceTree = ""; };
137 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = BBCNews/AppDelegate.m; sourceTree = ""; };
138 | 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; };
139 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = BBCNews/Images.xcassets; sourceTree = ""; };
140 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = BBCNews/Info.plist; sourceTree = ""; };
141 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = BBCNews/main.m; sourceTree = ""; };
142 | 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; };
143 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; };
144 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; };
145 | FF65B6491C5D7740000EB54D /* RCTVideo.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVideo.xcodeproj; path = "../node_modules/react-native-video/RCTVideo.xcodeproj"; sourceTree = ""; };
146 | FFD7760F1C96C13600522A2D /* AngularActivityLoadingIndicator.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = AngularActivityLoadingIndicator.xcodeproj; path = "../node_modules/react-native-angular-activity-indicator/AngularActivityLoadingIndicator.xcodeproj"; sourceTree = ""; };
147 | /* End PBXFileReference section */
148 |
149 | /* Begin PBXFrameworksBuildPhase section */
150 | 00E356EB1AD99517003FC87E /* Frameworks */ = {
151 | isa = PBXFrameworksBuildPhase;
152 | buildActionMask = 2147483647;
153 | files = (
154 | );
155 | runOnlyForDeploymentPostprocessing = 0;
156 | };
157 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
158 | isa = PBXFrameworksBuildPhase;
159 | buildActionMask = 2147483647;
160 | files = (
161 | FFD776151C96C14500522A2D /* libAngularActivityLoadingIndicator.a in Frameworks */,
162 | FF65B65C1C5D7768000EB54D /* libRCTVideo.a in Frameworks */,
163 | 146834051AC3E58100842450 /* libReact.a in Frameworks */,
164 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */,
165 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */,
166 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */,
167 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */,
168 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */,
169 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */,
170 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */,
171 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */,
172 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,
173 | );
174 | runOnlyForDeploymentPostprocessing = 0;
175 | };
176 | /* End PBXFrameworksBuildPhase section */
177 |
178 | /* Begin PBXGroup section */
179 | 00C302A81ABCB8CE00DB3ED1 /* Products */ = {
180 | isa = PBXGroup;
181 | children = (
182 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */,
183 | );
184 | name = Products;
185 | sourceTree = "";
186 | };
187 | 00C302B61ABCB90400DB3ED1 /* Products */ = {
188 | isa = PBXGroup;
189 | children = (
190 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */,
191 | );
192 | name = Products;
193 | sourceTree = "";
194 | };
195 | 00C302BC1ABCB91800DB3ED1 /* Products */ = {
196 | isa = PBXGroup;
197 | children = (
198 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */,
199 | );
200 | name = Products;
201 | sourceTree = "";
202 | };
203 | 00C302D41ABCB9D200DB3ED1 /* Products */ = {
204 | isa = PBXGroup;
205 | children = (
206 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */,
207 | );
208 | name = Products;
209 | sourceTree = "";
210 | };
211 | 00C302E01ABCB9EE00DB3ED1 /* Products */ = {
212 | isa = PBXGroup;
213 | children = (
214 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */,
215 | );
216 | name = Products;
217 | sourceTree = "";
218 | };
219 | 00E356EF1AD99517003FC87E /* BBCNewsTests */ = {
220 | isa = PBXGroup;
221 | children = (
222 | 00E356F21AD99517003FC87E /* BBCNewsTests.m */,
223 | 00E356F01AD99517003FC87E /* Supporting Files */,
224 | );
225 | path = BBCNewsTests;
226 | sourceTree = "";
227 | };
228 | 00E356F01AD99517003FC87E /* Supporting Files */ = {
229 | isa = PBXGroup;
230 | children = (
231 | 00E356F11AD99517003FC87E /* Info.plist */,
232 | );
233 | name = "Supporting Files";
234 | sourceTree = "";
235 | };
236 | 139105B71AF99BAD00B5F7CC /* Products */ = {
237 | isa = PBXGroup;
238 | children = (
239 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */,
240 | );
241 | name = Products;
242 | sourceTree = "";
243 | };
244 | 139FDEE71B06529A00C62182 /* Products */ = {
245 | isa = PBXGroup;
246 | children = (
247 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */,
248 | );
249 | name = Products;
250 | sourceTree = "";
251 | };
252 | 13B07FAE1A68108700A75B9A /* BBCNews */ = {
253 | isa = PBXGroup;
254 | children = (
255 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */,
256 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */,
257 | 13B07FB01A68108700A75B9A /* AppDelegate.m */,
258 | 13B07FB51A68108700A75B9A /* Images.xcassets */,
259 | 13B07FB61A68108700A75B9A /* Info.plist */,
260 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */,
261 | 13B07FB71A68108700A75B9A /* main.m */,
262 | );
263 | name = BBCNews;
264 | sourceTree = "";
265 | };
266 | 146834001AC3E56700842450 /* Products */ = {
267 | isa = PBXGroup;
268 | children = (
269 | 146834041AC3E56700842450 /* libReact.a */,
270 | );
271 | name = Products;
272 | sourceTree = "";
273 | };
274 | 78C398B11ACF4ADC00677621 /* Products */ = {
275 | isa = PBXGroup;
276 | children = (
277 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */,
278 | );
279 | name = Products;
280 | sourceTree = "";
281 | };
282 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = {
283 | isa = PBXGroup;
284 | children = (
285 | FFD7760F1C96C13600522A2D /* AngularActivityLoadingIndicator.xcodeproj */,
286 | FF65B6491C5D7740000EB54D /* RCTVideo.xcodeproj */,
287 | 146833FF1AC3E56700842450 /* React.xcodeproj */,
288 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */,
289 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */,
290 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */,
291 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */,
292 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */,
293 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */,
294 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */,
295 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */,
296 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,
297 | );
298 | name = Libraries;
299 | sourceTree = "";
300 | };
301 | 832341B11AAA6A8300B99B32 /* Products */ = {
302 | isa = PBXGroup;
303 | children = (
304 | 832341B51AAA6A8300B99B32 /* libRCTText.a */,
305 | );
306 | name = Products;
307 | sourceTree = "";
308 | };
309 | 83CBB9F61A601CBA00E9B192 = {
310 | isa = PBXGroup;
311 | children = (
312 | 13B07FAE1A68108700A75B9A /* BBCNews */,
313 | 832341AE1AAA6A7D00B99B32 /* Libraries */,
314 | 00E356EF1AD99517003FC87E /* BBCNewsTests */,
315 | 83CBBA001A601CBA00E9B192 /* Products */,
316 | );
317 | indentWidth = 2;
318 | sourceTree = "";
319 | tabWidth = 2;
320 | };
321 | 83CBBA001A601CBA00E9B192 /* Products */ = {
322 | isa = PBXGroup;
323 | children = (
324 | 13B07F961A680F5B00A75B9A /* BBCNews.app */,
325 | 00E356EE1AD99517003FC87E /* BBCNewsTests.xctest */,
326 | );
327 | name = Products;
328 | sourceTree = "";
329 | };
330 | FF65B64A1C5D7740000EB54D /* Products */ = {
331 | isa = PBXGroup;
332 | children = (
333 | FF65B6581C5D7740000EB54D /* libRCTVideo.a */,
334 | );
335 | name = Products;
336 | sourceTree = "";
337 | };
338 | FFD776101C96C13600522A2D /* Products */ = {
339 | isa = PBXGroup;
340 | children = (
341 | FFD776141C96C13600522A2D /* libAngularActivityLoadingIndicator.a */,
342 | );
343 | name = Products;
344 | sourceTree = "";
345 | };
346 | /* End PBXGroup section */
347 |
348 | /* Begin PBXNativeTarget section */
349 | 00E356ED1AD99517003FC87E /* BBCNewsTests */ = {
350 | isa = PBXNativeTarget;
351 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "BBCNewsTests" */;
352 | buildPhases = (
353 | 00E356EA1AD99517003FC87E /* Sources */,
354 | 00E356EB1AD99517003FC87E /* Frameworks */,
355 | 00E356EC1AD99517003FC87E /* Resources */,
356 | );
357 | buildRules = (
358 | );
359 | dependencies = (
360 | 00E356F51AD99517003FC87E /* PBXTargetDependency */,
361 | );
362 | name = BBCNewsTests;
363 | productName = BBCNewsTests;
364 | productReference = 00E356EE1AD99517003FC87E /* BBCNewsTests.xctest */;
365 | productType = "com.apple.product-type.bundle.unit-test";
366 | };
367 | 13B07F861A680F5B00A75B9A /* BBCNews */ = {
368 | isa = PBXNativeTarget;
369 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "BBCNews" */;
370 | buildPhases = (
371 | 13B07F871A680F5B00A75B9A /* Sources */,
372 | 13B07F8C1A680F5B00A75B9A /* Frameworks */,
373 | 13B07F8E1A680F5B00A75B9A /* Resources */,
374 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
375 | );
376 | buildRules = (
377 | );
378 | dependencies = (
379 | );
380 | name = BBCNews;
381 | productName = "Hello World";
382 | productReference = 13B07F961A680F5B00A75B9A /* BBCNews.app */;
383 | productType = "com.apple.product-type.application";
384 | };
385 | /* End PBXNativeTarget section */
386 |
387 | /* Begin PBXProject section */
388 | 83CBB9F71A601CBA00E9B192 /* Project object */ = {
389 | isa = PBXProject;
390 | attributes = {
391 | LastUpgradeCheck = 0610;
392 | ORGANIZATIONNAME = Facebook;
393 | TargetAttributes = {
394 | 00E356ED1AD99517003FC87E = {
395 | CreatedOnToolsVersion = 6.2;
396 | TestTargetID = 13B07F861A680F5B00A75B9A;
397 | };
398 | };
399 | };
400 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "BBCNews" */;
401 | compatibilityVersion = "Xcode 3.2";
402 | developmentRegion = English;
403 | hasScannedForEncodings = 0;
404 | knownRegions = (
405 | en,
406 | Base,
407 | );
408 | mainGroup = 83CBB9F61A601CBA00E9B192;
409 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
410 | projectDirPath = "";
411 | projectReferences = (
412 | {
413 | ProductGroup = FFD776101C96C13600522A2D /* Products */;
414 | ProjectRef = FFD7760F1C96C13600522A2D /* AngularActivityLoadingIndicator.xcodeproj */;
415 | },
416 | {
417 | ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */;
418 | ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */;
419 | },
420 | {
421 | ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */;
422 | ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */;
423 | },
424 | {
425 | ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */;
426 | ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;
427 | },
428 | {
429 | ProductGroup = 78C398B11ACF4ADC00677621 /* Products */;
430 | ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */;
431 | },
432 | {
433 | ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */;
434 | ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */;
435 | },
436 | {
437 | ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */;
438 | ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;
439 | },
440 | {
441 | ProductGroup = 832341B11AAA6A8300B99B32 /* Products */;
442 | ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;
443 | },
444 | {
445 | ProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */;
446 | ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */;
447 | },
448 | {
449 | ProductGroup = FF65B64A1C5D7740000EB54D /* Products */;
450 | ProjectRef = FF65B6491C5D7740000EB54D /* RCTVideo.xcodeproj */;
451 | },
452 | {
453 | ProductGroup = 139FDEE71B06529A00C62182 /* Products */;
454 | ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
455 | },
456 | {
457 | ProductGroup = 146834001AC3E56700842450 /* Products */;
458 | ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */;
459 | },
460 | );
461 | projectRoot = "";
462 | targets = (
463 | 13B07F861A680F5B00A75B9A /* BBCNews */,
464 | 00E356ED1AD99517003FC87E /* BBCNewsTests */,
465 | );
466 | };
467 | /* End PBXProject section */
468 |
469 | /* Begin PBXReferenceProxy section */
470 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = {
471 | isa = PBXReferenceProxy;
472 | fileType = archive.ar;
473 | path = libRCTActionSheet.a;
474 | remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */;
475 | sourceTree = BUILT_PRODUCTS_DIR;
476 | };
477 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = {
478 | isa = PBXReferenceProxy;
479 | fileType = archive.ar;
480 | path = libRCTGeolocation.a;
481 | remoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */;
482 | sourceTree = BUILT_PRODUCTS_DIR;
483 | };
484 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = {
485 | isa = PBXReferenceProxy;
486 | fileType = archive.ar;
487 | path = libRCTImage.a;
488 | remoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */;
489 | sourceTree = BUILT_PRODUCTS_DIR;
490 | };
491 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = {
492 | isa = PBXReferenceProxy;
493 | fileType = archive.ar;
494 | path = libRCTNetwork.a;
495 | remoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */;
496 | sourceTree = BUILT_PRODUCTS_DIR;
497 | };
498 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = {
499 | isa = PBXReferenceProxy;
500 | fileType = archive.ar;
501 | path = libRCTVibration.a;
502 | remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */;
503 | sourceTree = BUILT_PRODUCTS_DIR;
504 | };
505 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = {
506 | isa = PBXReferenceProxy;
507 | fileType = archive.ar;
508 | path = libRCTSettings.a;
509 | remoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */;
510 | sourceTree = BUILT_PRODUCTS_DIR;
511 | };
512 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = {
513 | isa = PBXReferenceProxy;
514 | fileType = archive.ar;
515 | path = libRCTWebSocket.a;
516 | remoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */;
517 | sourceTree = BUILT_PRODUCTS_DIR;
518 | };
519 | 146834041AC3E56700842450 /* libReact.a */ = {
520 | isa = PBXReferenceProxy;
521 | fileType = archive.ar;
522 | path = libReact.a;
523 | remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */;
524 | sourceTree = BUILT_PRODUCTS_DIR;
525 | };
526 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = {
527 | isa = PBXReferenceProxy;
528 | fileType = archive.ar;
529 | path = libRCTLinking.a;
530 | remoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */;
531 | sourceTree = BUILT_PRODUCTS_DIR;
532 | };
533 | 832341B51AAA6A8300B99B32 /* libRCTText.a */ = {
534 | isa = PBXReferenceProxy;
535 | fileType = archive.ar;
536 | path = libRCTText.a;
537 | remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */;
538 | sourceTree = BUILT_PRODUCTS_DIR;
539 | };
540 | FF65B6581C5D7740000EB54D /* libRCTVideo.a */ = {
541 | isa = PBXReferenceProxy;
542 | fileType = archive.ar;
543 | path = libRCTVideo.a;
544 | remoteRef = FF65B6571C5D7740000EB54D /* PBXContainerItemProxy */;
545 | sourceTree = BUILT_PRODUCTS_DIR;
546 | };
547 | FFD776141C96C13600522A2D /* libAngularActivityLoadingIndicator.a */ = {
548 | isa = PBXReferenceProxy;
549 | fileType = archive.ar;
550 | path = libAngularActivityLoadingIndicator.a;
551 | remoteRef = FFD776131C96C13600522A2D /* PBXContainerItemProxy */;
552 | sourceTree = BUILT_PRODUCTS_DIR;
553 | };
554 | /* End PBXReferenceProxy section */
555 |
556 | /* Begin PBXResourcesBuildPhase section */
557 | 00E356EC1AD99517003FC87E /* Resources */ = {
558 | isa = PBXResourcesBuildPhase;
559 | buildActionMask = 2147483647;
560 | files = (
561 | );
562 | runOnlyForDeploymentPostprocessing = 0;
563 | };
564 | 13B07F8E1A680F5B00A75B9A /* Resources */ = {
565 | isa = PBXResourcesBuildPhase;
566 | buildActionMask = 2147483647;
567 | files = (
568 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
569 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */,
570 | );
571 | runOnlyForDeploymentPostprocessing = 0;
572 | };
573 | /* End PBXResourcesBuildPhase section */
574 |
575 | /* Begin PBXShellScriptBuildPhase section */
576 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
577 | isa = PBXShellScriptBuildPhase;
578 | buildActionMask = 2147483647;
579 | files = (
580 | );
581 | inputPaths = (
582 | );
583 | name = "Bundle React Native code and images";
584 | outputPaths = (
585 | );
586 | runOnlyForDeploymentPostprocessing = 0;
587 | shellPath = /bin/sh;
588 | shellScript = "../node_modules/react-native/packager/react-native-xcode.sh";
589 | };
590 | /* End PBXShellScriptBuildPhase section */
591 |
592 | /* Begin PBXSourcesBuildPhase section */
593 | 00E356EA1AD99517003FC87E /* Sources */ = {
594 | isa = PBXSourcesBuildPhase;
595 | buildActionMask = 2147483647;
596 | files = (
597 | 00E356F31AD99517003FC87E /* BBCNewsTests.m in Sources */,
598 | );
599 | runOnlyForDeploymentPostprocessing = 0;
600 | };
601 | 13B07F871A680F5B00A75B9A /* Sources */ = {
602 | isa = PBXSourcesBuildPhase;
603 | buildActionMask = 2147483647;
604 | files = (
605 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,
606 | 13B07FC11A68108700A75B9A /* main.m in Sources */,
607 | );
608 | runOnlyForDeploymentPostprocessing = 0;
609 | };
610 | /* End PBXSourcesBuildPhase section */
611 |
612 | /* Begin PBXTargetDependency section */
613 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = {
614 | isa = PBXTargetDependency;
615 | target = 13B07F861A680F5B00A75B9A /* BBCNews */;
616 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */;
617 | };
618 | /* End PBXTargetDependency section */
619 |
620 | /* Begin PBXVariantGroup section */
621 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = {
622 | isa = PBXVariantGroup;
623 | children = (
624 | 13B07FB21A68108700A75B9A /* Base */,
625 | );
626 | name = LaunchScreen.xib;
627 | path = BBCNews;
628 | sourceTree = "";
629 | };
630 | /* End PBXVariantGroup section */
631 |
632 | /* Begin XCBuildConfiguration section */
633 | 00E356F61AD99517003FC87E /* Debug */ = {
634 | isa = XCBuildConfiguration;
635 | buildSettings = {
636 | BUNDLE_LOADER = "$(TEST_HOST)";
637 | FRAMEWORK_SEARCH_PATHS = (
638 | "$(SDKROOT)/Developer/Library/Frameworks",
639 | "$(inherited)",
640 | );
641 | GCC_PREPROCESSOR_DEFINITIONS = (
642 | "DEBUG=1",
643 | "$(inherited)",
644 | );
645 | INFOPLIST_FILE = BBCNewsTests/Info.plist;
646 | IPHONEOS_DEPLOYMENT_TARGET = 8.2;
647 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
648 | PRODUCT_NAME = "$(TARGET_NAME)";
649 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/BBCNews.app/BBCNews";
650 | };
651 | name = Debug;
652 | };
653 | 00E356F71AD99517003FC87E /* Release */ = {
654 | isa = XCBuildConfiguration;
655 | buildSettings = {
656 | BUNDLE_LOADER = "$(TEST_HOST)";
657 | COPY_PHASE_STRIP = NO;
658 | FRAMEWORK_SEARCH_PATHS = (
659 | "$(SDKROOT)/Developer/Library/Frameworks",
660 | "$(inherited)",
661 | );
662 | INFOPLIST_FILE = BBCNewsTests/Info.plist;
663 | IPHONEOS_DEPLOYMENT_TARGET = 8.2;
664 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
665 | PRODUCT_NAME = "$(TARGET_NAME)";
666 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/BBCNews.app/BBCNews";
667 | };
668 | name = Release;
669 | };
670 | 13B07F941A680F5B00A75B9A /* Debug */ = {
671 | isa = XCBuildConfiguration;
672 | buildSettings = {
673 | ALWAYS_SEARCH_USER_PATHS = NO;
674 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
675 | DEAD_CODE_STRIPPING = NO;
676 | HEADER_SEARCH_PATHS = (
677 | "$(inherited)",
678 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
679 | "$(SRCROOT)/../node_modules/react-native/React/**",
680 | );
681 | INFOPLIST_FILE = BBCNews/Info.plist;
682 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
683 | OTHER_LDFLAGS = "-ObjC";
684 | PRODUCT_NAME = BBCNews;
685 | USER_HEADER_SEARCH_PATHS = "";
686 | };
687 | name = Debug;
688 | };
689 | 13B07F951A680F5B00A75B9A /* Release */ = {
690 | isa = XCBuildConfiguration;
691 | buildSettings = {
692 | ALWAYS_SEARCH_USER_PATHS = NO;
693 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
694 | DEAD_CODE_STRIPPING = NO;
695 | HEADER_SEARCH_PATHS = (
696 | "$(inherited)",
697 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
698 | "$(SRCROOT)/../node_modules/react-native/React/**",
699 | );
700 | INFOPLIST_FILE = BBCNews/Info.plist;
701 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
702 | OTHER_LDFLAGS = "-ObjC";
703 | PRODUCT_NAME = BBCNews;
704 | USER_HEADER_SEARCH_PATHS = "";
705 | };
706 | name = Release;
707 | };
708 | 83CBBA201A601CBA00E9B192 /* Debug */ = {
709 | isa = XCBuildConfiguration;
710 | buildSettings = {
711 | ALWAYS_SEARCH_USER_PATHS = NO;
712 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
713 | CLANG_CXX_LIBRARY = "libc++";
714 | CLANG_ENABLE_MODULES = YES;
715 | CLANG_ENABLE_OBJC_ARC = YES;
716 | CLANG_WARN_BOOL_CONVERSION = YES;
717 | CLANG_WARN_CONSTANT_CONVERSION = YES;
718 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
719 | CLANG_WARN_EMPTY_BODY = YES;
720 | CLANG_WARN_ENUM_CONVERSION = YES;
721 | CLANG_WARN_INT_CONVERSION = YES;
722 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
723 | CLANG_WARN_UNREACHABLE_CODE = YES;
724 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
725 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
726 | COPY_PHASE_STRIP = NO;
727 | ENABLE_STRICT_OBJC_MSGSEND = YES;
728 | GCC_C_LANGUAGE_STANDARD = gnu99;
729 | GCC_DYNAMIC_NO_PIC = NO;
730 | GCC_OPTIMIZATION_LEVEL = 0;
731 | GCC_PREPROCESSOR_DEFINITIONS = (
732 | "DEBUG=1",
733 | "$(inherited)",
734 | );
735 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
736 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
737 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
738 | GCC_WARN_UNDECLARED_SELECTOR = YES;
739 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
740 | GCC_WARN_UNUSED_FUNCTION = YES;
741 | GCC_WARN_UNUSED_VARIABLE = YES;
742 | HEADER_SEARCH_PATHS = (
743 | "$(inherited)",
744 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
745 | "$(SRCROOT)/../node_modules/react-native/React/**",
746 | );
747 | IPHONEOS_DEPLOYMENT_TARGET = 7.0;
748 | MTL_ENABLE_DEBUG_INFO = YES;
749 | ONLY_ACTIVE_ARCH = YES;
750 | SDKROOT = iphoneos;
751 | };
752 | name = Debug;
753 | };
754 | 83CBBA211A601CBA00E9B192 /* Release */ = {
755 | isa = XCBuildConfiguration;
756 | buildSettings = {
757 | ALWAYS_SEARCH_USER_PATHS = NO;
758 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
759 | CLANG_CXX_LIBRARY = "libc++";
760 | CLANG_ENABLE_MODULES = YES;
761 | CLANG_ENABLE_OBJC_ARC = YES;
762 | CLANG_WARN_BOOL_CONVERSION = YES;
763 | CLANG_WARN_CONSTANT_CONVERSION = YES;
764 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
765 | CLANG_WARN_EMPTY_BODY = YES;
766 | CLANG_WARN_ENUM_CONVERSION = YES;
767 | CLANG_WARN_INT_CONVERSION = YES;
768 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
769 | CLANG_WARN_UNREACHABLE_CODE = YES;
770 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
771 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
772 | COPY_PHASE_STRIP = YES;
773 | ENABLE_NS_ASSERTIONS = NO;
774 | ENABLE_STRICT_OBJC_MSGSEND = YES;
775 | GCC_C_LANGUAGE_STANDARD = gnu99;
776 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
777 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
778 | GCC_WARN_UNDECLARED_SELECTOR = YES;
779 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
780 | GCC_WARN_UNUSED_FUNCTION = YES;
781 | GCC_WARN_UNUSED_VARIABLE = YES;
782 | HEADER_SEARCH_PATHS = (
783 | "$(inherited)",
784 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
785 | "$(SRCROOT)/../node_modules/react-native/React/**",
786 | );
787 | IPHONEOS_DEPLOYMENT_TARGET = 7.0;
788 | MTL_ENABLE_DEBUG_INFO = NO;
789 | SDKROOT = iphoneos;
790 | VALIDATE_PRODUCT = YES;
791 | };
792 | name = Release;
793 | };
794 | /* End XCBuildConfiguration section */
795 |
796 | /* Begin XCConfigurationList section */
797 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "BBCNewsTests" */ = {
798 | isa = XCConfigurationList;
799 | buildConfigurations = (
800 | 00E356F61AD99517003FC87E /* Debug */,
801 | 00E356F71AD99517003FC87E /* Release */,
802 | );
803 | defaultConfigurationIsVisible = 0;
804 | defaultConfigurationName = Release;
805 | };
806 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "BBCNews" */ = {
807 | isa = XCConfigurationList;
808 | buildConfigurations = (
809 | 13B07F941A680F5B00A75B9A /* Debug */,
810 | 13B07F951A680F5B00A75B9A /* Release */,
811 | );
812 | defaultConfigurationIsVisible = 0;
813 | defaultConfigurationName = Release;
814 | };
815 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "BBCNews" */ = {
816 | isa = XCConfigurationList;
817 | buildConfigurations = (
818 | 83CBBA201A601CBA00E9B192 /* Debug */,
819 | 83CBBA211A601CBA00E9B192 /* Release */,
820 | );
821 | defaultConfigurationIsVisible = 0;
822 | defaultConfigurationName = Release;
823 | };
824 | /* End XCConfigurationList section */
825 | };
826 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;
827 | }
828 |
--------------------------------------------------------------------------------
/ios/BBCNews.xcodeproj/xcshareddata/xcschemes/BBCNews.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
38 |
39 |
44 |
45 |
47 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
65 |
66 |
67 |
68 |
78 |
80 |
86 |
87 |
88 |
89 |
90 |
91 |
97 |
99 |
105 |
106 |
107 |
108 |
110 |
111 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/ios/BBCNews/AppDelegate.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | @interface AppDelegate : UIResponder
13 |
14 | @property (nonatomic, strong) UIWindow *window;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/ios/BBCNews/AppDelegate.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "AppDelegate.h"
11 |
12 | #import "RCTRootView.h"
13 |
14 | @implementation AppDelegate
15 |
16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
17 | {
18 | NSURL *jsCodeLocation;
19 |
20 | /**
21 | * Loading JavaScript code - uncomment the one you want.
22 | *
23 | * OPTION 1
24 | * Load from development server. Start the server from the repository root:
25 | *
26 | * $ npm start
27 | *
28 | * To run on device, change `localhost` to the IP address of your computer
29 | * (you can get this by typing `ifconfig` into the terminal and selecting the
30 | * `inet` value under `en0:`) and make sure your computer and iOS device are
31 | * on the same Wi-Fi network.
32 | */
33 |
34 | jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];
35 |
36 |
37 | /**
38 | * OPTION 2
39 | * Load from pre-bundled file on disk. The static bundle is automatically
40 | * generated by "Bundle React Native code and images" build step.
41 | */
42 |
43 | // jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
44 |
45 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
46 | moduleName:@"BBCNews"
47 | initialProperties:nil
48 | launchOptions:launchOptions];
49 |
50 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
51 | UIViewController *rootViewController = [UIViewController new];
52 | rootViewController.view = rootView;
53 | self.window.rootViewController = rootViewController;
54 | [self.window makeKeyAndVisible];
55 | return YES;
56 | }
57 |
58 | @end
59 |
--------------------------------------------------------------------------------
/ios/BBCNews/Base.lproj/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
21 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/ios/BBCNews/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/ios/BBCNews/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UIViewControllerBasedStatusBarAppearance
38 |
39 | NSLocationWhenInUseUsageDescription
40 |
41 | NSAppTransportSecurity
42 |
43 |
44 | NSAllowsArbitraryLoads
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/ios/BBCNews/main.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import "AppDelegate.h"
13 |
14 | int main(int argc, char * argv[]) {
15 | @autoreleasepool {
16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/ios/BBCNewsTests/BBCNewsTests.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 | #import
12 |
13 | #import "RCTLog.h"
14 | #import "RCTRootView.h"
15 |
16 | #define TIMEOUT_SECONDS 240
17 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!"
18 |
19 | @interface BBCNewsTests : XCTestCase
20 |
21 | @end
22 |
23 | @implementation BBCNewsTests
24 |
25 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test
26 | {
27 | if (test(view)) {
28 | return YES;
29 | }
30 | for (UIView *subview in [view subviews]) {
31 | if ([self findSubviewInView:subview matching:test]) {
32 | return YES;
33 | }
34 | }
35 | return NO;
36 | }
37 |
38 | - (void)testRendersWelcomeScreen
39 | {
40 | UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController];
41 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
42 | BOOL foundElement = NO;
43 |
44 | __block NSString *redboxError = nil;
45 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
46 | if (level >= RCTLogLevelError) {
47 | redboxError = message;
48 | }
49 | });
50 |
51 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
52 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
53 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
54 |
55 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) {
56 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
57 | return YES;
58 | }
59 | return NO;
60 | }];
61 | }
62 |
63 | RCTSetLogFunction(RCTDefaultLogFunction);
64 |
65 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
66 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
67 | }
68 |
69 |
70 | @end
71 |
--------------------------------------------------------------------------------
/ios/BBCNewsTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/ios/PCAngularActivityIndicatorView.h:
--------------------------------------------------------------------------------
1 | //
2 | // PCAngularActivityIndicatorView.h
3 | //
4 | // Copyright (c) 2014 Phillip Caudell phillipcaudell@gmail.com
5 | //
6 | // The MIT License
7 | //
8 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11 | //
12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13 | //
14 |
15 | #import
16 |
17 | typedef NS_ENUM(NSInteger, PCAngularActivityIndicatorViewStyle) {
18 | PCAngularActivityIndicatorViewStyleSmall,
19 | PCAngularActivityIndicatorViewStyleDefault,
20 | PCAngularActivityIndicatorViewStyleLarge
21 | };
22 |
23 | /**
24 | Use an activity indicator to show that a task is in progress. An activity indicator appears as a “spiral” that is either spinning or stopped.
25 |
26 | You control when an activity indicator animates by calling the startAnimating and stopAnimating methods. To automatically hide the activity indicator when animation stops, set the hidesWhenStopped property to YES.
27 | */
28 | @interface PCAngularActivityIndicatorView : UIView
29 |
30 | /**
31 | The color of the activity indicator.
32 | */
33 | @property (nonatomic, strong) UIColor *color;
34 |
35 | /**
36 | Returns whether the receiver is animating.
37 | */
38 | @property (nonatomic, readonly, getter = isAnimating) BOOL animating;
39 |
40 | /**
41 | The basic appearance of the activity indicator.
42 | */
43 | @property (nonatomic, assign) PCAngularActivityIndicatorViewStyle activityIndicatorViewStyle;
44 |
45 | /**
46 | A Boolean value that controls whether the receiver is hidden when the animation is stopped.
47 | */
48 | @property (nonatomic, assign) BOOL hidesWhenStopped;
49 |
50 | /**
51 | Initializes and returns an activity-indicator object.
52 | @param style An enum that specifies the style of the object to be created.
53 | */
54 | - (id)initWithActivityIndicatorStyle:(PCAngularActivityIndicatorViewStyle)style;
55 |
56 | - (id)initWithCustomSize:(CGSize)size lineWidth:(CGFloat)lineWidth andDuration:(CGFloat)duration;
57 |
58 | /**
59 | Starts the animation of the progress indicator.
60 | */
61 | - (void)startAnimating;
62 |
63 | /**
64 | Stops the animation of the progress indicator.
65 | */
66 | - (void)stopAnimating;
67 |
68 | @end
69 |
--------------------------------------------------------------------------------
/ios/PCAngularActivityIndicatorView.m:
--------------------------------------------------------------------------------
1 | //
2 | // PCAngularActivityIndicatorView.m
3 | //
4 | // Copyright (c) 2014 Phillip Caudell phillipcaudell@gmail.com
5 | //
6 | // The MIT License
7 | //
8 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9 | //
10 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11 | //
12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13 | //
14 |
15 | #import "PCAngularActivityIndicatorView.h"
16 |
17 | @interface PCAngularActivityIndicatorView ()
18 |
19 | @property (nonatomic, strong) CAShapeLayer *shapeLayer;
20 | @property (nonatomic, strong) UIView *contentView;
21 | @property (nonatomic, assign) CGFloat duration;
22 |
23 | @end
24 |
25 | @implementation PCAngularActivityIndicatorView
26 |
27 | - (id)init
28 | {
29 | return [self initWithActivityIndicatorStyle:PCAngularActivityIndicatorViewStyleDefault];
30 | }
31 |
32 | - (id)initWithCustomSize:(CGSize)size lineWidth:(CGFloat)lineWidth andDuration:(CGFloat)duration
33 | {
34 | CGRect frame = CGRectMake(0, 0, size.width, size.height);
35 |
36 | if (self = [super initWithFrame:frame]) {
37 | self.contentView = [[UIView alloc] initWithFrame:self.bounds];
38 |
39 | [self addSubview:self.contentView];
40 |
41 | CGFloat radius = frame.size.width / 2;
42 |
43 | self.shapeLayer = [CAShapeLayer layer];
44 | self.shapeLayer.frame = self.bounds;
45 | self.shapeLayer.lineWidth = lineWidth;
46 | self.shapeLayer.fillColor = [[UIColor clearColor] CGColor];
47 | self.shapeLayer.path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, 2.0 * radius, 2.0 * radius) cornerRadius:radius].CGPath;
48 | self.shapeLayer.lineCap = kCALineJoinRound;
49 | self.shapeLayer.hidden = YES;
50 | [self.contentView.layer insertSublayer:self.shapeLayer atIndex:0];
51 |
52 | // Defaults
53 | self.hidesWhenStopped = YES;
54 | self.duration = duration;
55 | self.color = [UIColor blueColor];
56 |
57 | }
58 |
59 | return self;
60 | }
61 |
62 | - (id)initWithActivityIndicatorStyle:(PCAngularActivityIndicatorViewStyle)style
63 | {
64 | CGRect frame;
65 | CGFloat lineWidth;
66 | CGFloat duration;
67 |
68 | switch (style) {
69 | case PCAngularActivityIndicatorViewStyleSmall:
70 | frame = CGRectMake(0, 0, 20, 20);
71 | lineWidth = 2.0;
72 | duration = 0.8;
73 | break;
74 | case PCAngularActivityIndicatorViewStyleDefault:
75 | frame = CGRectMake(0, 0, 30, 30);
76 | lineWidth = 4.0;
77 | duration = 0.8;
78 | break;
79 | case PCAngularActivityIndicatorViewStyleLarge:
80 | frame = CGRectMake(0, 0, 60, 60);
81 | lineWidth = 8.0;
82 | duration = 1.0;
83 | break;
84 | default:
85 | break;
86 | }
87 |
88 | if (self = [super initWithFrame:frame]) {
89 |
90 | self.contentView = [[UIView alloc] initWithFrame:self.bounds];
91 | [self addSubview:self.contentView];
92 |
93 | CGFloat radius = frame.size.width / 2;
94 |
95 | self.shapeLayer = [CAShapeLayer layer];
96 | self.shapeLayer.frame = self.bounds;
97 | self.shapeLayer.lineWidth = lineWidth;
98 | self.shapeLayer.fillColor = [[UIColor clearColor] CGColor];
99 | self.shapeLayer.path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, 2.0 * radius, 2.0 * radius) cornerRadius:radius].CGPath;
100 | self.shapeLayer.lineCap = kCALineJoinRound;
101 | self.shapeLayer.hidden = YES;
102 | [self.contentView.layer insertSublayer:self.shapeLayer atIndex:0];
103 |
104 | // Defaults
105 | self.hidesWhenStopped = YES;
106 | self.duration = duration;
107 | self.color = [UIColor lightGrayColor];
108 | }
109 |
110 | return self;
111 | }
112 |
113 | - (void)startAnimating
114 | {
115 | if (self.isAnimating) {
116 | return;
117 | }
118 |
119 | _animating = YES;
120 |
121 | CAKeyframeAnimation *inAnimation = [CAKeyframeAnimation animationWithKeyPath:@"strokeEnd"];
122 | inAnimation.duration = self.duration;
123 | inAnimation.values = @[@(0), @(1)];
124 |
125 | CAKeyframeAnimation *outAnimation = [CAKeyframeAnimation animationWithKeyPath:@"strokeStart"];
126 | outAnimation.duration = self.duration;
127 | outAnimation.values = @[@(0), @(0.8), @(1)];
128 | outAnimation.beginTime = self.duration / 1.5;
129 |
130 | CAAnimationGroup *groupAnimation = [CAAnimationGroup animation];
131 | groupAnimation.animations = @[inAnimation, outAnimation];
132 | groupAnimation.duration = self.duration + outAnimation.beginTime;
133 | groupAnimation.repeatCount = INFINITY;
134 | groupAnimation.delegate = self;
135 |
136 | CABasicAnimation *rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
137 | rotationAnimation.fromValue = @(0);
138 | rotationAnimation.toValue = @(M_PI * 2);
139 | rotationAnimation.duration = self.duration * 1.5;
140 | rotationAnimation.repeatCount = INFINITY;
141 |
142 | [self.shapeLayer addAnimation:rotationAnimation forKey:nil];
143 | [self.shapeLayer addAnimation:groupAnimation forKey:nil];
144 |
145 | self.shapeLayer.hidden = NO;
146 | }
147 |
148 | - (void)stopAnimating
149 | {
150 | [UIView animateWithDuration:0.5 animations:^{
151 |
152 | // Nice fade and ride
153 | self.contentView.transform = CGAffineTransformMakeScale(1.2, 1.2);
154 | self.contentView.alpha = 0.0;
155 |
156 | } completion:^(BOOL finished) {
157 |
158 | _animating = NO;
159 |
160 | /// ...and reset back
161 | self.contentView.transform = CGAffineTransformMakeScale(1.0, 1.0);
162 | self.contentView.alpha = 1.0;
163 |
164 | self.shapeLayer.hidden = self.hidesWhenStopped;
165 | [self.shapeLayer removeAllAnimations];
166 | }];
167 | }
168 |
169 | - (void)setColor:(UIColor *)color
170 | {
171 | [self willChangeValueForKey:@"color"];
172 |
173 | _color = color;
174 | self.shapeLayer.strokeColor = [color CGColor];
175 |
176 | [self didChangeValueForKey:@"color"];
177 | }
178 |
179 | @end
180 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "BBCNews",
3 | "version": "0.0.1",
4 | "private": true,
5 | "scripts": {
6 | "start": "node_modules/react-native/packager/packager.sh"
7 | },
8 | "dependencies": {
9 | "htmlparser": "^1.7.7",
10 | "moment": "^2.11.1",
11 | "react-native": "^0.19.0",
12 | "react-native-angular-activity-indicator": "0.0.3",
13 | "react-native-linear-gradient": "^1.4.0",
14 | "react-native-video": "^0.6.1"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------