diff --git a/.expo/packager-info.json b/.expo/packager-info.json new file mode 100644 index 00000000..78bc0fd3 --- /dev/null +++ b/.expo/packager-info.json @@ -0,0 +1,9 @@ +{ + "expoServerPort": 19000, + "packagerPort": 19001, + "packagerPid": 6116, + "devToolsPort": 19002, + "expoServerNgrokUrl": "https://vc-2j2.anonymous.massa.exp.direct", + "packagerNgrokUrl": "https://packager.vc-2j2.anonymous.massa.exp.direct", + "ngrokPid": 9708 +} \ No newline at end of file diff --git a/.expo/settings.json b/.expo/settings.json new file mode 100644 index 00000000..8fc14b98 --- /dev/null +++ b/.expo/settings.json @@ -0,0 +1,9 @@ +{ + "hostType": "tunnel", + "lanType": "ip", + "dev": true, + "strict": false, + "minify": false, + "urlType": "exp", + "urlRandomness": "vc-2j2" +} \ No newline at end of file diff --git a/README.md b/README.md index 6d29bafc..f01aab9e 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,10 @@ Change Directory To Massa $ npm install $ npm start ``` +If Not Worked +``` + $ expo start +``` ## Screenshots ![ss](https://user-images.githubusercontent.com/17242746/47492102-db776200-d869-11e8-9a06-d2a48ffdcb3d.png) diff --git a/app.json b/app.json index 879b493e..6f731c5d 100644 --- a/app.json +++ b/app.json @@ -22,6 +22,9 @@ }, "ios": { "supportsTablet": true + }, + "android": { + "package": "com.test.testa" } } } diff --git a/js/App.js b/js/App.js index 204ac9a3..c7504ca5 100644 --- a/js/App.js +++ b/js/App.js @@ -1,8 +1,7 @@ /* @flow */ import React from 'react'; -import { Constants, ScreenOrientation } from 'expo'; - +import { Constants, ScreenOrientation , Permissions, Notifications} from 'expo'; ScreenOrientation.allow(ScreenOrientation.Orientation.ALL); import { @@ -20,6 +19,7 @@ import Banner from './Banner'; import SimpleStack from './SimpleStack'; import SimpleTabs from './SimpleTabs'; import TabAnimations from './TabAnimations'; + const ExampleRoutes = { SimpleStack: { name: 'Massa Login', @@ -34,12 +34,47 @@ const ExampleRoutes = { description: 'To see invited friends and their download progress as well as chat with them', screen: SimpleTabs, }}; + + class MainScreen extends React.Component<*> { + constructor(props) { + super(props); + + } + componentDidMount = () => { + this.getGCMToken(); + } + getGCMToken = async() => { + const { status: existingStatus } = await Permissions.getAsync( + Permissions.NOTIFICATIONS + ); + let finalStatus = existingStatus; + + // only ask if permissions have not already been determined, because + // iOS won't necessarily prompt the user a second time. + if (existingStatus !== "granted") { + // Android remote notification permissions are granted during the app + // install, so this will only ask on iOS + const { status } = await Permissions.askAsync(Permissions.NOTIFICATIONS); + finalStatus = status; + } + + // Stop here if the user did not grant permissions + if (finalStatus !== "granted") { + return; + } + + // Get the token that uniquely identifies this device + let token = await Notifications.getExpoPushTokenAsync(); + + } render() { const { navigation } = this.props; return ( + +