-
Notifications
You must be signed in to change notification settings - Fork 40
/
index.js
31 lines (26 loc) · 825 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import React from 'react'
import { AppRegistry } from 'react-native';
import App from 'AWSTwitter/App';
import Provider from 'AWSTwitter/src/mobx'
import Amplify, { Auth} from 'aws-amplify'
import AWSAppSyncClient from 'aws-appsync'
import config from './src/aws-exports'
import { ApolloProvider } from 'react-apollo'
const client = new AWSAppSyncClient({
url: '<YOURAPPSYNCENDPOINT>',
region: 'us-east-1',
auth: {
type: 'AMAZON_COGNITO_USER_POOLS',
jwtToken: async () => (await Auth.currentSession()).getIdToken().getJwtToken(),
}
})
Amplify.configure(config)
const AppWithData = () => (
<Provider>
<ApolloProvider client={client}>
<App />
</ApolloProvider>
</Provider>
)
console.ignoredYellowBox = ['Warning', 'Remote']
AppRegistry.registerComponent('AWSTwitter', () => AppWithData);