├── .watchmanconfig
├── App
├── Config
│ ├── .gitignore
│ ├── index.dev.js
│ ├── index.staging.js
│ ├── index.production.js
│ └── README.md
├── package.json
├── Theme
│ ├── README.md
│ ├── Images.js
│ ├── index.js
│ ├── Colors.js
│ ├── Fonts.js
│ ├── Metrics.js
│ ├── ApplicationStyles.js
│ └── Helpers.js
├── Assets
│ ├── Images
│ │ ├── icon.png
│ │ ├── logo.png
│ │ └── TOM-Legend.png
│ └── README.md
├── Services
│ ├── README.md
│ ├── GunService.js
│ ├── IrisService.js
│ └── NavigationService.js
├── Navigators
│ ├── README.md
│ └── AppNavigator.js
├── Components
│ ├── README.md
│ ├── Button.js
│ ├── ListItem.js
│ ├── Svg.js
│ ├── Identicon.js
│ └── ChatListItem.js
├── Containers
│ ├── README.md
│ ├── Root
│ │ ├── RootScreenStyle.js
│ │ └── RootScreen.js
│ ├── SplashScreen
│ │ ├── SplashScreen.js
│ │ └── SplashScreenStyle.js
│ ├── ScanChatLink
│ │ ├── Style.js
│ │ └── Scan.js
│ ├── ScanPrivateKey
│ │ ├── Style.js
│ │ └── Scan.js
│ ├── Contacts
│ │ ├── Share.js
│ │ ├── Style.js
│ │ ├── Show.js
│ │ ├── Create.js
│ │ └── List.js
│ ├── Settings
│ │ ├── ShowPrivateKeyScreen.js
│ │ ├── SettingsScreenStyle.js
│ │ ├── SettingsScreen.js
│ │ ├── EditPhotoScreen.js
│ │ ├── EditProfileScreen.js
│ │ └── PeersScreen.js
│ ├── Welcome
│ │ ├── WelcomeScreenStyle.js
│ │ └── WelcomeScreen.js
│ ├── Chat
│ │ ├── Style.js
│ │ ├── Create.js
│ │ ├── Show.js
│ │ └── List.js
│ └── Login
│ │ ├── LoginScreenStyle.js
│ │ └── LoginScreen.js
└── App.js
├── android
├── app
│ ├── src
│ │ ├── main
│ │ │ ├── assets
│ │ │ │ └── blank.html
│ │ │ ├── res
│ │ │ │ ├── values
│ │ │ │ │ ├── strings.xml
│ │ │ │ │ └── styles.xml
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ └── mipmap-xxxhdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ └── ic_launcher_round.png
│ │ │ ├── java
│ │ │ │ └── com
│ │ │ │ │ └── iris
│ │ │ │ │ ├── MainActivity.java
│ │ │ │ │ └── MainApplication.java
│ │ │ └── AndroidManifest.xml
│ │ ├── debug
│ │ │ ├── AndroidManifest.xml
│ │ │ └── google-services.json
│ │ └── release
│ │ │ └── google-services.json
│ ├── proguard-rules.pro
│ ├── build_defs.bzl
│ ├── google-services.json
│ ├── BUCK
│ └── build.gradle
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── .gitignore
├── settings.gradle
├── gradle.properties
├── build.gradle
├── gradlew.bat
└── gradlew
├── app.json
├── .eslintignore
├── .prettierignore
├── babel.config.js
├── screenshots
├── screen1.png
├── screen2.png
└── screen3.png
├── ios
├── Iris
│ ├── Images.xcassets
│ │ ├── Contents.json
│ │ ├── AppIcon.appiconset
│ │ │ ├── 120.png
│ │ │ ├── 180.png
│ │ │ ├── 40.png
│ │ │ ├── 58.png
│ │ │ ├── 60.png
│ │ │ ├── 80.png
│ │ │ ├── 87.png
│ │ │ ├── 1024.png
│ │ │ ├── 120-1.png
│ │ │ └── Contents.json
│ │ └── Lollero.imageset
│ │ │ ├── iris_icon_blue_rgb_1536.png
│ │ │ └── Contents.json
│ ├── Iris.entitlements
│ ├── AppDelegate.h
│ ├── main.m
│ ├── AppDelegate.m
│ ├── Base.lproj
│ │ └── LaunchScreen.xib
│ └── Info.plist
├── .gitignore
├── Iris.xcworkspace
│ ├── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
│ └── contents.xcworkspacedata
├── IrisTests
│ ├── Info.plist
│ └── IrisTests.m
├── Iris-tvOSTests
│ └── Info.plist
├── Iris-tvOS
│ └── Info.plist
├── Podfile
├── Iris.xcodeproj
│ └── xcshareddata
│ │ └── xcschemes
│ │ ├── Iris.xcscheme
│ │ └── Iris-tvOS.xcscheme
└── Podfile.lock
├── .babelrc
├── .buckconfig
├── .gitlab-ci.yml
├── __tests__
└── App-test.js
├── metro.config.js
├── .prettierrc
├── index.js
├── README.md
├── .github
└── ISSUE_TEMPLATE
│ ├── feature_request.md
│ └── bug_report.md
├── .eslintrc
├── .gitattributes
├── .gitignore
├── LICENSE
├── package.json
├── .flowconfig
└── docs
├── setup cocoapods.md
└── beta builds.md
/.watchmanconfig:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/App/Config/.gitignore:
--------------------------------------------------------------------------------
1 | index.js
--------------------------------------------------------------------------------
/App/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "App"
3 | }
4 |
--------------------------------------------------------------------------------
/android/app/src/main/assets/blank.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Iris",
3 | "displayName": "Iris"
4 | }
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | node_modules/**
2 | android/**
3 | ios/**
4 | __tests__/**
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | node_modules/**
2 | android/**
3 | ios/**
4 | __tests__/**
--------------------------------------------------------------------------------
/App/Theme/README.md:
--------------------------------------------------------------------------------
1 | This directory contains the base for the application styles.
2 |
--------------------------------------------------------------------------------
/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: ['module:metro-react-native-babel-preset'],
3 | }
4 |
--------------------------------------------------------------------------------
/screenshots/screen1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/irislib/iris-mobile/HEAD/screenshots/screen1.png
--------------------------------------------------------------------------------
/screenshots/screen2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/irislib/iris-mobile/HEAD/screenshots/screen2.png
--------------------------------------------------------------------------------
/screenshots/screen3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/irislib/iris-mobile/HEAD/screenshots/screen3.png
--------------------------------------------------------------------------------
/App/Assets/Images/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/irislib/iris-mobile/HEAD/App/Assets/Images/icon.png
--------------------------------------------------------------------------------
/App/Assets/Images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/irislib/iris-mobile/HEAD/App/Assets/Images/logo.png
--------------------------------------------------------------------------------
/App/Assets/Images/TOM-Legend.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/irislib/iris-mobile/HEAD/App/Assets/Images/TOM-Legend.png
--------------------------------------------------------------------------------
/App/Config/index.dev.js:
--------------------------------------------------------------------------------
1 | export const Config = {
2 | API_URL: 'https://jsonplaceholder.typicode.com/users/',
3 | }
4 |
--------------------------------------------------------------------------------
/App/Config/index.staging.js:
--------------------------------------------------------------------------------
1 | export const Config = {
2 | API_URL: 'https://jsonplaceholder.typicode.com/users/',
3 | }
4 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Iris
3 |
4 |
--------------------------------------------------------------------------------
/ios/Iris/Images.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "env": {
3 | "production": {
4 | "plugins": ["transform-remove-console"]
5 | }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/App/Config/index.production.js:
--------------------------------------------------------------------------------
1 | export const Config = {
2 | API_URL: 'https://jsonplaceholder.typicode.com/users/',
3 | }
4 |
--------------------------------------------------------------------------------
/App/Services/README.md:
--------------------------------------------------------------------------------
1 | This directory contains application services, for example services to connect the application to APIs.
2 |
--------------------------------------------------------------------------------
/App/Assets/README.md:
--------------------------------------------------------------------------------
1 | This directory contains all the assets files (i.e. images, audio files or videos...) used by the application.
2 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/irislib/iris-mobile/HEAD/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/.buckconfig:
--------------------------------------------------------------------------------
1 |
2 | [android]
3 | target = Google Inc.:Google APIs:23
4 |
5 | [maven_repositories]
6 | central = https://repo1.maven.org/maven2
7 |
--------------------------------------------------------------------------------
/ios/Iris/Images.xcassets/AppIcon.appiconset/120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/irislib/iris-mobile/HEAD/ios/Iris/Images.xcassets/AppIcon.appiconset/120.png
--------------------------------------------------------------------------------
/ios/Iris/Images.xcassets/AppIcon.appiconset/180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/irislib/iris-mobile/HEAD/ios/Iris/Images.xcassets/AppIcon.appiconset/180.png
--------------------------------------------------------------------------------
/ios/Iris/Images.xcassets/AppIcon.appiconset/40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/irislib/iris-mobile/HEAD/ios/Iris/Images.xcassets/AppIcon.appiconset/40.png
--------------------------------------------------------------------------------
/ios/Iris/Images.xcassets/AppIcon.appiconset/58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/irislib/iris-mobile/HEAD/ios/Iris/Images.xcassets/AppIcon.appiconset/58.png
--------------------------------------------------------------------------------
/ios/Iris/Images.xcassets/AppIcon.appiconset/60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/irislib/iris-mobile/HEAD/ios/Iris/Images.xcassets/AppIcon.appiconset/60.png
--------------------------------------------------------------------------------
/ios/Iris/Images.xcassets/AppIcon.appiconset/80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/irislib/iris-mobile/HEAD/ios/Iris/Images.xcassets/AppIcon.appiconset/80.png
--------------------------------------------------------------------------------
/ios/Iris/Images.xcassets/AppIcon.appiconset/87.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/irislib/iris-mobile/HEAD/ios/Iris/Images.xcassets/AppIcon.appiconset/87.png
--------------------------------------------------------------------------------
/App/Navigators/README.md:
--------------------------------------------------------------------------------
1 | This directory contains your main Navigator (AppNavigator.js)
2 |
3 | You can add nested navigators on this folder if you need it.
4 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/irislib/iris-mobile/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/irislib/iris-mobile/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/irislib/iris-mobile/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/irislib/iris-mobile/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ios/Iris/Images.xcassets/AppIcon.appiconset/1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/irislib/iris-mobile/HEAD/ios/Iris/Images.xcassets/AppIcon.appiconset/1024.png
--------------------------------------------------------------------------------
/ios/Iris/Images.xcassets/AppIcon.appiconset/120-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/irislib/iris-mobile/HEAD/ios/Iris/Images.xcassets/AppIcon.appiconset/120-1.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/irislib/iris-mobile/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/irislib/iris-mobile/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/irislib/iris-mobile/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/irislib/iris-mobile/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/irislib/iris-mobile/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/irislib/iris-mobile/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/ios/Iris/Images.xcassets/Lollero.imageset/iris_icon_blue_rgb_1536.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/irislib/iris-mobile/HEAD/ios/Iris/Images.xcassets/Lollero.imageset/iris_icon_blue_rgb_1536.png
--------------------------------------------------------------------------------
/App/Components/README.md:
--------------------------------------------------------------------------------
1 | This directory contains [presentational components](https://medium.com/@dan_abramov/smart-and-dumb-components-7ca2f9a7c7d0), i.e. React components responsible for the UI of the application.
2 |
--------------------------------------------------------------------------------
/App/Containers/README.md:
--------------------------------------------------------------------------------
1 | This directory contains [container components](https://medium.com/@dan_abramov/smart-and-dumb-components-7ca2f9a7c7d0), i.e. React components responsible for the logic of the application.
2 |
--------------------------------------------------------------------------------
/App/Services/GunService.js:
--------------------------------------------------------------------------------
1 | import {Gun, SEA} from 'gun/browser.ios.js';
2 | import GunOpen from 'gun/lib/open';
3 | import GunLoad from 'gun/lib/load';
4 |
5 | const gun = new Gun(['https://gun-us.herokuapp.com/gun']);
6 |
7 | export default gun;
8 |
--------------------------------------------------------------------------------
/App/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import RootScreen from './Containers/Root/RootScreen'
3 |
4 | export default class App extends Component {
5 | render() {
6 | return (
7 |
8 | )
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/.gitlab-ci.yml:
--------------------------------------------------------------------------------
1 | image: node:8.10.0
2 |
3 | cache:
4 | paths:
5 | - node_modules
6 |
7 | before_script:
8 | - yarn
9 |
10 | prettier:
11 | script:
12 | - npm run prettier-check
13 |
14 | eslint:
15 | script:
16 | - npm run lint-check
17 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/App/Containers/Root/RootScreenStyle.js:
--------------------------------------------------------------------------------
1 | import { StyleSheet } from 'react-native'
2 | import ApplicationStyles from 'App/Theme/ApplicationStyles'
3 |
4 | export default StyleSheet.create({
5 | container: {
6 | ...ApplicationStyles.screen.container,
7 | },
8 | })
9 |
--------------------------------------------------------------------------------
/App/Theme/Images.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Images should be stored in the `App/Images` directory and referenced using variables defined here.
3 | */
4 |
5 | export default {
6 | icon: require('App/Assets/Images/icon.png'),
7 | logo: require('App/Assets/Images/logo.png'),
8 | }
9 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | # fastlane specific
2 | fastlane/report.xml
3 |
4 | # deliver temporary files
5 | fastlane/Preview.html
6 |
7 | # snapshot generated screenshots
8 | fastlane/screenshots
9 |
10 | # scan temporary files
11 | fastlane/test_output
12 |
13 | # Fastlane builds
14 | builds/*
--------------------------------------------------------------------------------
/ios/Iris/Iris.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | aps-environment
6 | development
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | # fastlane specific
2 | fastlane/report.xml
3 |
4 | # deliver temporary files
5 | fastlane/Preview.html
6 |
7 | # snapshot generated screenshots
8 | fastlane/screenshots
9 |
10 | # scan temporary files
11 | fastlane/test_output
12 |
13 | # Faslane builds
14 | builds/*
15 | *.xcarchive
--------------------------------------------------------------------------------
/App/Theme/index.js:
--------------------------------------------------------------------------------
1 | import Colors from './Colors'
2 | import Fonts from './Fonts'
3 | import Metrics from './Metrics'
4 | import Images from './Images'
5 | import ApplicationStyles from './ApplicationStyles'
6 | import Helpers from './Helpers'
7 |
8 | export { Colors, Fonts, Images, Metrics, ApplicationStyles, Helpers }
9 |
--------------------------------------------------------------------------------
/ios/Iris.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/__tests__/App-test.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @format
3 | */
4 |
5 | import 'react-native';
6 | import React from 'react';
7 | import App from '../App/App';
8 |
9 | // Note: test renderer must be required after react-native.
10 | import renderer from 'react-test-renderer';
11 |
12 | jest.useFakeTimers();
13 |
14 | it('renders correctly', async () => {
15 | renderer.create();
16 | });
17 |
--------------------------------------------------------------------------------
/metro.config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Metro configuration for React Native
3 | * https://github.com/facebook/react-native
4 | *
5 | * @format
6 | */
7 |
8 | module.exports = {
9 | transformer: {
10 | getTransformOptions: async () => ({
11 | transform: {
12 | experimentalImportSupport: false,
13 | inlineRequires: false,
14 | },
15 | }),
16 | },
17 | }
18 |
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | printWidth : 100,
3 | tabWidth : 2,
4 | useTabs : false,
5 | semi : false,
6 | singleQuote : true,
7 | trailingComma : "es5",
8 | bracketSpacing : true,
9 | jsxBracketSameLine : false,
10 | arrowParens : "always",
11 | rangeStart : 0,
12 | parser : "babel",
13 | requirePragma : false,
14 | insertPragma : false,
15 | proseWrap : "preserve"
16 | }
17 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'Iris'
2 | include ':react-native-notifications'
3 | project(':react-native-notifications').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-notifications/lib/android/app/')
4 |
5 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
6 | include ':app'
7 |
--------------------------------------------------------------------------------
/App/Theme/Colors.js:
--------------------------------------------------------------------------------
1 | /**
2 | * This file contains the application's colors.
3 | *
4 | * Define color here instead of duplicating them throughout the components.
5 | * That allows to change them more easily later on.
6 | */
7 |
8 | export default {
9 | transparent: 'rgba(0,0,0,0)',
10 | //Example colors:
11 | text: '#212529',
12 | primary: '#007bff',
13 | success: '#28a745',
14 | error: '#dc3545',
15 | }
16 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Iris.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @format
3 | */
4 |
5 | import 'react-native-get-random-values'
6 | import '@gooddollar/gun-asyncstorage'
7 | import { Client } from 'bugsnag-react-native'
8 | const bugsnag = new Client("bb9298087eb87d2c78929a201ddb3e88")
9 | import { AppRegistry } from 'react-native'
10 | import App from './App/App'
11 | import { name as appName } from './app.json'
12 |
13 | AppRegistry.registerComponent(appName, () => App)
14 |
--------------------------------------------------------------------------------
/App/Theme/Fonts.js:
--------------------------------------------------------------------------------
1 | const size = {
2 | h1: 38,
3 | h2: 34,
4 | h3: 30,
5 | input: 18,
6 | regular: 17,
7 | medium: 14,
8 | small: 12,
9 | }
10 |
11 | const style = {
12 | h1: {
13 | fontSize: size.h1,
14 | },
15 | h2: {
16 | fontSize: size.h2,
17 | },
18 | h3: {
19 | fontSize: size.h3,
20 | },
21 | normal: {
22 | fontSize: size.regular,
23 | },
24 | }
25 |
26 | export default {
27 | size,
28 | style,
29 | }
30 |
--------------------------------------------------------------------------------
/ios/Iris/Images.xcassets/Lollero.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "iris_icon_blue_rgb_1536.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 12 March 2020:
2 |
3 | Basic features are working, but it's unusably slow. Using native crypto for SEA could be a solution.
4 |
5 | Play Store Beta release:
6 | https://play.google.com/apps/testing/to.iris.Iris
7 |
8 | APK:https://github.com/irislib/iris-mobile/releases
9 |
10 | Testflight pending
11 |
12 | 

13 |
--------------------------------------------------------------------------------
/ios/Iris/AppDelegate.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #import
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (nonatomic, strong) UIWindow *window;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/ios/Iris/main.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #import
9 |
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/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:
--------------------------------------------------------------------------------
/App/Containers/SplashScreen/SplashScreen.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { Text, View, Image } from 'react-native'
3 | import Style from './SplashScreenStyle'
4 | import { Images } from 'App/Theme'
5 |
6 | export default class SplashScreen extends React.Component {
7 | render() {
8 | return (
9 |
10 |
11 |
12 |
13 |
14 | )
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/App/Containers/ScanChatLink/Style.js:
--------------------------------------------------------------------------------
1 | import { StyleSheet } from 'react-native'
2 | import Fonts from 'App/Theme/Fonts'
3 | import ApplicationStyles from 'App/Theme/ApplicationStyles'
4 |
5 | export default StyleSheet.create({
6 | centerText: {
7 | flex: 1,
8 | fontSize: 18,
9 | padding: 32,
10 | color: '#777',
11 | },
12 | textBold: {
13 | fontWeight: '500',
14 | color: '#000',
15 | },
16 | buttonText: {
17 | fontSize: 21,
18 | color: 'rgb(0,122,255)',
19 | },
20 | buttonTouchable: {
21 | padding: 16,
22 | },
23 | })
24 |
--------------------------------------------------------------------------------
/App/Containers/ScanPrivateKey/Style.js:
--------------------------------------------------------------------------------
1 | import { StyleSheet } from 'react-native'
2 | import Fonts from 'App/Theme/Fonts'
3 | import ApplicationStyles from 'App/Theme/ApplicationStyles'
4 |
5 | export default StyleSheet.create({
6 | centerText: {
7 | flex: 1,
8 | fontSize: 18,
9 | padding: 32,
10 | color: '#777',
11 | },
12 | textBold: {
13 | fontWeight: '500',
14 | color: '#000',
15 | },
16 | buttonText: {
17 | fontSize: 21,
18 | color: 'rgb(0,122,255)',
19 | },
20 | buttonTouchable: {
21 | padding: 16,
22 | },
23 | })
24 |
--------------------------------------------------------------------------------
/android/app/build_defs.bzl:
--------------------------------------------------------------------------------
1 | """Helper definitions to glob .aar and .jar targets"""
2 |
3 | def create_aar_targets(aarfiles):
4 | for aarfile in aarfiles:
5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
6 | lib_deps.append(":" + name)
7 | android_prebuilt_aar(
8 | name = name,
9 | aar = aarfile,
10 | )
11 |
12 | def create_jar_targets(jarfiles):
13 | for jarfile in jarfiles:
14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")]
15 | lib_deps.append(":" + name)
16 | prebuilt_jar(
17 | name = name,
18 | binary_jar = jarfile,
19 | )
20 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/App/Containers/SplashScreen/SplashScreenStyle.js:
--------------------------------------------------------------------------------
1 | import { StyleSheet } from 'react-native'
2 | import Colors from 'App/Theme/Colors'
3 | import ApplicationStyles from 'App/Theme/ApplicationStyles'
4 |
5 | export default StyleSheet.create({
6 | container: {
7 | ...ApplicationStyles.screen.container,
8 | display: 'flex',
9 | justifyContent: 'center',
10 | alignItems: 'center',
11 | backgroundColor: Colors.primary,
12 | },
13 | logoContainer: {
14 | display: 'flex',
15 | justifyContent: 'center',
16 | alignItems: 'center',
17 | height: 70,
18 | width: 70,
19 | backgroundColor: 'white',
20 | },
21 | logo: {
22 | width: '100%',
23 | height: '100%',
24 | },
25 | })
26 |
--------------------------------------------------------------------------------
/App/Components/Button.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import PropTypes from 'prop-types';
3 | import { TouchableOpacity, Text, StyleSheet } from 'react-native';
4 | import ApplicationStyles from 'App/Theme/ApplicationStyles'
5 |
6 | class Button extends Component {
7 | render() {
8 | const { text, onPress} = this.props;
9 | return (
10 | onPress()}
12 | >
13 | {text}
14 |
15 | );
16 | }
17 | }
18 |
19 | Button.propTypes = {
20 | text: PropTypes.string.isRequired,
21 | onPress: PropTypes.func.isRequired
22 | };
23 |
24 | export default Button;
25 |
--------------------------------------------------------------------------------
/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "plugins": [
3 | "react",
4 | "react-native",
5 | "prettier"
6 | ],
7 | "parserOptions": {
8 | "ecmaVersion": 2018,
9 | "ecmaFeatures": {
10 | "jsx": true,
11 | "modules": true
12 | },
13 | "sourceType": "module",
14 | "useJSXTextNode": false
15 | },
16 | "env": {
17 | "react-native/react-native": true
18 | },
19 | "extends": [
20 | "standard",
21 | "plugin:react/recommended",
22 | "plugin:react-native/all",
23 | "plugin:prettier/recommended"
24 | ],
25 | "settings": {
26 | "react": {
27 | "version": "detect",
28 | },
29 | },
30 | "rules": {
31 | "react-native/no-raw-text": 0 // Avoid false positive, wait for fix
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/App/Components/ListItem.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import PropTypes from 'prop-types';
3 | import { TouchableOpacity, Text, StyleSheet, View } from 'react-native';
4 | import ApplicationStyles from 'App/Theme/ApplicationStyles'
5 |
6 | class ListItem extends Component {
7 | render() {
8 | const { text, onPress} = this.props;
9 | return (
10 | onPress()}>
11 |
12 | {text}
13 |
14 |
15 | );
16 | }
17 | }
18 |
19 | ListItem.propTypes = {
20 | text: PropTypes.string.isRequired,
21 | onPress: PropTypes.func.isRequired
22 | };
23 |
24 | export default ListItem;
25 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | **Smartphone (please complete the following information):**
27 | - Device: [e.g. iPhone6]
28 | - OS: [e.g. iOS8.1]
29 | - Version [e.g. 22]
30 |
31 | **Additional context**
32 | Add any other context about the problem here.
33 |
--------------------------------------------------------------------------------
/ios/IrisTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
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 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.pbxproj -text
2 | * text=auto
3 |
4 | # Force the following filetypes to have unix eols, so Windows does not break them
5 | **/*.* text eol=lf
6 |
7 | # Windows forced line-endings
8 | /.idea/* text eol=crlf
9 |
10 | #
11 | ## These files are binary and should be left untouched
12 | #
13 |
14 | # (binary is a macro for -text -diff)
15 | *.png binary
16 | *.jpg binary
17 | *.jpeg binary
18 | *.gif binary
19 | *.ico binary
20 | *.mov binary
21 | *.mp4 binary
22 | *.mp3 binary
23 | *.flv binary
24 | *.fla binary
25 | *.swf binary
26 | *.gz binary
27 | *.zip binary
28 | *.7z binary
29 | *.ttf binary
30 | *.eot binary
31 | *.woff binary
32 | *.woff2 binary
33 | *.pyc binary
34 | *.pdf binary
35 | *.ez binary
36 | *.bz2 binary
37 | *.swp binary
38 | *.swp binary
39 | *.ipa binary
40 | *.apk binary
41 | *.jar binary
42 | *gradlew binary
43 | *BUCK binary
44 |
--------------------------------------------------------------------------------
/App/Config/README.md:
--------------------------------------------------------------------------------
1 | This directory contains configuration variables in 3 files:
2 | - `index.dev.js` : contains development variables
3 | - `index.production.js` : contains production variables
4 | - `index.staging.js` : contains beta tests variables
5 |
6 | You need to create `index.js` by copying the right file.
7 |
8 | #### Warning
9 | Each time you need to build, you need to verify if your `index.js` is the right one.
10 | For example, during development, before building your app do:
11 | ```
12 | cp App\Config\index.dev.js App\Config\index.js
13 | ```
14 | In other environment, you must pay attention to change your `index.js` with the good one.
15 | Also, make sure you add each configuration variable in each configuration file.
16 |
17 | #### Usage
18 | ```
19 | import Config from 'App/Config'
20 |
21 | ...
22 | let uri = Config.API_URL
23 | ...
24 |
25 | ```
26 |
--------------------------------------------------------------------------------
/ios/Iris-tvOSTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | to.iris.$(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 |
--------------------------------------------------------------------------------
/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.useAndroidX=true
21 | android.enableJetifier=true
22 |
--------------------------------------------------------------------------------
/App/Services/IrisService.js:
--------------------------------------------------------------------------------
1 | import keypair from '../privateKey.json';
2 | import gun from './GunService';
3 | import { Chat } from 'iris-lib';
4 | import AsyncStorage from '@react-native-community/async-storage';
5 |
6 | export const session = {};
7 |
8 | export const login = (gun, keypair, name) => {
9 | session.gun = gun
10 | session.keypair = keypair
11 | session.user = gun.user()
12 | session.user.auth(keypair)
13 | session.chatLinks = {}
14 | if (name) {
15 | session.user.get('profile').get('name').put(name)
16 | }
17 | AsyncStorage.setItem('iris_keypair', JSON.stringify(keypair))
18 | Chat.getMyChatLinks(gun, keypair, undefined, ({url, id}) => {
19 | session.chatLinks[id] = url
20 | }, true)
21 | }
22 |
23 | export const isValidKey = (key) => {
24 | return (!!(typeof key === `object` && key.pub && key.epub && key.priv && key.epriv))
25 | }
26 |
27 | export const logout = () => {
28 | AsyncStorage.removeItem('iris_keypair')
29 | session.keypair = null
30 | session.user = null
31 | }
32 |
--------------------------------------------------------------------------------
/android/app/src/main/java/com/iris/MainActivity.java:
--------------------------------------------------------------------------------
1 | package to.iris.Iris;
2 |
3 | import com.facebook.react.ReactActivity;
4 | import com.facebook.react.ReactActivityDelegate;
5 | import com.facebook.react.ReactRootView;
6 | import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;
7 |
8 | public class MainActivity extends ReactActivity {
9 |
10 | /**
11 | * Returns the name of the main component registered from JavaScript.
12 | * This is used to schedule rendering of the component.
13 | */
14 | @Override
15 | protected String getMainComponentName() {
16 | return "Iris";
17 | }
18 |
19 | @Override
20 | protected ReactActivityDelegate createReactActivityDelegate() {
21 | return new ReactActivityDelegate(this, getMainComponentName()) {
22 | @Override
23 | protected ReactRootView createRootView() {
24 | return new RNGestureHandlerEnabledRootView(MainActivity.this);
25 | }
26 | };
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/App/Containers/Root/RootScreen.js:
--------------------------------------------------------------------------------
1 | import WebviewCrypto from '@gooddollar/react-native-webview-crypto'
2 | import React, { Component } from 'react'
3 | import NavigationService from 'App/Services/NavigationService'
4 | import AppNavigator from 'App/Navigators/AppNavigator'
5 | import { View } from 'react-native'
6 | import styles from './RootScreenStyle'
7 | import { PropTypes } from 'prop-types'
8 |
9 | class RootScreen extends Component {
10 | componentDidMount() {
11 |
12 | }
13 |
14 | render() {
15 | return (
16 |
17 |
18 | {
21 | NavigationService.setTopLevelNavigator(navigatorRef)
22 | }}
23 | />
24 |
25 | )
26 | }
27 | }
28 |
29 | RootScreen.propTypes = {
30 | startup: PropTypes.func,
31 | }
32 |
33 | export default RootScreen
34 |
--------------------------------------------------------------------------------
/.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/IntelliJ
26 | #
27 | build/
28 | .idea
29 | .gradle
30 | local.properties
31 | *.iml
32 |
33 | # node.js
34 | #
35 | node_modules/
36 | npm-debug.log
37 | yarn-error.log
38 |
39 | # BUCK
40 | buck-out/
41 | \.buckd/
42 | *.keystore
43 |
44 | # fastlane
45 | #
46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
47 | # screenshots whenever they are needed.
48 | # For more information about the recommended setup visit:
49 | # https://docs.fastlane.tools/best-practices/source-control/
50 |
51 | */fastlane/report.xml
52 | */fastlane/Preview.html
53 | */fastlane/screenshots
54 |
55 | # Bundle artifact
56 | *.jsbundle
57 |
58 | # CocoaPods
59 | /ios/Pods/
60 |
61 | privateKey.json
62 |
--------------------------------------------------------------------------------
/App/Containers/Contacts/Share.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { View, Clipboard } from 'react-native'
3 | import Button from 'App/Components/Button'
4 | import QRCode from 'react-native-qrcode-svg'
5 | import Style from './Style'
6 |
7 | class ShareContactScreen extends React.Component {
8 | state = {
9 | url: null
10 | }
11 |
12 | static navigationOptions = {
13 | title: '',
14 | }
15 |
16 | componentDidMount() {
17 | const type = encodeURIComponent(this.props.navigation.getParam('type'))
18 | const value = encodeURIComponent(this.props.navigation.getParam('value'))
19 | const url = `https://iris.to/#/contacts/${type}/${value}`
20 | this.setState({url})
21 | }
22 |
23 | render() {
24 | return this.state.url ? (
25 |
26 |
30 |
32 | ) : (
33 |
34 | )
35 | }
36 | }
37 |
38 | export default ShareContactScreen
39 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2017 Martti Malmi
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/App/Components/Svg.js:
--------------------------------------------------------------------------------
1 | export default {
2 | newChat: '',
3 | sentCheckmark: '',
4 | deliveredCheckmark: '',
5 | seenCheckmark: '',
6 | }
7 |
--------------------------------------------------------------------------------
/App/Containers/Settings/ShowPrivateKeyScreen.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { View, Clipboard, Text } from 'react-native'
3 | import Button from 'App/Components/Button'
4 | import QRCode from 'react-native-qrcode-svg'
5 | import Style from './SettingsScreenStyle'
6 | import gun from 'App/Services/GunService'
7 |
8 | class ShowPrivateKeyScreen extends React.Component {
9 | state = {
10 | privateKey: null
11 | }
12 |
13 | static navigationOptions = {
14 | title: 'Private key',
15 | }
16 |
17 | componentDidMount() {
18 | const privateKey = JSON.stringify(gun.user().is.alias)
19 | this.setState({privateKey})
20 | }
21 |
22 | render() {
23 | return this.state.privateKey ? (
24 |
25 |
29 |
32 | ) : (
33 |
34 | )
35 | }
36 | }
37 |
38 | export default ShowPrivateKeyScreen
39 |
--------------------------------------------------------------------------------
/android/app/google-services.json:
--------------------------------------------------------------------------------
1 | {
2 | "project_info": {
3 | "project_number": "375748982628",
4 | "firebase_url": "https://iris-99003.firebaseio.com",
5 | "project_id": "iris-99003",
6 | "storage_bucket": "iris-99003.appspot.com"
7 | },
8 | "client": [
9 | {
10 | "client_info": {
11 | "mobilesdk_app_id": "1:375748982628:android:ac90427767abdcfbd82c71",
12 | "android_client_info": {
13 | "package_name": "to.iris.Iris"
14 | }
15 | },
16 | "oauth_client": [
17 | {
18 | "client_id": "375748982628-uae2qct43c1nv63b8uhv1hnbgkqrp5db.apps.googleusercontent.com",
19 | "client_type": 3
20 | }
21 | ],
22 | "api_key": [
23 | {
24 | "current_key": "AIzaSyDna-1D11qiDFZv_hiqY4LgutrEQ1ggpSw"
25 | }
26 | ],
27 | "services": {
28 | "appinvite_service": {
29 | "other_platform_oauth_client": [
30 | {
31 | "client_id": "375748982628-uae2qct43c1nv63b8uhv1hnbgkqrp5db.apps.googleusercontent.com",
32 | "client_type": 3
33 | }
34 | ]
35 | }
36 | }
37 | }
38 | ],
39 | "configuration_version": "1"
40 | }
41 |
--------------------------------------------------------------------------------
/android/app/src/debug/google-services.json:
--------------------------------------------------------------------------------
1 | {
2 | "project_info": {
3 | "project_number": "375748982628",
4 | "firebase_url": "https://iris-99003.firebaseio.com",
5 | "project_id": "iris-99003",
6 | "storage_bucket": "iris-99003.appspot.com"
7 | },
8 | "client": [
9 | {
10 | "client_info": {
11 | "mobilesdk_app_id": "1:375748982628:android:ac90427767abdcfbd82c71",
12 | "android_client_info": {
13 | "package_name": "to.iris.Iris"
14 | }
15 | },
16 | "oauth_client": [
17 | {
18 | "client_id": "375748982628-uae2qct43c1nv63b8uhv1hnbgkqrp5db.apps.googleusercontent.com",
19 | "client_type": 3
20 | }
21 | ],
22 | "api_key": [
23 | {
24 | "current_key": "AIzaSyDna-1D11qiDFZv_hiqY4LgutrEQ1ggpSw"
25 | }
26 | ],
27 | "services": {
28 | "appinvite_service": {
29 | "other_platform_oauth_client": [
30 | {
31 | "client_id": "375748982628-uae2qct43c1nv63b8uhv1hnbgkqrp5db.apps.googleusercontent.com",
32 | "client_type": 3
33 | }
34 | ]
35 | }
36 | }
37 | }
38 | ],
39 | "configuration_version": "1"
40 | }
--------------------------------------------------------------------------------
/android/app/src/release/google-services.json:
--------------------------------------------------------------------------------
1 | {
2 | "project_info": {
3 | "project_number": "375748982628",
4 | "firebase_url": "https://iris-99003.firebaseio.com",
5 | "project_id": "iris-99003",
6 | "storage_bucket": "iris-99003.appspot.com"
7 | },
8 | "client": [
9 | {
10 | "client_info": {
11 | "mobilesdk_app_id": "1:375748982628:android:ac90427767abdcfbd82c71",
12 | "android_client_info": {
13 | "package_name": "to.iris.Iris"
14 | }
15 | },
16 | "oauth_client": [
17 | {
18 | "client_id": "375748982628-uae2qct43c1nv63b8uhv1hnbgkqrp5db.apps.googleusercontent.com",
19 | "client_type": 3
20 | }
21 | ],
22 | "api_key": [
23 | {
24 | "current_key": "AIzaSyDna-1D11qiDFZv_hiqY4LgutrEQ1ggpSw"
25 | }
26 | ],
27 | "services": {
28 | "appinvite_service": {
29 | "other_platform_oauth_client": [
30 | {
31 | "client_id": "375748982628-uae2qct43c1nv63b8uhv1hnbgkqrp5db.apps.googleusercontent.com",
32 | "client_type": 3
33 | }
34 | ]
35 | }
36 | }
37 | }
38 | ],
39 | "configuration_version": "1"
40 | }
--------------------------------------------------------------------------------
/App/Containers/ScanPrivateKey/Scan.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { PropTypes } from 'prop-types'
3 | import styles from './Style'
4 | import gunInstance from 'App/Services/GunService'
5 | import { login, isValidKey } from 'App/Services/IrisService'
6 | import {
7 | StyleSheet,
8 | Text,
9 | TouchableOpacity,
10 | } from 'react-native';
11 |
12 | import QRCodeScanner from 'react-native-qrcode-scanner';
13 |
14 | class ScanPrivateKeyScreen extends React.Component {
15 | onSuccess = (e) => {
16 | try {
17 | const key = JSON.parse(e.data)
18 | if (isValidKey(key)) {
19 | gunInstance.user().auth(key)
20 | login(gunInstance, key)
21 | this.props.navigation.navigate('ChatListScreen')
22 | }
23 | } catch (err) {
24 |
25 | }
26 | }
27 |
28 | render() {
29 | return (
30 |
35 | Scan your private key QR code from another device.
36 |
37 | }
38 | />
39 | );
40 | }
41 | }
42 |
43 | export default ScanPrivateKeyScreen
44 |
--------------------------------------------------------------------------------
/App/Containers/Settings/SettingsScreenStyle.js:
--------------------------------------------------------------------------------
1 | import { StyleSheet } from 'react-native'
2 | import Fonts from 'App/Theme/Fonts'
3 | import ApplicationStyles from 'App/Theme/ApplicationStyles'
4 |
5 | export default StyleSheet.create({
6 | container: {
7 | ...ApplicationStyles.screen.container,
8 | flex: 1,
9 | padding: 16,
10 | },
11 | item: {
12 | marginVertical: 8,
13 | marginHorizontal: 16,
14 | padding: 16,
15 | borderBottomWidth: 1,
16 | borderColor: '#eee',
17 | },
18 | title: {
19 | fontSize: 32,
20 | },
21 | text: {
22 | ...Fonts.style.normal,
23 | fontSize: Fonts.size.medium,
24 | textAlign: 'left',
25 | marginBottom: 5,
26 | },
27 | instructions: {
28 | ...Fonts.style.normal,
29 | textAlign: 'center',
30 | marginBottom: 5,
31 | fontStyle: 'italic',
32 | },
33 | loading: {
34 | ...Fonts.style.normal,
35 | textAlign: 'center',
36 | marginBottom: 5,
37 | },
38 | result: {
39 | ...Fonts.style.normal,
40 | textAlign: 'center',
41 | marginBottom: 5,
42 | },
43 | error: {
44 | ...Fonts.style.normal,
45 | textAlign: 'center',
46 | marginBottom: 5,
47 | color: 'red',
48 | },
49 | headerLogo: {
50 | width: '100%',
51 | height: '70%',
52 | },
53 | })
54 |
--------------------------------------------------------------------------------
/App/Containers/ScanChatLink/Scan.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { PropTypes } from 'prop-types'
3 | import { Chat } from 'iris-lib'
4 | import styles from './Style'
5 | import gunInstance from 'App/Services/GunService'
6 | import { session } from 'App/Services/IrisService'
7 | import {
8 | StyleSheet,
9 | Text,
10 | TouchableOpacity,
11 | } from 'react-native';
12 |
13 | import QRCodeScanner from 'react-native-qrcode-scanner';
14 |
15 | class ScanChatLinkScreen extends React.Component {
16 | onSuccess = (e) => {
17 | console.log('scanned chat link', e);
18 | if (e.data.indexOf('http') === 0 && e.data.indexOf('chatWith')) {
19 | const chat = new Chat({key: session.keypair, gun: gunInstance, chatLink: e.data})
20 | const pub = Object.keys(chat.secrets)[0]
21 | this.props.navigation.navigate('ChatScreen', {pub})
22 | }
23 | }
24 |
25 | render() {
26 | return (
27 |
32 | Scan someone's chat link
33 |
34 | }
35 | />
36 | );
37 | }
38 | }
39 |
40 | export default ScanChatLinkScreen
41 |
--------------------------------------------------------------------------------
/App/Containers/Settings/SettingsScreen.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { View, Text, TouchableOpacity } from 'react-native'
3 | import Style from './SettingsScreenStyle'
4 | import ListItem from 'App/Components/ListItem'
5 | import gun from 'App/Services/GunService'
6 | import { logout as irisLogout } from 'App/Services/IrisService'
7 | import Navigation from 'App/Services/NavigationService'
8 | import QRCode from 'react-native-qrcode-svg'
9 |
10 | class SettingsScreen extends React.Component {
11 | static navigationOptions = {
12 | title: 'Settings',
13 | }
14 |
15 | logout() {
16 | gun.user().leave()
17 | irisLogout()
18 | Navigation.navigateAndReset('WelcomeScreen')
19 | }
20 |
21 | render() {
22 | return (
23 |
24 | Navigation.navigate('EditProfileScreen') } />
25 | Navigation.navigate('PeersScreen') } />
26 | Navigation.navigate('ShowPrivateKeyScreen') } />
27 | this.logout()} />
28 |
29 | )
30 | }
31 | }
32 |
33 | export default SettingsScreen
34 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | ext {
5 | buildToolsVersion = "28.0.3"
6 | minSdkVersion = 16
7 | compileSdkVersion = 28
8 | targetSdkVersion = 28
9 | supportLibVersion = "28.0.0"
10 | }
11 | repositories {
12 | google()
13 | jcenter()
14 | }
15 | dependencies {
16 | classpath("com.android.tools.build:gradle:3.4.1")
17 | classpath 'com.google.gms:google-services:4.3.3'
18 |
19 | // NOTE: Do not place your application dependencies here; they belong
20 | // in the individual module build.gradle files
21 | }
22 | }
23 |
24 | allprojects {
25 | repositories {
26 | mavenLocal()
27 | maven {
28 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
29 | url("$rootDir/../node_modules/react-native/android")
30 | }
31 | maven {
32 | // Android JSC is installed from npm
33 | url("$rootDir/../node_modules/jsc-android/dist")
34 | }
35 |
36 | google()
37 | jcenter()
38 |
39 | // react-native-image-crop-picker
40 | maven { url 'https://maven.google.com' }
41 | maven { url "https://www.jitpack.io" }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/App/Containers/Contacts/Style.js:
--------------------------------------------------------------------------------
1 | import { StyleSheet } from 'react-native'
2 | import Fonts from 'App/Theme/Fonts'
3 | import ApplicationStyles from 'App/Theme/ApplicationStyles'
4 |
5 | export default StyleSheet.create({
6 | container: {
7 | ...ApplicationStyles.screen.container,
8 | flex: 1,
9 | padding: 10,
10 | alignItems: 'center',
11 | },
12 | item: {
13 | marginVertical: 8,
14 | marginHorizontal: 16,
15 | padding: 16,
16 | borderBottomWidth: 1,
17 | borderColor: '#eee',
18 | },
19 | title: {
20 | fontSize: 32,
21 | textAlign: 'center',
22 | },
23 | input: {
24 | fontSize: Fonts.size.input,
25 | },
26 | text: {
27 | ...Fonts.style.normal,
28 | fontSize: Fonts.size.medium,
29 | textAlign: 'left',
30 | marginBottom: 5,
31 | },
32 | instructions: {
33 | ...Fonts.style.normal,
34 | textAlign: 'center',
35 | marginBottom: 5,
36 | fontStyle: 'italic',
37 | },
38 | loading: {
39 | ...Fonts.style.normal,
40 | textAlign: 'center',
41 | marginBottom: 5,
42 | },
43 | result: {
44 | ...Fonts.style.normal,
45 | textAlign: 'center',
46 | marginBottom: 5,
47 | },
48 | error: {
49 | ...Fonts.style.normal,
50 | textAlign: 'center',
51 | marginBottom: 5,
52 | color: 'red',
53 | },
54 | headerLogo: {
55 | width: '100%',
56 | height: '70%',
57 | },
58 | })
59 |
--------------------------------------------------------------------------------
/ios/Iris/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "40.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "60.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "58.png",
19 | "scale" : "2x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "87.png",
25 | "scale" : "3x"
26 | },
27 | {
28 | "size" : "40x40",
29 | "idiom" : "iphone",
30 | "filename" : "80.png",
31 | "scale" : "2x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "120.png",
37 | "scale" : "3x"
38 | },
39 | {
40 | "size" : "60x60",
41 | "idiom" : "iphone",
42 | "filename" : "120-1.png",
43 | "scale" : "2x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "180.png",
49 | "scale" : "3x"
50 | },
51 | {
52 | "size" : "1024x1024",
53 | "idiom" : "ios-marketing",
54 | "filename" : "1024.png",
55 | "scale" : "1x"
56 | }
57 | ],
58 | "info" : {
59 | "version" : 1,
60 | "author" : "xcode"
61 | }
62 | }
--------------------------------------------------------------------------------
/android/app/BUCK:
--------------------------------------------------------------------------------
1 | # To learn about Buck see [Docs](https://buckbuild.com/).
2 | # To run your application with Buck:
3 | # - install Buck
4 | # - `npm start` - to start the packager
5 | # - `cd android`
6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
8 | # - `buck install -r android/app` - compile, install and run application
9 | #
10 |
11 | load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
12 |
13 | lib_deps = []
14 |
15 | create_aar_targets(glob(["libs/*.aar"]))
16 |
17 | create_jar_targets(glob(["libs/*.jar"]))
18 |
19 | android_library(
20 | name = "all-libs",
21 | exported_deps = lib_deps,
22 | )
23 |
24 | android_library(
25 | name = "app-code",
26 | srcs = glob([
27 | "src/main/java/**/*.java",
28 | ]),
29 | deps = [
30 | ":all-libs",
31 | ":build_config",
32 | ":res",
33 | ],
34 | )
35 |
36 | android_build_config(
37 | name = "build_config",
38 | package = "to.iris.Iris",
39 | )
40 |
41 | android_resource(
42 | name = "res",
43 | package = "to.iris.Iris",
44 | res = "src/main/res",
45 | )
46 |
47 | android_binary(
48 | name = "app",
49 | keystore = "//android/keystores:debug",
50 | manifest = "src/main/AndroidManifest.xml",
51 | package_type = "debug",
52 | deps = [
53 | ":app-code",
54 | ],
55 | )
56 |
--------------------------------------------------------------------------------
/App/Theme/Metrics.js:
--------------------------------------------------------------------------------
1 | /**
2 | * This file contains metric values that are global to the application.
3 | */
4 |
5 | // Examples of metrics you can define:
6 | export const tiny = 5
7 | export const small = tiny * 2 // 10
8 | export const normal = tiny * 3 // 15
9 | export const medium = normal * 2 // 30
10 |
11 | export default {
12 | bottomMargin: {
13 | marginBottom: normal,
14 | },
15 | mediumBottomMargin: {
16 | marginBottom: medium,
17 | },
18 |
19 | tinyVerticalMargin: {
20 | marginVertical: tiny,
21 | },
22 | smallVerticalMargin: {
23 | marginVertical: small,
24 | },
25 | verticalMargin: {
26 | marginVertical: normal,
27 | },
28 | mediumVerticalMargin: {
29 | marginVertical: medium,
30 | },
31 |
32 | tinyHorizontalMargin: {
33 | marginHorizontal: tiny,
34 | },
35 | smallHorizontalMargin: {
36 | marginHorizontal: small,
37 | },
38 | horizontalMargin: {
39 | marginHorizontal: normal,
40 | },
41 | mediumHorizontalMargin: {
42 | marginHorizontal: medium,
43 | },
44 |
45 | tinyHorizontalPadding: {
46 | paddingHorizontal: tiny,
47 | },
48 | smallHorizontalPadding: {
49 | paddingHorizontal: small,
50 | },
51 | horizontalPadding: {
52 | paddingHorizontal: normal,
53 | },
54 | mediumHorizontalPadding: {
55 | paddingHorizontal: medium,
56 | },
57 |
58 | tinyVerticalPadding: {
59 | paddingVertical: tiny,
60 | },
61 | smallVerticalPadding: {
62 | paddingVertical: small,
63 | },
64 | verticalPadding: {
65 | paddingVertical: normal,
66 | },
67 | mediumVerticalPadding: {
68 | paddingVertical: medium,
69 | },
70 | }
71 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
18 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/App/Containers/Welcome/WelcomeScreenStyle.js:
--------------------------------------------------------------------------------
1 | import { StyleSheet } from 'react-native'
2 | import Fonts from 'App/Theme/Fonts'
3 | import ApplicationStyles from 'App/Theme/ApplicationStyles'
4 |
5 | export default StyleSheet.create({
6 | container: {
7 | ...ApplicationStyles.screen.container,
8 | flex: 1,
9 | backgroundColor: '#74d5f1',
10 | },
11 | title: {
12 | ...Fonts.style.h2,
13 | textAlign: 'center',
14 | marginBottom: 10,
15 | },
16 | welcome: {
17 | fontSize: 18,
18 | textAlign: 'center',
19 | marginBottom: 10,
20 | marginTop: 10,
21 | color: 'white',
22 | },
23 | name: {
24 | fontSize: 24,
25 | textAlign: 'center',
26 | marginBottom: 10,
27 | marginTop: 10,
28 | color: 'white'
29 | },
30 | text: {
31 | fontSize: 17,
32 | textAlign: 'center',
33 | marginBottom: 10,
34 | marginTop: 10,
35 | color: 'white'
36 | },
37 | loading: {
38 | ...Fonts.style.normal,
39 | textAlign: 'center',
40 | marginBottom: 5,
41 | },
42 | result: {
43 | ...Fonts.style.normal,
44 | textAlign: 'center',
45 | marginBottom: 5,
46 | },
47 | error: {
48 | ...Fonts.style.normal,
49 | textAlign: 'center',
50 | marginBottom: 5,
51 | color: 'red',
52 | },
53 | logoContainer: {
54 | flex: 1,
55 | justifyContent: 'flex-end',
56 | alignItems: 'center',
57 | },
58 | logo: {
59 | width: '60%',
60 | height: '60%',
61 | },
62 | formContainer: {
63 | flex: 1,
64 | justifyContent: 'center',
65 | },
66 | bottom: {
67 | flex: 1,
68 | justifyContent: 'flex-end',
69 | },
70 | loginButton: {
71 | marginBottom: 30,
72 | },
73 | })
74 |
--------------------------------------------------------------------------------
/App/Containers/Chat/Style.js:
--------------------------------------------------------------------------------
1 | import { StyleSheet } from 'react-native'
2 | import Fonts from 'App/Theme/Fonts'
3 | import ApplicationStyles from 'App/Theme/ApplicationStyles'
4 |
5 | export default StyleSheet.create({
6 | container: {
7 | ...ApplicationStyles.screen.container,
8 | flex: 1,
9 | padding: 16,
10 | },
11 | margins: {
12 | marginBottom: 16,
13 | },
14 | listContainer: {
15 | flex: 1,
16 | },
17 | lastActive: {
18 | fontSize: Fonts.size.small,
19 | color: '#999',
20 | },
21 | headerLeft: {
22 | flex: 1,
23 | marginHorizontal: 16,
24 | flexDirection: 'row',
25 | alignItems: 'center',
26 | },
27 | headerIdenticon: {
28 | marginRight: 16,
29 | },
30 | item: {
31 | marginVertical: 8,
32 | marginHorizontal: 16,
33 | padding: 16,
34 | borderBottomWidth: 1,
35 | borderColor: '#eee',
36 | },
37 | title: {
38 | fontSize: 32,
39 | },
40 | text: {
41 | ...Fonts.style.normal,
42 | fontSize: Fonts.size.medium,
43 | textAlign: 'left',
44 | marginBottom: 5,
45 | },
46 | instructions: {
47 | ...Fonts.style.normal,
48 | textAlign: 'center',
49 | marginBottom: 5,
50 | fontStyle: 'italic',
51 | },
52 | loading: {
53 | ...Fonts.style.normal,
54 | textAlign: 'center',
55 | marginBottom: 5,
56 | },
57 | result: {
58 | ...Fonts.style.normal,
59 | textAlign: 'center',
60 | marginBottom: 5,
61 | },
62 | error: {
63 | ...Fonts.style.normal,
64 | textAlign: 'center',
65 | marginBottom: 5,
66 | color: 'red',
67 | },
68 | headerLogo: {
69 | width: '100%',
70 | height: '70%',
71 | },
72 | formContainer: {
73 |
74 | },
75 | })
76 |
--------------------------------------------------------------------------------
/App/Containers/Login/LoginScreenStyle.js:
--------------------------------------------------------------------------------
1 | import { StyleSheet } from 'react-native'
2 | import Fonts from 'App/Theme/Fonts'
3 | import ApplicationStyles from 'App/Theme/ApplicationStyles'
4 |
5 | export default StyleSheet.create({
6 | container: {
7 | ...ApplicationStyles.screen.container,
8 | flex: 1,
9 | backgroundColor: '#74d5f1',
10 | },
11 | title: {
12 | ...Fonts.style.h2,
13 | textAlign: 'center',
14 | marginBottom: 10,
15 | },
16 | welcome: {
17 | fontSize: 18,
18 | textAlign: 'center',
19 | marginBottom: 10,
20 | marginTop: 10,
21 | color: 'white',
22 | },
23 | name: {
24 | fontSize: 24,
25 | textAlign: 'center',
26 | marginBottom: 10,
27 | marginTop: 10,
28 | color: 'white'
29 | },
30 | text: {
31 | fontSize: 17,
32 | textAlign: 'center',
33 | marginBottom: 10,
34 | marginTop: 10,
35 | color: 'white'
36 | },
37 | loading: {
38 | ...Fonts.style.normal,
39 | textAlign: 'center',
40 | marginBottom: 5,
41 | },
42 | result: {
43 | ...Fonts.style.normal,
44 | textAlign: 'center',
45 | marginBottom: 5,
46 | },
47 | error: {
48 | ...Fonts.style.normal,
49 | textAlign: 'center',
50 | marginBottom: 5,
51 | color: 'red',
52 | },
53 | logoContainer: {
54 | flex: 1,
55 | justifyContent: 'flex-end',
56 | alignItems: 'center',
57 | },
58 | logo: {
59 | width: '60%',
60 | height: '60%',
61 | },
62 | formContainer: {
63 | marginBottom: 50,
64 | flex: 1,
65 | justifyContent: 'center',
66 | },
67 | bottom: {
68 | flex: 1,
69 | justifyContent: 'flex-end',
70 | },
71 | loginButton: {
72 | marginBottom: 30,
73 | },
74 | })
75 |
--------------------------------------------------------------------------------
/ios/Iris-tvOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER))
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 | NSAppTransportSecurity
26 |
27 | NSExceptionDomains
28 |
29 | localhost
30 |
31 | NSExceptionAllowsInsecureHTTPLoads
32 |
33 |
34 |
35 |
36 | NSLocationWhenInUseUsageDescription
37 |
38 | UILaunchStoryboardName
39 | LaunchScreen
40 | UIRequiredDeviceCapabilities
41 |
42 | armv7
43 |
44 | UISupportedInterfaceOrientations
45 |
46 | UIInterfaceOrientationPortrait
47 | UIInterfaceOrientationLandscapeLeft
48 | UIInterfaceOrientationLandscapeRight
49 |
50 | UIViewControllerBasedStatusBarAppearance
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/App/Containers/Contacts/Show.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { View, Text, TextInput, Image, Dimensions } from 'react-native'
3 | import Style from './Style'
4 | import gun from 'App/Services/GunService'
5 | import Button from 'App/Components/Button'
6 | import Identicon from 'App/Components/Identicon'
7 | import {Attribute} from 'iris-lib'
8 | import { SvgXml } from 'react-native-svg';
9 |
10 | class ContactScreen extends React.Component {
11 | state = {
12 | name: '',
13 | about: '',
14 | }
15 |
16 | static navigationOptions = ({navigation}) => {
17 | const {state} = navigation;
18 | return {
19 | title: state.params.title || '',
20 | headerTitle: state.params.title || '',
21 | }
22 | }
23 |
24 | componentDidMount() {
25 | const pub = this.props.navigation.getParam('pub', '')
26 | this.setState({name: '', pub})
27 | gun.user(pub).get('profile').get('name').on(name => {
28 | this.props.navigation.setParams({title: name})
29 | this.setState({name})
30 | })
31 | gun.user(pub).get('profile').get('about').on(about => {
32 | this.setState({about})
33 | })
34 | }
35 |
36 | render() {
37 | const pub = this.props.navigation.getParam('pub', '')
38 | return (
39 |
40 |
41 | {this.state.about}
42 |
45 | )
46 | }
47 | }
48 |
49 | export default ContactScreen
50 |
--------------------------------------------------------------------------------
/android/app/src/main/java/com/iris/MainApplication.java:
--------------------------------------------------------------------------------
1 | package to.iris.Iris;
2 |
3 | import android.app.Application;
4 |
5 | import android.util.Log;
6 | import com.facebook.react.PackageList;
7 | import com.facebook.hermes.reactexecutor.HermesExecutorFactory;
8 | import com.facebook.react.bridge.JavaScriptExecutorFactory;
9 | import com.facebook.react.ReactApplication;
10 | import com.wix.reactnativenotifications.RNNotificationsPackage;
11 | import com.facebook.react.ReactNativeHost;
12 | import com.facebook.react.ReactPackage;
13 | import com.facebook.soloader.SoLoader;
14 | import com.bugsnag.BugsnagReactNative;
15 |
16 | import java.util.List;
17 |
18 | public class MainApplication extends Application implements ReactApplication {
19 |
20 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
21 | @Override
22 | public boolean getUseDeveloperSupport() {
23 | return BuildConfig.DEBUG;
24 | }
25 |
26 | @Override
27 | protected List getPackages() {
28 | @SuppressWarnings("UnnecessaryLocalVariable")
29 | List packages = new PackageList(this).getPackages();
30 | // Packages that cannot be autolinked yet can be added manually here, for example:
31 | // packages.add(new MyReactNativePackage());
32 | packages.add(new RNNotificationsPackage(MainApplication.this));
33 | return packages;
34 | }
35 |
36 | @Override
37 | protected String getJSMainModuleName() {
38 | return "index";
39 | }
40 | };
41 |
42 | @Override
43 | public ReactNativeHost getReactNativeHost() {
44 | return mReactNativeHost;
45 | }
46 |
47 | @Override
48 | public void onCreate() {
49 | super.onCreate();
50 | BugsnagReactNative.start(this);
51 | SoLoader.init(this, /* native exopackage */ false);
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/App/Components/Identicon.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import PropTypes from 'prop-types';
3 | import { Image, View } from 'react-native';
4 | import ApplicationStyles from 'App/Theme/ApplicationStyles'
5 | import { Attribute } from 'iris-lib'
6 | import { SvgXml } from 'react-native-svg'
7 | import gun from 'App/Services/GunService'
8 |
9 | class Identicon extends Component {
10 | state = {
11 |
12 | }
13 |
14 | componentDidMount() {
15 | this.setState({pub: this.props.pub})
16 | new Attribute({type:'keyID', value: this.props.pub}).identiconXml({width:this.props.width}).then(xml => {
17 | this.setState({identicon: xml})
18 | })
19 | gun.user(this.props.pub).get('profile').get('photo').on(photo => this.setState({photo}))
20 | }
21 |
22 | render() {
23 | return (
24 |
25 | {this.renderImage()}
26 |
27 | )
28 | }
29 |
30 | renderImage() {
31 | if (this.state.identicon && !this.state.photo) {
32 | return ()
33 | } else {
34 | return ()
45 | }
46 | }
47 | }
48 |
49 | Identicon.propTypes = {
50 | pub: PropTypes.string.isRequired,
51 | width: PropTypes.number,
52 | style: PropTypes.object,
53 | };
54 |
55 | Identicon.defaultProps = {
56 | width: 58,
57 | style: {},
58 | }
59 |
60 | export default Identicon;
61 |
--------------------------------------------------------------------------------
/App/Services/NavigationService.js:
--------------------------------------------------------------------------------
1 | import { NavigationActions, StackActions } from 'react-navigation'
2 |
3 | /**
4 | * The navigation is implemented as a service so that it can be used outside of components, for example in sagas.
5 | *
6 | * @see https://reactnavigation.org/docs/en/navigating-without-navigation-prop.html
7 | */
8 |
9 | let navigator
10 |
11 | /**
12 | * This function is called when the RootScreen is created to set the navigator instance to use.
13 | */
14 | function setTopLevelNavigator(navigatorRef) {
15 | navigator = navigatorRef
16 | }
17 |
18 | /**
19 | * Call this function when you want to navigate to a specific route.
20 | *
21 | * @param routeName The name of the route to navigate to. Routes are defined in RootScreen using createStackNavigator()
22 | * @param params Route parameters.
23 | */
24 | function navigate(routeName, params) {
25 | navigator.dispatch(
26 | NavigationActions.navigate({
27 | routeName,
28 | params,
29 | })
30 | )
31 | }
32 |
33 | /**
34 | * Call this function when you want to navigate to a specific route AND reset the navigation history.
35 | *
36 | * That means the user cannot go back. This is useful for example to redirect from a splashscreen to
37 | * the main screen: the user should not be able to go back to the splashscreen.
38 | *
39 | * @param routeName The name of the route to navigate to. Routes are defined in RootScreen using createStackNavigator()
40 | * @param params Route parameters.
41 | */
42 | function navigateAndReset(routeName, params) {
43 | navigator.dispatch(
44 | StackActions.reset({
45 | index: 0,
46 | key: null,
47 | actions: [
48 | NavigationActions.navigate({
49 | routeName,
50 | params,
51 | }),
52 | ],
53 | })
54 | )
55 | }
56 |
57 | export default {
58 | navigate,
59 | navigateAndReset,
60 | setTopLevelNavigator,
61 | }
62 |
--------------------------------------------------------------------------------
/App/Containers/Login/LoginScreen.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { Platform, Text, KeyboardAvoidingView, View, TextInput } from 'react-native'
3 | import Button from 'App/Components/Button'
4 | import { PropTypes } from 'prop-types'
5 | import Style from './LoginScreenStyle'
6 | import ApplicationStyles from 'App/Theme/ApplicationStyles'
7 | import { Images } from 'App/Theme'
8 | import gun from 'App/Services/GunService'
9 | import { login as irisLogin } from 'App/Services/IrisService'
10 |
11 | class LoginScreen extends React.Component {
12 | componentDidMount() {
13 |
14 | }
15 |
16 | static navigationOptions = {
17 | headerStyle: {
18 | backgroundColor: '#74d5f1',
19 | borderBottomWidth: 0,
20 | },
21 | headerTintColor: '#fff',
22 | headerTitleStyle: {
23 | fontWeight: 'bold',
24 | },
25 | }
26 |
27 | logInWithKey(key) {
28 | try {
29 | key = JSON.parse(key)
30 | gun.user().auth(key)
31 | irisLogin(gun, key)
32 | this.props.navigation.navigate('ChatListScreen')
33 | } catch (e) {
34 | // TODO: show error
35 | }
36 | }
37 |
38 | render() {
39 | return (
40 |
41 |
42 | this.logInWithKey(key)}
51 | />
52 | or
53 | this.props.navigation.navigate('ScanPrivateKeyScreen')} />
54 |
55 |
56 | )
57 | }
58 | }
59 |
60 | LoginScreen.propTypes = {
61 | user: PropTypes.object,
62 | }
63 |
64 | export default LoginScreen
65 |
--------------------------------------------------------------------------------
/App/Theme/ApplicationStyles.js:
--------------------------------------------------------------------------------
1 | import Fonts from 'App/Theme/Fonts'
2 |
3 | /**
4 | * This file defines the base application styles.
5 | *
6 | * Use it to define generic component styles (e.g. the default text styles, default button styles...).
7 | */
8 |
9 | export default {
10 | screen: {
11 | container: {
12 | flex: 1,
13 | },
14 | },
15 | identicon: {
16 | overflow: 'hidden',
17 | maxWidth: '100%',
18 | },
19 | listItem: {
20 | checkmark: {
21 | marginRight: 4
22 | },
23 | item: {
24 | flexDirection: 'row',
25 | alignItems: 'center',
26 | },
27 | identicon: {
28 | marginHorizontal: 8,
29 | },
30 | text: {
31 | flex: 1,
32 | paddingTop: 16,
33 | paddingBottom: 16,
34 | paddingLeft: 8,
35 | paddingRight: 8,
36 | borderBottomWidth: 1,
37 | borderColor: '#eee',
38 | },
39 | name: {
40 | ...Fonts.style.normal,
41 | fontSize: Fonts.size.medium,
42 | textAlign: 'left',
43 | fontWeight: 'bold',
44 | flex: 1,
45 | },
46 | messageRow: {
47 | flexDirection: 'row',
48 | },
49 | nameRow: {
50 | flexDirection: 'row',
51 | },
52 | message: {
53 | ...Fonts.style.normal,
54 | color: '#777',
55 | fontSize: Fonts.size.small,
56 | textAlign: 'left',
57 | marginBottom: 5,
58 | },
59 | typing: {
60 | ...Fonts.style.normal,
61 | color: '#05b246',
62 | fontSize: Fonts.size.small,
63 | fontWeight: 'bold',
64 | textAlign: 'left',
65 | marginBottom: 5,
66 | },
67 | },
68 | button: {
69 | text: {
70 | fontSize: 20,
71 | color: '#ffffff',
72 | textAlign: 'center',
73 | },
74 | container: {
75 | paddingTop:10,
76 | paddingBottom:10,
77 | paddingLeft:20,
78 | paddingRight:20,
79 | backgroundColor: '#74d5f1',
80 | borderRadius:50,
81 | marginTop: 16,
82 | marginBottom: 16,
83 | }
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/App/Containers/Contacts/Create.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { ActivityIndicator, Text, View, Button, Image, TextInput } from 'react-native'
3 | import { PropTypes } from 'prop-types'
4 | import Style from './Style'
5 | import { Images } from 'App/Theme'
6 | import { Chat } from 'iris-lib'
7 | import gun from 'App/Services/GunService'
8 | import { iris } from 'App/Services/IrisService'
9 | import { Message, Attribute } from 'iris-lib'
10 | import NavigationService from 'App/Services/NavigationService'
11 |
12 | class CreateContactScreen extends React.Component {
13 | state = {
14 | contacts: []
15 | }
16 |
17 | static navigationOptions = {
18 | title: 'Add contact',
19 | headerRight: (
20 | this.addContact()} /> // TODO fix onPress
21 | )
22 | }
23 |
24 | componentDidMount() {
25 |
26 | }
27 |
28 | addContact() {
29 | if (this.state.name && !this.state.creatingContact) {
30 | this.setState({creatingContact: true})
31 | const uuid = Attribute.getUuid()
32 | const name = this.state.name
33 | const privateKey = gun.user().is.alias
34 | Message.createVerification({recipient: {uuid: uuid.value, name}}, privateKey)
35 | .then(m => iris().addMessage(m))
36 | this.props.navigation.navigate('ContactScreen', { type: 'uuid', value: uuid.value })
37 | }
38 | }
39 |
40 | render() {
41 | return (
42 |
43 | this.setState({name})}
52 | />
53 | this.addContact()} />
54 |
55 | )
56 | }
57 | }
58 |
59 | CreateContactScreen.propTypes = {
60 | chats: PropTypes.array,
61 | }
62 |
63 | export default CreateContactScreen
64 |
--------------------------------------------------------------------------------
/ios/Iris/AppDelegate.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #import "AppDelegate.h"
9 | #import "RNNotifications.h"
10 |
11 | #import
12 | #import
13 | #import
14 |
15 | #import
16 |
17 | @implementation AppDelegate
18 |
19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
20 | {
21 | [RNNotifications startMonitorNotifications];
22 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
23 | RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
24 | moduleName:@"Iris"
25 | initialProperties:nil];
26 |
27 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
28 |
29 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
30 | UIViewController *rootViewController = [UIViewController new];
31 | rootViewController.view = rootView;
32 | self.window.rootViewController = rootViewController;
33 | [self.window makeKeyAndVisible];
34 | [BugsnagReactNative start];
35 | return YES;
36 | }
37 |
38 | - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
39 | [RNNotifications didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
40 | }
41 |
42 | - (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error {
43 | [RNNotifications didFailToRegisterForRemoteNotificationsWithError:error];
44 | }
45 |
46 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
47 | {
48 | #if DEBUG
49 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
50 | #else
51 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
52 | #endif
53 | }
54 |
55 | @end
56 |
--------------------------------------------------------------------------------
/ios/IrisTests/IrisTests.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #import
9 | #import
10 |
11 | #import
12 | #import
13 |
14 | #define TIMEOUT_SECONDS 600
15 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!"
16 |
17 | @interface IrisTests : XCTestCase
18 |
19 | @end
20 |
21 | @implementation IrisTests
22 |
23 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test
24 | {
25 | if (test(view)) {
26 | return YES;
27 | }
28 | for (UIView *subview in [view subviews]) {
29 | if ([self findSubviewInView:subview matching:test]) {
30 | return YES;
31 | }
32 | }
33 | return NO;
34 | }
35 |
36 | - (void)testRendersWelcomeScreen
37 | {
38 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController];
39 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
40 | BOOL foundElement = NO;
41 |
42 | __block NSString *redboxError = nil;
43 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
44 | if (level >= RCTLogLevelError) {
45 | redboxError = message;
46 | }
47 | });
48 |
49 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
50 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
51 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
52 |
53 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) {
54 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
55 | return YES;
56 | }
57 | return NO;
58 | }];
59 | }
60 |
61 | RCTSetLogFunction(RCTDefaultLogFunction);
62 |
63 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
64 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
65 | }
66 |
67 |
68 | @end
69 |
--------------------------------------------------------------------------------
/App/Navigators/AppNavigator.js:
--------------------------------------------------------------------------------
1 | import { createAppContainer, createStackNavigator } from 'react-navigation'
2 |
3 | import ChatListScreen from 'App/Containers/Chat/List'
4 | import ChatScreen from 'App/Containers/Chat/Show'
5 | import CreateChatScreen from 'App/Containers/Chat/Create'
6 | import ContactListScreen from 'App/Containers/Contacts/List'
7 | import ContactScreen from 'App/Containers/Contacts/Show'
8 | import CreateContactScreen from 'App/Containers/Contacts/Create'
9 | import ShareContactScreen from 'App/Containers/Contacts/Share'
10 | import SplashScreen from 'App/Containers/SplashScreen/SplashScreen'
11 | import LoginScreen from 'App/Containers/Login/LoginScreen'
12 | import WelcomeScreen from 'App/Containers/Welcome/WelcomeScreen'
13 | import SettingsScreen from 'App/Containers/Settings/SettingsScreen'
14 | import ShowPrivateKeyScreen from 'App/Containers/Settings/ShowPrivateKeyScreen'
15 | import EditProfileScreen from 'App/Containers/Settings/EditProfileScreen'
16 | import PeersScreen from 'App/Containers/Settings/PeersScreen'
17 | import EditPhotoScreen from 'App/Containers/Settings/EditPhotoScreen'
18 | import ScanChatLinkScreen from 'App/Containers/ScanChatLink/Scan'
19 | import ScanPrivateKeyScreen from 'App/Containers/ScanPrivateKey/Scan'
20 |
21 | /**
22 | * The root screen contains the application's navigation.
23 | *
24 | * @see https://reactnavigation.org/docs/en/hello-react-navigation.html#creating-a-stack-navigator
25 | */
26 | const StackNavigator = createStackNavigator(
27 | {
28 | SplashScreen,
29 | WelcomeScreen,
30 | ChatScreen,
31 | ChatListScreen,
32 | CreateChatScreen,
33 | ContactListScreen,
34 | ContactScreen,
35 | CreateContactScreen,
36 | ShareContactScreen,
37 | LoginScreen,
38 | SettingsScreen,
39 | EditProfileScreen,
40 | PeersScreen,
41 | EditPhotoScreen,
42 | ShowPrivateKeyScreen,
43 | ScanChatLinkScreen,
44 | ScanPrivateKeyScreen,
45 | },
46 | {
47 | // By default the application will show the splash screen
48 | initialRouteName: 'WelcomeScreen',
49 | // See https://reactnavigation.org/docs/en/stack-navigator.html#stacknavigatorconfig
50 | headerMode: 'float',
51 | }
52 | )
53 |
54 | export default createAppContainer(StackNavigator)
55 |
--------------------------------------------------------------------------------
/ios/Iris/Base.lproj/LaunchScreen.xib:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/ios/Iris/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | Iris
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.07
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1.07
25 | LSApplicationCategoryType
26 |
27 | LSRequiresIPhoneOS
28 |
29 | NSAppTransportSecurity
30 |
31 | NSAllowsArbitraryLoads
32 |
33 | NSExceptionDomains
34 |
35 | localhost
36 |
37 | NSExceptionAllowsInsecureHTTPLoads
38 |
39 |
40 |
41 |
42 | NSLocationWhenInUseUsageDescription
43 |
44 | UILaunchStoryboardName
45 | LaunchScreen
46 | UIRequiredDeviceCapabilities
47 |
48 | armv7
49 |
50 | UISupportedInterfaceOrientations
51 |
52 | UIInterfaceOrientationPortrait
53 |
54 | UIViewControllerBasedStatusBarAppearance
55 |
56 | NSCameraUsageDescription
57 | Your message to user when the camera is accessed for the first time
58 | NSPhotoLibraryUsageDescription
59 | Your message to user when the photo library is accessed for the first time
60 | NSMicrophoneUsageDescription
61 | Your message to user when the microsphone is accessed for the first time
62 | BugsnagAPIKey
63 | bb9298087eb87d2c78929a201ddb3e88
64 |
65 |
66 |
--------------------------------------------------------------------------------
/App/Containers/Contacts/List.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { ActivityIndicator, Text, View, Button, Image, FlatList, TouchableWithoutFeedback } from 'react-native'
3 | import { PropTypes } from 'prop-types'
4 | import Style from './Style'
5 | import { Images } from 'App/Theme'
6 | import { Chat } from 'iris-lib'
7 | import gun from 'App/Services/GunService'
8 | import { session } from 'App/Services/IrisService'
9 | import { Identity } from 'iris-lib'
10 | import NavigationService from 'App/Services/NavigationService'
11 |
12 | class ContactListScreen extends React.Component {
13 | state = {
14 | chatsByKey: {},
15 | chats: []
16 | }
17 |
18 | static navigationOptions = {
19 | title: 'Contacts',
20 | headerLeft: null,
21 | gesturesEnabled: false,
22 | headerRight: (
23 | NavigationService.navigate('CreateContactScreen')}
25 | title="➕"
26 | />
27 | ),
28 | }
29 |
30 | componentDidMount() {
31 | const limit = 10
32 | const cursor = ''
33 | Chat.getChats(session.gun, session.keypair, pub => {
34 | this.setState(previousState => {
35 | const newState = {...previousState}
36 | console.log('session', session)
37 | const chat = new Chat({gun: session.gun, key: session.keypair, participants: pub})
38 | chat.name = pub
39 | newState.chatsByKey[pub] = chat
40 | newState.chats = Object.values(newState.chatsByKey)
41 | return newState
42 | })
43 | })
44 | }
45 |
46 | render() {
47 | return (
48 |
49 | (
52 | this.props.navigation.navigate('ContactScreen', { value: item.cursor.split(':')[0], type: item.cursor.split(':')[1] })}>
53 |
54 | {item.name}
55 |
56 |
57 | )}
58 | keyExtractor={item => item.cursor}
59 | />
60 |
61 | )
62 | }
63 | }
64 |
65 | ContactListScreen.propTypes = {
66 | chats: PropTypes.array,
67 | }
68 |
69 | export default ContactListScreen
70 |
--------------------------------------------------------------------------------
/App/Containers/Settings/EditPhotoScreen.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { View, Clipboard, Text, Image, Dimensions, TextInput, TouchableOpacity, KeyboardAvoidingView } from 'react-native'
3 | import Button from 'App/Components/Button'
4 | import Identicon from 'App/Components/Identicon'
5 | import { RNCamera } from 'react-native-camera'
6 | import QRCode from 'react-native-qrcode-svg'
7 | import Style from './SettingsScreenStyle'
8 | import gun from 'App/Services/GunService'
9 | import { session } from 'App/Services/IrisService'
10 | import ImagePicker from 'react-native-image-crop-picker'
11 |
12 | class EditPhotoScreen extends React.Component {
13 | state = {
14 | photo: null
15 | }
16 |
17 | static navigationOptions = {
18 | title: 'Edit photo',
19 | }
20 |
21 | componentDidMount() {
22 | gun.user().get('profile').get('photo').on(photo => this.setState({photo}))
23 | }
24 |
25 | choosePhoto() {
26 | ImagePicker.openPicker({
27 | width: 400,
28 | height: 400,
29 | cropping: true,
30 | includeBase64: true,
31 | }).then(image => {
32 | gun.user().get('profile').get('photo').put(`data:${image.mime};base64,${image.data}`)
33 | })
34 | }
35 |
36 | takePhoto() {
37 | ImagePicker.openCamera({
38 | width: 400,
39 | height: 400,
40 | cropping: true,
41 | includeBase64: true,
42 | useFrontCamera: true,
43 | }).then(image => {
44 | gun.user().get('profile').get('photo').put(`data:${image.mime};base64,${image.data}`)
45 | });
46 | }
47 |
48 | renderDeletePhoto() {
49 | return this.state.photo ? (
50 |
51 | {gun.user().get('profile').get('photo').put(null)}} />
52 |
53 | ) : (
54 |
55 | )
56 | }
57 |
58 | render() {
59 | return (
60 |
61 |
62 |
63 |
64 |
65 | {this.renderDeletePhoto()}
66 |
67 |
68 | )
69 | }
70 | }
71 |
72 | export default EditPhotoScreen
73 |
--------------------------------------------------------------------------------
/App/Containers/Chat/Create.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import QRCode from 'react-native-qrcode-svg'
3 | import { Platform, Text, View, TextInput, Clipboard } from 'react-native'
4 | import Button from 'App/Components/Button'
5 | import { PropTypes } from 'prop-types'
6 | import Style from './Style'
7 | import { Images } from 'App/Theme'
8 | import { Chat } from 'iris-lib'
9 | import gun from 'App/Services/GunService'
10 | import { session } from 'App/Services/IrisService'
11 | import { Identity } from 'iris-lib'
12 | import NavigationService from 'App/Services/NavigationService'
13 |
14 | class CreateChatScreen extends React.Component {
15 | static navigationOptions = {
16 | title: 'New chat',
17 | }
18 |
19 | openChat(link) {
20 | if (link.indexOf('http') === 0 && link.indexOf('chatWith')) {
21 | const chat = new Chat({key: session.keypair, gun, chatLink: link})
22 | const pub = Object.keys(chat.secrets)[0]
23 | this.props.navigation.navigate('ChatScreen', {pub})
24 | }
25 | }
26 |
27 | renderMyChatLink() {
28 | if (session.chatLinks && Object.values(session.chatLinks).length) {
29 | this.link = Object.values(session.chatLinks)[0]
30 | } else {
31 | this.link = 'https://iris.to/?chatWith=' + (session && session.keypair && session.keypair.pub)
32 | }
33 | return this.link ? (
34 |
35 |
39 | Clipboard.setString(this.link)} />
40 | But beware of sharing it publicly: you might get spammed with message requests.
41 |
42 | ) : (
43 |
44 | )
45 | }
46 |
47 | render() {
48 | return (
49 |
50 |
51 | this.openChat(link)}
57 | />
58 | this.props.navigation.navigate('ScanChatLinkScreen')} />
59 | Or give your chat link to someone:
60 | {this.renderMyChatLink()}
61 |
62 |
63 | )
64 | }
65 | }
66 |
67 | export default CreateChatScreen
68 |
--------------------------------------------------------------------------------
/App/Containers/Settings/EditProfileScreen.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { View, Clipboard, Text, Image, Dimensions, TextInput, TouchableOpacity, KeyboardAvoidingView } from 'react-native'
3 | import Button from 'App/Components/Button'
4 | import Identicon from 'App/Components/Identicon'
5 | import QRCode from 'react-native-qrcode-svg'
6 | import Style from './SettingsScreenStyle'
7 | import Navigation from 'App/Services/NavigationService'
8 | import gun from 'App/Services/GunService'
9 | import { session } from 'App/Services/IrisService'
10 |
11 | class EditProfileScreen extends React.Component {
12 | state = {
13 | photo: null
14 | }
15 |
16 | static navigationOptions = {
17 | title: 'Edit profile',
18 | }
19 |
20 | componentDidMount() {
21 | gun.user().get('profile').get('name').on(name => this.setState({name}))
22 | gun.user().get('profile').get('about').on(about => this.setState({about}))
23 | }
24 |
25 | render() {
26 | return (
27 |
28 | Navigation.navigate('EditPhotoScreen')}>
29 |
30 | Edit
31 |
32 | {
41 | name = name.trim()
42 | this.setState({name})
43 | gun.user().get('profile').get('name').put(name)
44 | }}
45 | value={this.state.name}
46 | />
47 | About
48 | {
55 | this.setState({about})
56 | gun.user().get('profile').get('about').put(about)
57 | }}
58 | value={this.state.about}
59 | />
60 |
61 | )
62 | }
63 | }
64 |
65 | export default EditProfileScreen
66 |
--------------------------------------------------------------------------------
/ios/Podfile:
--------------------------------------------------------------------------------
1 | platform :ios, '9.0'
2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
3 | target 'Iris' do
4 | # Pods for Iris
5 | permissions_path = '../node_modules/react-native-permissions/ios'
6 | pod 'React', :path => '../node_modules/react-native/'
7 | pod 'React-Core', :path => '../node_modules/react-native/React'
8 | pod 'React-DevSupport', :path => '../node_modules/react-native/React'
9 | pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
10 | pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
11 | pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
12 | pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
13 | pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
14 | pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
15 | pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
16 | pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
17 | pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
18 | pod 'React-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket'
19 | pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
20 | pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
21 | pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
22 | pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
23 | pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
24 | pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
25 | pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
26 | pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
27 | pod 'Permission-Camera', :path => "#{permissions_path}/Camera.podspec"
28 | pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications.podspec"
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | target 'IrisTests' do
38 | inherit! :search_paths
39 | # Pods for testing
40 | end
41 | use_native_modules!
42 | end
43 | target 'Iris-tvOS' do
44 | # Pods for Iris-tvOS
45 | target 'Iris-tvOSTests' do
46 | inherit! :search_paths
47 | # Pods for testing
48 | end
49 | end
50 |
--------------------------------------------------------------------------------
/App/Containers/Settings/PeersScreen.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { View, FlatList, Clipboard, Text, TextInput, TouchableOpacity, KeyboardAvoidingView } from 'react-native'
3 | import ListItem from 'App/Components/ListItem'
4 | import Button from 'App/Components/Button'
5 | import Identicon from 'App/Components/Identicon'
6 | import QRCode from 'react-native-qrcode-svg'
7 | import Style from './SettingsScreenStyle'
8 | import Navigation from 'App/Services/NavigationService'
9 | import gun from 'App/Services/GunService'
10 | import { session } from 'App/Services/IrisService'
11 |
12 | class PeersScreen extends React.Component {
13 | state = {
14 | peers: [],
15 | newPeerUrl: '',
16 | }
17 |
18 | static navigationOptions = {
19 | title: 'Peers',
20 | }
21 |
22 | componentDidMount() {
23 | const getPeers = () => {
24 | const peers = Object.values(gun.back('opt.peers'))
25 | this.setState({peers})
26 | }
27 | getPeers()
28 | this.interval = setInterval(getPeers, 2000)
29 | }
30 |
31 | componentWillUnmount() {
32 | clearInterval(this.interval)
33 | }
34 |
35 | addPeer() {
36 | const url = this.state.newPeerUrl.trim()
37 | if (url.indexOf('https://') === 0) {
38 | gun.opt({peers: [url]});
39 | this.setState({newPeerUrl: ''})
40 | }
41 | }
42 |
43 | disconnectPeer(peerFromGun) {
44 | gun.on('bye', peerFromGun);
45 | peerFromGun.url = '';
46 | }
47 |
48 | render() {
49 | return (
50 |
51 | (
54 |
55 | {item.wire && item.wire.hied === 'hi' ? '✓' : '✗'} {item.url}
56 | {this.disconnectPeer(item)}}/>
57 |
58 | )}
59 | />
60 | {
70 | this.setState({newPeerUrl})
71 | }}
72 | />
73 | { this.addPeer() }} />
74 |
75 | )
76 | }
77 | }
78 |
79 | export default PeersScreen
80 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Iris",
3 | "version": "0.0.1",
4 | "private": true,
5 | "scripts": {
6 | "start": "react-native start",
7 | "test": "jest --detectOpenHandles",
8 | "prettier-fix": "prettier --write **/*.js",
9 | "prettier-check": "prettier --list-different **/*.js",
10 | "lint-fix": "eslint --fix .",
11 | "lint-check": "eslint .",
12 | "rename": "react-native-rename",
13 | "postinstall": "npx jetify"
14 | },
15 | "dependencies": {
16 | "@gooddollar/gun-asyncstorage": "^1.0.3",
17 | "@gooddollar/react-native-webview-crypto": "^0.0.20",
18 | "@react-native-community/async-storage": "^1.9.0",
19 | "axios": "^0.19.0",
20 | "bugsnag-react-native": "^2.23.6",
21 | "gun": "mmalmi/gun#GoodDollar-master",
22 | "iris-lib": "irislib/iris-lib#rnsupport",
23 | "prop-types": "^15.7.2",
24 | "react": "16.8.6",
25 | "react-native": "0.60.5",
26 | "react-native-background-fetch": "^3.0.4",
27 | "react-native-camera": "^3.7.2",
28 | "react-native-gesture-handler": "^1.3.0",
29 | "react-native-get-random-values": "^1.3.1",
30 | "react-native-gifted-chat": "^0.11.0",
31 | "react-native-image-crop-picker": "0.25.3",
32 | "react-native-notifications": "^3.1.2",
33 | "react-native-permissions": "^2.0.2",
34 | "react-native-qrcode-scanner": "mmalmi/react-native-qrcode-scanner",
35 | "react-native-qrcode-svg": "^5.2.0",
36 | "react-native-randombytes": "^3.5.3",
37 | "react-native-svg": "^9.12.0",
38 | "react-native-webview": "^9.0.1",
39 | "react-navigation": "^3.11.2"
40 | },
41 | "devDependencies": {
42 | "@babel/core": "^7.5.5",
43 | "@babel/runtime": "^7.5.5",
44 | "@react-native-community/eslint-config": "^0.0.5",
45 | "babel-jest": "^24.5.0",
46 | "babel-plugin-transform-remove-console": "^6.9.4",
47 | "eslint": "^6.1.0",
48 | "eslint-config-prettier": "^4.1.0",
49 | "eslint-config-standard": "^12.0.0",
50 | "eslint-plugin-import": "^2.16.0",
51 | "eslint-plugin-node": "^8.0.1",
52 | "eslint-plugin-prettier": "^3.0.1",
53 | "eslint-plugin-promise": "^4.0.1",
54 | "eslint-plugin-react": "^7.12.4",
55 | "eslint-plugin-react-native": "^3.6.0",
56 | "eslint-plugin-standard": "^4.0.0",
57 | "jest": "^24.5.0",
58 | "metro-react-native-babel-preset": "^0.56.0",
59 | "prettier": "^1.16.4",
60 | "react-native-rename": "^2.4.1",
61 | "react-test-renderer": "16.8.6"
62 | },
63 | "jest": {
64 | "preset": "react-native",
65 | "setupFiles": [
66 | "./node_modules/react-native-gesture-handler/jestSetup.js"
67 | ],
68 | "transformIgnorePatterns": [
69 | "/node_modules/(?!react-native)/.+"
70 | ]
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem http://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
33 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
34 |
35 | @rem Find java.exe
36 | if defined JAVA_HOME goto findJavaFromJavaHome
37 |
38 | set JAVA_EXE=java.exe
39 | %JAVA_EXE% -version >NUL 2>&1
40 | if "%ERRORLEVEL%" == "0" goto init
41 |
42 | echo.
43 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
44 | echo.
45 | echo Please set the JAVA_HOME variable in your environment to match the
46 | echo location of your Java installation.
47 |
48 | goto fail
49 |
50 | :findJavaFromJavaHome
51 | set JAVA_HOME=%JAVA_HOME:"=%
52 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
53 |
54 | if exist "%JAVA_EXE%" goto init
55 |
56 | echo.
57 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
58 | echo.
59 | echo Please set the JAVA_HOME variable in your environment to match the
60 | echo location of your Java installation.
61 |
62 | goto fail
63 |
64 | :init
65 | @rem Get command-line arguments, handling Windows variants
66 |
67 | if not "%OS%" == "Windows_NT" goto win9xME_args
68 |
69 | :win9xME_args
70 | @rem Slurp the command line arguments.
71 | set CMD_LINE_ARGS=
72 | set _SKIP=2
73 |
74 | :win9xME_args_slurp
75 | if "x%~1" == "x" goto execute
76 |
77 | set CMD_LINE_ARGS=%*
78 |
79 | :execute
80 | @rem Setup the command line
81 |
82 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
83 |
84 | @rem Execute Gradle
85 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
86 |
87 | :end
88 | @rem End local scope for the variables with windows NT shell
89 | if "%ERRORLEVEL%"=="0" goto mainEnd
90 |
91 | :fail
92 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
93 | rem the _cmd.exe /c_ return code!
94 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
95 | exit /b 1
96 |
97 | :mainEnd
98 | if "%OS%"=="Windows_NT" endlocal
99 |
100 | :omega
101 |
--------------------------------------------------------------------------------
/App/Components/ChatListItem.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import PropTypes from 'prop-types';
3 | import { TouchableWithoutFeedback, Text, StyleSheet, View } from 'react-native';
4 | import ApplicationStyles from 'App/Theme/ApplicationStyles'
5 | import Identicon from './Identicon'
6 | import { util, Chat } from 'iris-lib'
7 | import Svg from 'App/Components/Svg'
8 | import { SvgXml } from 'react-native-svg'
9 | import gun from 'App/Services/GunService'
10 | import NavigationService from 'App/Services/NavigationService'
11 |
12 | class ChatListItem extends Component {
13 | state = {
14 | isTyping: false,
15 | }
16 |
17 | componentDidMount() {
18 | const chat = this.props.chat
19 | chat.getTheirMsgsLastSeenTime(lastSeenTime => this.setState(prev => {return {...prev, lastSeenTime}}))
20 | Chat.getOnline(gun, chat.pub, isOnline => this.setState(prev => {return {...prev, isOnline}}))
21 | chat.getTyping(isTyping => this.setState(prev => {return {...prev, isTyping}}))
22 | }
23 |
24 | renderLatestSeen() {
25 | const chat = this.props.chat
26 | if (chat.latest && chat.latest.info.selfAuthored && !this.state.isTyping) {
27 | const t = chat.latest.date.toISOString()
28 | if (this.state.lastSeenTime >= t) {
29 | return ()
30 | } else if (this.state.isOnline && this.state.isOnline.lastActive >= t) {
31 | return ()
32 | } else {
33 | return ()
34 | }
35 | } else return ()
36 | }
37 |
38 | render() {
39 | const { chat } = this.props;
40 | let latestTimeText = ''
41 | if (chat.latest) {
42 | const now = new Date()
43 | latestTimeText = util.getDaySeparatorText(chat.latest.date, chat.latest.date.toLocaleDateString({dateStyle:'short'}))
44 | if (latestTimeText === 'today') { latestTimeText = util.formatTime(chat.latest.date) }
45 | }
46 | return (
47 | NavigationService.navigate('ChatScreen', { pub: chat.pub, title: chat.name })}>
48 |
49 |
50 |
51 |
52 | {chat.name || ''}
53 | {latestTimeText}
54 |
55 |
56 | {this.renderLatestSeen()}
57 | {(this.state.isTyping && 'Typing...') || (chat.latest && chat.latest.text) || ''}{chat.hasUnseen ? '*' : ''}
58 |
59 |
60 |
61 |
62 | );
63 | }
64 | }
65 |
66 | ChatListItem.propTypes = {
67 | chat: PropTypes.object.isRequired,
68 | };
69 |
70 | export default ChatListItem;
71 |
--------------------------------------------------------------------------------
/.flowconfig:
--------------------------------------------------------------------------------
1 | [ignore]
2 | ; We fork some components by platform
3 | .*/*[.]android.js
4 |
5 | ; Ignore "BUCK" generated dirs
6 | /\.buckd/
7 |
8 | ; Ignore unexpected extra "@providesModule"
9 | .*/node_modules/.*/node_modules/fbjs/.*
10 |
11 | ; Ignore duplicate module providers
12 | ; For RN Apps installed via npm, "Libraries" folder is inside
13 | ; "node_modules/react-native" but in the source repo it is in the root
14 | node_modules/react-native/Libraries/react-native/React.js
15 |
16 | ; Ignore polyfills
17 | node_modules/react-native/Libraries/polyfills/.*
18 |
19 | ; These should not be required directly
20 | ; require from fbjs/lib instead: require('fbjs/lib/warning')
21 | node_modules/warning/.*
22 |
23 | ; Flow doesn't support platforms
24 | .*/Libraries/Utilities/HMRLoadingView.js
25 |
26 | [untyped]
27 | .*/node_modules/@react-native-community/cli/.*/.*
28 |
29 | [include]
30 |
31 | [libs]
32 | node_modules/react-native/Libraries/react-native/react-native-interface.js
33 | node_modules/react-native/flow/
34 |
35 | [options]
36 | emoji=true
37 |
38 | esproposal.optional_chaining=enable
39 | esproposal.nullish_coalescing=enable
40 |
41 | module.file_ext=.js
42 | module.file_ext=.json
43 | module.file_ext=.ios.js
44 |
45 | module.system=haste
46 | module.system.haste.use_name_reducers=true
47 | # get basename
48 | module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
49 | # strip .js or .js.flow suffix
50 | module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
51 | # strip .ios suffix
52 | module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
53 | module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
54 | module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
55 | module.system.haste.paths.blacklist=.*/__tests__/.*
56 | module.system.haste.paths.blacklist=.*/__mocks__/.*
57 | module.system.haste.paths.whitelist=/node_modules/react-native/Libraries/.*
58 | module.system.haste.paths.whitelist=/node_modules/react-native/RNTester/.*
59 | module.system.haste.paths.whitelist=/node_modules/react-native/IntegrationTests/.*
60 | module.system.haste.paths.blacklist=/node_modules/react-native/Libraries/react-native/react-native-implementation.js
61 | module.system.haste.paths.blacklist=/node_modules/react-native/Libraries/Animated/src/polyfills/.*
62 |
63 | munge_underscores=true
64 |
65 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
66 |
67 | suppress_type=$FlowIssue
68 | suppress_type=$FlowFixMe
69 | suppress_type=$FlowFixMeProps
70 | suppress_type=$FlowFixMeState
71 |
72 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
73 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
74 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
75 |
76 | [lints]
77 | sketchy-null-number=warn
78 | sketchy-null-mixed=warn
79 | sketchy-number=warn
80 | untyped-type-import=warn
81 | nonstrict-import=warn
82 | deprecated-type=warn
83 | unsafe-getters-setters=warn
84 | inexact-spread=warn
85 | unnecessary-invariant=warn
86 | signature-verification-failure=warn
87 | deprecated-utility=error
88 |
89 | [strict]
90 | deprecated-type
91 | nonstrict-import
92 | sketchy-null
93 | unclear-type
94 | unsafe-getters-setters
95 | untyped-import
96 | untyped-type-import
97 |
98 | [version]
99 | ^0.98.0
--------------------------------------------------------------------------------
/App/Containers/Welcome/WelcomeScreen.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { Platform, Text, KeyboardAvoidingView, View, ActivityIndicator, Image, TextInput } from 'react-native'
3 | import { PropTypes } from 'prop-types'
4 | import Style from './WelcomeScreenStyle'
5 | import Button from 'App/Components/Button'
6 | import { Images } from 'App/Theme'
7 | import gunInstance from 'App/Services/GunService'
8 | import gun from 'gun';
9 | import { login as irisLogin, isValidKey } from 'App/Services/IrisService'
10 | import { Key, Message, Chat } from 'iris-lib'
11 | import {Notifications} from 'react-native-notifications'
12 | import AsyncStorage from '@react-native-community/async-storage'
13 | import Navigation from 'App/Services/NavigationService'
14 |
15 | class WelcomeScreen extends React.Component {
16 | state = {
17 | isLoading: true,
18 | }
19 |
20 | componentDidMount() {
21 | AsyncStorage.getItem('iris_keypair').then(val => {
22 | if (val && val.length) {
23 | try {
24 | const key = JSON.parse(val)
25 | if (isValidKey(key)) {
26 | this.logInWithKey(key)
27 | } else {
28 | this.setState({isLoading: false})
29 | }
30 | } catch (e) {
31 | this.setState({isLoading: false})
32 | }
33 | } else {
34 | this.setState({isLoading: false})
35 | }
36 | })
37 | }
38 |
39 | static navigationOptions = {
40 | header: null
41 | }
42 |
43 | logInWithKey(key, name) {
44 | gunInstance.user().auth(key)
45 | irisLogin(gunInstance, key, name)
46 | Navigation.navigateAndReset('ChatListScreen')
47 |
48 | Chat.setOnline(gunInstance, true)
49 | }
50 |
51 | logInAsNewUser() {
52 | const name = this.state.name
53 | if (!(name && name.length > 0)) {
54 | return; // TODO: show error
55 | }
56 | if (name.indexOf('{') !== -1 || name.indexOf('}') !== -1) {
57 | return; // prevent accidentally pasting private key here
58 | }
59 | Key.generate().then(key => {
60 | this.logInWithKey(key, name)
61 | Chat.createChatLink(gunInstance, key)
62 | })
63 | }
64 |
65 | render() {
66 | return this.state.isLoading ? () : (
67 |
68 |
69 |
70 |
71 |
72 | this.setState({name})}
84 | />
85 | this.logInAsNewUser()} />
86 |
87 |
88 |
89 | this.props.navigation.navigate('LoginScreen')} />
90 |
91 |
92 |
93 | )
94 | }
95 | }
96 |
97 | WelcomeScreen.propTypes = {
98 | user: PropTypes.object,
99 | userIsLoading: PropTypes.bool,
100 | userErrorMessage: PropTypes.string,
101 | }
102 |
103 | export default WelcomeScreen
104 |
--------------------------------------------------------------------------------
/docs/setup cocoapods.md:
--------------------------------------------------------------------------------
1 | # Setup CocoaPods
2 |
3 | [CocoaPods](https://cocoapods.org/) is a package management tool for iOS and macOS development.
4 | You can use it to add the actual React Native framework code into our project, and especially to manage thirdparty packages.
5 |
6 | In this boilerplate, we don't want to make CocoaPods as a required tool.
7 | But if you planned to manage a lot of thirdparty dependencies, it should be a really good idea to follow this guide.
8 |
9 | Finally, we didn't specify it yet, but this tool is for iOS dependencies only. On Android, `react-native linking` seems to be enough.
10 |
11 |
12 | ## Setup CocoaPods
13 |
14 | First you must install CocoaPods :
15 | ```bash
16 | brew install cocoapods
17 | ```
18 |
19 | Then simply create a `Podfile` file, which will be the configuration file of all your dependencies.
20 | The easiest way is by running :
21 | ```bash
22 | cd ios
23 | pod init
24 | ```
25 |
26 | ## Package management
27 |
28 | ### React Native framework
29 |
30 | One of the main thing you must know about using CocoaPods, is that we need to manage React itself as a pod dependency to make it works well.
31 | It means that you can decide what parts of React Native framework you would like to integrate into your app. So you must not forget to append each React Native `subspec` inside the `Podfile`.
32 | This part is fully explained in the [official React Native documentation](https://facebook.github.io/react-native/docs/integration-with-existing-apps#configuring-cocoapods-dependencies)
33 |
34 | So, add the following into your `Podfile` :
35 | ```
36 | # The target name is most likely the name of your project.
37 | target 'NumberTileGame' do
38 |
39 | # Your 'node_modules' directory is probably in the root of your project,
40 | # but if not, adjust the `:path` accordingly
41 | pod 'React', :path => '../node_modules/react-native', :subspecs => [
42 | 'Core',
43 | 'CxxBridge', # Include this for RN >= 0.47
44 | 'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
45 | 'RCTText',
46 | 'RCTNetwork',
47 | 'RCTWebSocket', # Needed for debugging
48 | 'RCTAnimation', # Needed for FlatList and animations running on native UI thread
49 | # Add any other subspecs you want to use in your project
50 | ]
51 | # Explicitly include Yoga if you are using RN >= 0.42.0
52 | pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
53 |
54 | # Third party deps podspec link
55 | pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
56 | pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
57 | pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
58 |
59 | end
60 | ```
61 |
62 | Your are now ready to install your pod.
63 | ```
64 | pod install
65 | ```
66 |
67 | ### Thirdparty packages
68 |
69 | On the other hand, you can really easily link librairies to your project.
70 |
71 | You just have to append a line like the following inside your Podfile :
72 | ```
73 | pod 'RNExampleLib.podspec', :path => '../node_modules/react-native-example-lib'
74 | ```
75 | and run :
76 | ```
77 | pod install
78 | ```
79 |
80 | That's all ! :tada:
81 |
82 | ## Key points
83 |
84 |
85 | - You must always use the `.xcworkspace` file inside Xcode instead of the `.xcodeproj` one.
86 | - Sometimes, running `react-native link` will automatically try to perform a pod install. Read carefuly each thirdparty package install doc.`
87 |
88 | ---
89 |
90 | More resources :
91 | - [Demystifying react-native modules linking](https://engineering.brigad.co/demystifying-react-native-modules-linking-ae6c017a6b4a)
92 | - [Configuring CocoaPods dependencies](https://facebook.github.io/react-native/docs/integration-with-existing-apps#configuring-cocoapods-dependencies)
93 | - [Beginner’s Guide to Using CocoaPods with React Native](https://shift.infinite.red/beginner-s-guide-to-using-cocoapods-with-react-native-46cb4d372995)
94 |
--------------------------------------------------------------------------------
/App/Theme/Helpers.js:
--------------------------------------------------------------------------------
1 | import { StyleSheet } from 'react-native'
2 | import { Colors } from 'App/Theme'
3 |
4 | export default StyleSheet.create({
5 | backgroundReset: {
6 | backgroundColor: Colors.transparent,
7 | },
8 | center: {
9 | alignItems: 'center',
10 | justifyContent: 'center',
11 | },
12 | colCenter: {
13 | alignItems: 'center',
14 | flexDirection: 'column',
15 | justifyContent: 'center',
16 | },
17 | colCross: {
18 | alignItems: 'center',
19 | flexDirection: 'column',
20 | },
21 | colMain: {
22 | flexDirection: 'column',
23 | justifyContent: 'center',
24 | },
25 | column: {
26 | flexDirection: 'column',
27 | },
28 | columnReverse: {
29 | flexDirection: 'column-reverse',
30 | },
31 | crossCenter: {
32 | alignItems: 'center',
33 | },
34 | crossEnd: {
35 | alignItems: 'flex-end',
36 | },
37 | crossStart: {
38 | alignItems: 'flex-start',
39 | },
40 | crossStretch: {
41 | alignItems: 'stretch',
42 | },
43 | fill: {
44 | flex: 1,
45 | },
46 | fillCenter: {
47 | alignItems: 'center',
48 | flex: 1,
49 | justifyContent: 'center',
50 | },
51 | fillCol: {
52 | flex: 1,
53 | flexDirection: 'column',
54 | },
55 | fillColCenter: {
56 | alignItems: 'center',
57 | flex: 1,
58 | flexDirection: 'column',
59 | justifyContent: 'center',
60 | },
61 | fillColCross: {
62 | alignItems: 'center',
63 | flex: 1,
64 | flexDirection: 'column',
65 | },
66 | fillColMain: {
67 | flex: 1,
68 | flexDirection: 'column',
69 | justifyContent: 'center',
70 | },
71 | fillColReverse: {
72 | flex: 1,
73 | flexDirection: 'column-reverse',
74 | },
75 | fillRow: {
76 | flex: 1,
77 | flexDirection: 'row',
78 | },
79 | fillRowCenter: {
80 | alignItems: 'center',
81 | flex: 1,
82 | flexDirection: 'row',
83 | justifyContent: 'center',
84 | },
85 | fillRowCross: {
86 | alignItems: 'center',
87 | flex: 1,
88 | flexDirection: 'row',
89 | },
90 | fillRowMain: {
91 | flex: 1,
92 | flexDirection: 'row',
93 | justifyContent: 'center',
94 | },
95 | fillRowReverse: {
96 | flex: 1,
97 | flexDirection: 'row-reverse',
98 | },
99 | fullSize: {
100 | height: '100%',
101 | width: '100%',
102 | },
103 | fullWidth: {
104 | width: '100%',
105 | },
106 | mainCenter: {
107 | justifyContent: 'center',
108 | },
109 | mainEnd: {
110 | justifyContent: 'flex-end',
111 | },
112 | mainSpaceAround: {
113 | justifyContent: 'space-around',
114 | },
115 | mainSpaceBetween: {
116 | justifyContent: 'space-between',
117 | },
118 | mainStart: {
119 | justifyContent: 'flex-start',
120 | },
121 | mirror: {
122 | transform: [{ scaleX: -1 }],
123 | },
124 | rotate90: {
125 | transform: [{ rotate: '90deg' }],
126 | },
127 | rotate90Inverse: {
128 | transform: [{ rotate: '-90deg' }],
129 | },
130 | row: {
131 | flexDirection: 'row',
132 | },
133 | rowCenter: {
134 | alignItems: 'center',
135 | flexDirection: 'row',
136 | justifyContent: 'center',
137 | },
138 | rowCross: {
139 | alignItems: 'center',
140 | flexDirection: 'row',
141 | },
142 | rowMain: {
143 | flexDirection: 'row',
144 | justifyContent: 'center',
145 | },
146 | rowReverse: {
147 | flexDirection: 'row-reverse',
148 | },
149 | scrollSpaceAround: {
150 | flexGrow: 1,
151 | justifyContent: 'space-around',
152 | },
153 | scrollSpaceBetween: {
154 | flexGrow: 1,
155 | justifyContent: 'space-between',
156 | },
157 | selfStretch: {
158 | alignSelf: 'stretch',
159 | },
160 | textCenter: {
161 | textAlign: 'center',
162 | },
163 | textJustify: {
164 | textAlign: 'justify',
165 | },
166 | textLeft: {
167 | textAlign: 'left',
168 | },
169 | textRight: {
170 | textAlign: 'right',
171 | },
172 | })
173 |
--------------------------------------------------------------------------------
/App/Containers/Chat/Show.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { TouchableOpacity, Text, View } from 'react-native'
3 | import { GiftedChat } from 'react-native-gifted-chat'
4 | import { Chat, util } from 'iris-lib'
5 | import Style from './Style'
6 | import Identicon from 'App/Components/Identicon'
7 | import NavigationService from 'App/Services/NavigationService'
8 | import gun from 'App/Services/GunService'
9 | import { session } from 'App/Services/IrisService'
10 |
11 | class ChatScreen extends React.Component {
12 | state = {
13 | messages: [],
14 | onlineStatus: {},
15 | }
16 |
17 | static navigationOptions = ({navigation}) => {
18 | const {state} = navigation;
19 | return {
20 | headerTitle: (
21 | NavigationService.navigate('ContactScreen', { pub: state.params.pub, title: state.params.title || '' })}>
22 |
23 |
24 | {state.params.title || ''}
25 | {(state.params.isTyping && 'typing...') || state.params.onlineStatus && (state.params.onlineStatus.isOnline && 'online' || 'last active ' + util.formatDate(new Date(state.params.onlineStatus.lastActive)))}
26 |
27 |
28 | )
29 | }
30 | }
31 |
32 | componentDidMount() {
33 | const pub = this.props.navigation.getParam('pub')
34 | const setName = name => {
35 | this.name = name
36 | this.props.navigation.setParams({title: name})
37 | this.setState(previousState => {
38 | const newState = {...previousState}
39 | for (let i = 0; i < newState.messages.length; i++) {
40 | const m = newState.messages[i]
41 | if (m.user._id === 2) {
42 | m.user.name = name
43 | }
44 | }
45 | return newState
46 | })
47 | }
48 | setName('')
49 | gun.user(pub).get('profile').get('name').on(setName)
50 | const onMessage = (msg, info) => {
51 | this.chat.setMyMsgsLastSeenTime()
52 | this.setState(previousState => {
53 | msg.sent = msg.time <= (previousState.onlineStatus && previousState.onlineStatus.lastActive)
54 | msg.received = msg.time <= previousState.lastSeenTime
55 | msg.createdAt = new Date(msg.time)
56 | msg._id = msg.time + (info.selfAuthored ? 0 : 1)
57 | msg.user = {
58 | name: this.name || msg.author,
59 | _id: (info.selfAuthored ? 1 : 2),
60 | }
61 | newMessages = previousState.messages.concat(msg)
62 | newMessages.sort((a, b) => b.createdAt - a.createdAt)
63 | return { ...previousState, messages: newMessages }
64 | });
65 | }
66 | this.chat = new Chat({gun, key: session.keypair, participants: pub, onMessage});
67 | this.chat.setMyMsgsLastSeenTime()
68 | this.chat.getTyping(isTyping => {
69 | this.props.navigation.setParams({isTyping})
70 | })
71 | this.chat.getTheirMsgsLastSeenTime(lastSeenTime => {
72 | this.setState(previousState => {
73 | const newMessages = [...previousState.messages]
74 | newMessages.forEach(m => m.received = m.sent = (m.time <= lastSeenTime))
75 | return { ...previousState, messages: newMessages, lastSeenTime }
76 | })
77 | })
78 | Chat.getOnline(gun, pub, onlineStatus => {
79 | this.props.navigation.setParams({onlineStatus})
80 | this.setState(previousState => {
81 | return {...previousState, onlineStatus}
82 | })
83 | })
84 | /*
85 | this.setState({
86 | messages: [
87 | {
88 | _id: 1,
89 | text: 'Hello developer, I am ' + key,
90 | createdAt: new Date(),
91 | user: {
92 | _id: 2,
93 | name: 'React Native',
94 | avatar: 'https://placeimg.com/140/140/any',
95 | },
96 | },
97 | ],
98 | })
99 | */
100 | }
101 |
102 | onSend(messages = []) {
103 | messages.forEach(m => {
104 | this.chat.send({
105 | text: m.text,
106 | time: new Date().toISOString(),
107 | author: 'me'
108 | })
109 | })
110 | }
111 |
112 | render() { // backgroundColor: '#e5ddd5'
113 | return (
114 |
115 | this.onSend(messages)}
119 | user={{
120 | _id: 1,
121 | }}
122 | onInputTextChanged={text => {
123 | this.chat.setTyping(text.length > 0)
124 | }}
125 | />
126 |
127 | )
128 | }
129 | }
130 |
131 | export default ChatScreen
132 |
--------------------------------------------------------------------------------
/ios/Iris.xcodeproj/xcshareddata/xcschemes/Iris.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
43 |
49 |
50 |
51 |
52 |
53 |
58 |
59 |
65 |
66 |
67 |
68 |
70 |
76 |
77 |
78 |
79 |
80 |
90 |
92 |
98 |
99 |
100 |
101 |
107 |
109 |
115 |
116 |
117 |
118 |
120 |
121 |
124 |
125 |
126 |
--------------------------------------------------------------------------------
/ios/Iris.xcodeproj/xcshareddata/xcschemes/Iris-tvOS.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
43 |
49 |
50 |
51 |
52 |
53 |
58 |
59 |
61 |
67 |
68 |
69 |
70 |
71 |
77 |
78 |
79 |
80 |
81 |
82 |
92 |
94 |
100 |
101 |
102 |
103 |
104 |
105 |
111 |
113 |
119 |
120 |
121 |
122 |
124 |
125 |
128 |
129 |
130 |
--------------------------------------------------------------------------------
/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | #
4 | # Copyright 2015 the original author or authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | ##############################################################################
20 | ##
21 | ## Gradle start up script for UN*X
22 | ##
23 | ##############################################################################
24 |
25 | # Attempt to set APP_HOME
26 | # Resolve links: $0 may be a link
27 | PRG="$0"
28 | # Need this for relative symlinks.
29 | while [ -h "$PRG" ] ; do
30 | ls=`ls -ld "$PRG"`
31 | link=`expr "$ls" : '.*-> \(.*\)$'`
32 | if expr "$link" : '/.*' > /dev/null; then
33 | PRG="$link"
34 | else
35 | PRG=`dirname "$PRG"`"/$link"
36 | fi
37 | done
38 | SAVED="`pwd`"
39 | cd "`dirname \"$PRG\"`/" >/dev/null
40 | APP_HOME="`pwd -P`"
41 | cd "$SAVED" >/dev/null
42 |
43 | APP_NAME="Gradle"
44 | APP_BASE_NAME=`basename "$0"`
45 |
46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48 |
49 | # Use the maximum available, or set MAX_FD != -1 to use that value.
50 | MAX_FD="maximum"
51 |
52 | warn () {
53 | echo "$*"
54 | }
55 |
56 | die () {
57 | echo
58 | echo "$*"
59 | echo
60 | exit 1
61 | }
62 |
63 | # OS specific support (must be 'true' or 'false').
64 | cygwin=false
65 | msys=false
66 | darwin=false
67 | nonstop=false
68 | case "`uname`" in
69 | CYGWIN* )
70 | cygwin=true
71 | ;;
72 | Darwin* )
73 | darwin=true
74 | ;;
75 | MINGW* )
76 | msys=true
77 | ;;
78 | NONSTOP* )
79 | nonstop=true
80 | ;;
81 | esac
82 |
83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
84 |
85 | # Determine the Java command to use to start the JVM.
86 | if [ -n "$JAVA_HOME" ] ; then
87 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
88 | # IBM's JDK on AIX uses strange locations for the executables
89 | JAVACMD="$JAVA_HOME/jre/sh/java"
90 | else
91 | JAVACMD="$JAVA_HOME/bin/java"
92 | fi
93 | if [ ! -x "$JAVACMD" ] ; then
94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
95 |
96 | Please set the JAVA_HOME variable in your environment to match the
97 | location of your Java installation."
98 | fi
99 | else
100 | JAVACMD="java"
101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
102 |
103 | Please set the JAVA_HOME variable in your environment to match the
104 | location of your Java installation."
105 | fi
106 |
107 | # Increase the maximum file descriptors if we can.
108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
109 | MAX_FD_LIMIT=`ulimit -H -n`
110 | if [ $? -eq 0 ] ; then
111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
112 | MAX_FD="$MAX_FD_LIMIT"
113 | fi
114 | ulimit -n $MAX_FD
115 | if [ $? -ne 0 ] ; then
116 | warn "Could not set maximum file descriptor limit: $MAX_FD"
117 | fi
118 | else
119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
120 | fi
121 | fi
122 |
123 | # For Darwin, add options to specify how the application appears in the dock
124 | if $darwin; then
125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
126 | fi
127 |
128 | # For Cygwin, switch paths to Windows format before running java
129 | if $cygwin ; then
130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
132 | JAVACMD=`cygpath --unix "$JAVACMD"`
133 |
134 | # We build the pattern for arguments to be converted via cygpath
135 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
136 | SEP=""
137 | for dir in $ROOTDIRSRAW ; do
138 | ROOTDIRS="$ROOTDIRS$SEP$dir"
139 | SEP="|"
140 | done
141 | OURCYGPATTERN="(^($ROOTDIRS))"
142 | # Add a user-defined pattern to the cygpath arguments
143 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
145 | fi
146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
147 | i=0
148 | for arg in "$@" ; do
149 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
150 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
151 |
152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
153 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
154 | else
155 | eval `echo args$i`="\"$arg\""
156 | fi
157 | i=$((i+1))
158 | done
159 | case $i in
160 | (0) set -- ;;
161 | (1) set -- "$args0" ;;
162 | (2) set -- "$args0" "$args1" ;;
163 | (3) set -- "$args0" "$args1" "$args2" ;;
164 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
165 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
166 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
167 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
168 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
169 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
170 | esac
171 | fi
172 |
173 | # Escape application args
174 | save () {
175 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
176 | echo " "
177 | }
178 | APP_ARGS=$(save "$@")
179 |
180 | # Collect all arguments for the java command, following the shell quoting and substitution rules
181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
182 |
183 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
184 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
185 | cd "$(dirname "$0")"
186 | fi
187 |
188 | exec "$JAVACMD" "$@"
189 |
--------------------------------------------------------------------------------
/App/Containers/Chat/List.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { ActivityIndicator, Text, View, Image, FlatList, TouchableWithoutFeedback, TouchableOpacity } from 'react-native'
3 | import ListItem from 'App/Components/ListItem'
4 | import ChatListItem from 'App/Components/ChatListItem'
5 | import Identicon from 'App/Components/Identicon'
6 | import { PropTypes } from 'prop-types'
7 | import Style from './Style'
8 | import { ApplicationStyles, Images } from 'App/Theme'
9 | import { Chat } from 'iris-lib'
10 | import gun from 'App/Services/GunService'
11 | import { session } from 'App/Services/IrisService'
12 | import { Identity } from 'iris-lib'
13 | import NavigationService from 'App/Services/NavigationService'
14 | import { SvgXml } from 'react-native-svg'
15 | import Svg from 'App/Components/Svg'
16 | import {Notifications} from 'react-native-notifications'
17 | import BackgroundFetch from "react-native-background-fetch";
18 |
19 | function sortChatsByLatest(chatsArr) {
20 | return chatsArr.sort((a, b) => ((b.latest && b.latest.date) || Infinity) - ((a.latest && a.latest.date) || Infinity))
21 | }
22 |
23 | class ChatListScreen extends React.Component {
24 | state = {
25 | chats: {},
26 | chatsArr: [],
27 | }
28 |
29 | static navigationOptions = ({navigation}) => {
30 | const {state} = navigation;
31 | return {
32 | title: 'Chats',
33 | headerTitle: '',
34 | headerLeft: (
35 | NavigationService.navigate('SettingsScreen')}>
36 |
37 | {(state.params && state.params.name) || ''}
38 |
39 | )
40 | }
41 | }
42 |
43 | checkNotify(chat) { // TODO: move to iris-lib
44 | function check() {
45 | return chat.latest && (!chat.myLastSeenTime || (chat.myLastSeenTime < chat.latest.time))
46 | }
47 | function notify() {
48 | Notifications.postLocalNotification({
49 | body: chat.latest && chat.latest.text || '',
50 | title: chat.name,
51 | sound: "chime.aiff",
52 | silent: false,
53 | category: "SOME_CATEGORY",
54 | userInfo: { },
55 | })
56 | }
57 | if (check()) {
58 | chat.hasUnseen = true
59 | if (!chat.myLastSeenTime) {
60 | setTimeout(() => { // give it a chance to get chat.myLastSeenTime
61 | if (check()) { notify() }
62 | }, 2000);
63 | } else { notify() }
64 | } else {
65 | chat.hasUnseen = false
66 | }
67 | }
68 |
69 | componentDidMount() {
70 | gun.user().get('profile').get('name').on(name => this.props.navigation.setParams({name}))
71 | Chat.getChats(session.gun, session.keypair, pub => {
72 | console.log('got chat', pub);
73 | this.setState(previousState => {
74 | if (previousState.chats[pub]) {
75 | return
76 | }
77 | const newState = {...previousState}
78 | const chat = new Chat({gun: session.gun, key: session.keypair, participants: pub})
79 | chat.pub = pub
80 | chat.name = ''
81 | chat.getLatestMsg((msg, info) => {
82 | this.setState(previousState => {
83 | const newState = {...previousState}
84 | msg.date = new Date(msg.time)
85 | msg.info = info
86 | chat.latest = msg
87 | newState.chatsArr = sortChatsByLatest(newState.chatsArr)
88 | this.checkNotify(chat)
89 | return newState
90 | })
91 | })
92 | chat.getMyMsgsLastSeenTime(lastSeenTime => {
93 | chat.myLastSeenTime = lastSeenTime
94 | this.checkNotify(chat)
95 | })
96 | newState.chats[pub] = chat
97 | newState.chatsArr = sortChatsByLatest(Object.values(newState.chats))
98 | return newState
99 | })
100 | gun.user(pub).get('profile').get('name').on(name => {
101 | this.setState(previousState => {
102 | const newState = {...previousState}
103 | newState.chats[pub].name = name
104 | newState.chatsArr = sortChatsByLatest(Object.values(newState.chats))
105 | return newState
106 | })
107 | })
108 | })
109 |
110 | Notifications.registerRemoteNotifications()
111 | Notifications.events().registerNotificationReceivedForeground((notification: Notification, completion) => {
112 | console.log(`Notification received in foreground: ${JSON.stringify(notification)}`);
113 | completion({alert: true, sound: true, badge: true});
114 | })
115 | Notifications.events().registerNotificationOpened((notification: Notification, completion) => {
116 | console.log(`Notification opened: ${notification}`);
117 | completion();
118 | })
119 |
120 | BackgroundFetch.configure({
121 | minimumFetchInterval: 15, // <-- minutes (15 is minimum allowed)
122 | // Android options
123 | forceAlarmManager: false, // <-- Set true to bypass JobScheduler.
124 | stopOnTerminate: false,
125 | startOnBoot: true,
126 | requiredNetworkType: BackgroundFetch.NETWORK_TYPE_NONE, // Default
127 | requiresCharging: false, // Default
128 | requiresDeviceIdle: false, // Default
129 | requiresBatteryNotLow: false, // Default
130 | requiresStorageNotLow: false // Default
131 | }, async (taskId) => {
132 | console.log("[js] Received background-fetch event: ", taskId);
133 | Notifications.postLocalNotification({
134 | body: "Local notificiation!",
135 | title: "Local Notification Title",
136 | sound: "chime.aiff",
137 | category: "SOME_CATEGORY",
138 | userInfo: { },
139 | })
140 | // Required: Signal completion of your task to native code
141 | // If you fail to do this, the OS can terminate your app
142 | // or assign battery-blame for consuming too much background-time
143 | BackgroundFetch.finish(taskId);
144 | }, (error) => {
145 | console.log("[js] RNBackgroundFetch failed to start");
146 | });
147 |
148 | // Optional: Query the authorization status.
149 | BackgroundFetch.status((status) => {
150 | switch(status) {
151 | case BackgroundFetch.STATUS_RESTRICTED:
152 | console.log("BackgroundFetch restricted");
153 | break;
154 | case BackgroundFetch.STATUS_DENIED:
155 | console.log("BackgroundFetch denied");
156 | break;
157 | case BackgroundFetch.STATUS_AVAILABLE:
158 | console.log("BackgroundFetch is enabled");
159 | break;
160 | }
161 | });
162 | }
163 |
164 | render() {
165 | return (
166 |
167 | this.props.navigation.navigate('CreateChatScreen')}>
168 |
169 | New chat
170 |
171 |
172 | (
175 |
176 | )}
177 | keyExtractor={item => item.pub}
178 | />
179 |
180 | )
181 | }
182 | }
183 |
184 | ChatListScreen.propTypes = {
185 | chats: PropTypes.array,
186 | }
187 |
188 | export default ChatListScreen
189 |
--------------------------------------------------------------------------------
/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: "com.android.application"
2 | apply plugin: 'com.google.gms.google-services'
3 |
4 | import com.android.build.OutputFile
5 |
6 | /**
7 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
8 | * and bundleReleaseJsAndAssets).
9 | * These basically call `react-native bundle` with the correct arguments during the Android build
10 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
11 | * bundle directly from the development server. Below you can see all the possible configurations
12 | * and their defaults. If you decide to add a configuration block, make sure to add it before the
13 | * `apply from: "../../node_modules/react-native/react.gradle"` line.
14 | *
15 | * project.ext.react = [
16 | * // the name of the generated asset file containing your JS bundle
17 | * bundleAssetName: "index.android.bundle",
18 | *
19 | * // the entry file for bundle generation
20 | * entryFile: "index.android.js",
21 |
22 | * // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format
23 | * bundleCommand: "ram-bundle",
24 | *
25 | * // whether to bundle JS and assets in debug mode
26 | * bundleInDebug: false,
27 | *
28 | * // whether to bundle JS and assets in release mode
29 | * bundleInRelease: true,
30 | *
31 | * // whether to bundle JS and assets in another build variant (if configured).
32 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
33 | * // The configuration property can be in the following formats
34 | * // 'bundleIn${productFlavor}${buildType}'
35 | * // 'bundleIn${buildType}'
36 | * // bundleInFreeDebug: true,
37 | * // bundleInPaidRelease: true,
38 | * // bundleInBeta: true,
39 | *
40 | * // whether to disable dev mode in custom build variants (by default only disabled in release)
41 | * // for example: to disable dev mode in the staging build type (if configured)
42 | * devDisabledInStaging: true,
43 | * // The configuration property can be in the following formats
44 | * // 'devDisabledIn${productFlavor}${buildType}'
45 | * // 'devDisabledIn${buildType}'
46 | *
47 | * // the root of your project, i.e. where "package.json" lives
48 | * root: "../../",
49 | *
50 | * // where to put the JS bundle asset in debug mode
51 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
52 | *
53 | * // where to put the JS bundle asset in release mode
54 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release",
55 | *
56 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
57 | * // require('./image.png')), in debug mode
58 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
59 | *
60 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
61 | * // require('./image.png')), in release mode
62 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
63 | *
64 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means
65 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
66 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle
67 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
68 | * // for example, you might want to remove it from here.
69 | * inputExcludes: ["android/**", "ios/**"],
70 | *
71 | * // override which node gets called and with what additional arguments
72 | * nodeExecutableAndArgs: ["node"],
73 | *
74 | * // supply additional arguments to the packager
75 | * extraPackagerArgs: []
76 | * ]
77 | */
78 |
79 | project.ext.react = [
80 | entryFile: "index.js",
81 | enableHermes: false, // clean and rebuild if changing
82 | ]
83 |
84 | apply from: "../../node_modules/react-native/react.gradle"
85 |
86 | /**
87 | * Set this to true to create two separate APKs instead of one:
88 | * - An APK that only works on ARM devices
89 | * - An APK that only works on x86 devices
90 | * The advantage is the size of the APK is reduced by about 4MB.
91 | * Upload all the APKs to the Play Store and people will download
92 | * the correct one based on the CPU architecture of their device.
93 | */
94 | def enableSeparateBuildPerCPUArchitecture = false
95 |
96 | /**
97 | * Run Proguard to shrink the Java bytecode in release builds.
98 | */
99 | def enableProguardInReleaseBuilds = false
100 |
101 | /**
102 | * The preferred build flavor of JavaScriptCore.
103 | *
104 | * For example, to use the international variant, you can use:
105 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
106 | *
107 | * The international variant includes ICU i18n library and necessary data
108 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
109 | * give correct results when using with locales other than en-US. Note that
110 | * this variant is about 6MiB larger per architecture than default.
111 | */
112 | def jscFlavor = 'org.webkit:android-jsc:+'
113 | /**
114 | * Whether to enable the Hermes VM.
115 | *
116 | * This should be set on project.ext.react and mirrored here. If it is not set
117 | * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
118 | * and the benefits of using Hermes will therefore be sharply reduced.
119 | */
120 | def enableHermes = project.ext.react.get("enableHermes", false);
121 |
122 | android {
123 | compileSdkVersion rootProject.ext.compileSdkVersion
124 |
125 | compileOptions {
126 | sourceCompatibility JavaVersion.VERSION_1_8
127 | targetCompatibility JavaVersion.VERSION_1_8
128 | }
129 |
130 | defaultConfig {
131 | applicationId "to.iris.Iris"
132 | minSdkVersion rootProject.ext.minSdkVersion
133 | targetSdkVersion rootProject.ext.targetSdkVersion
134 | versionCode 1070
135 | versionName "1.07"
136 | missingDimensionStrategy 'react-native-camera', 'general'
137 | vectorDrawables.useSupportLibrary = true
138 | }
139 | splits {
140 | abi {
141 | reset()
142 | enable enableSeparateBuildPerCPUArchitecture
143 | universalApk false // If true, also generate a universal APK
144 | include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
145 | }
146 | }
147 | signingConfigs {
148 | debug {
149 | storeFile file('debug.keystore')
150 | storePassword 'android'
151 | keyAlias 'androiddebugkey'
152 | keyPassword 'android'
153 | }
154 | }
155 | buildTypes {
156 | debug {
157 | signingConfig signingConfigs.debug
158 | }
159 | release {
160 | // Caution! In production, you need to generate your own keystore file.
161 | // see https://facebook.github.io/react-native/docs/signed-apk-android.
162 | signingConfig signingConfigs.debug
163 | minifyEnabled enableProguardInReleaseBuilds
164 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
165 | }
166 | }
167 | // applicationVariants are e.g. debug, release
168 | applicationVariants.all { variant ->
169 | variant.outputs.each { output ->
170 | // For each separate APK per architecture, set a unique version code as described here:
171 | // https://developer.android.com/studio/build/configure-apk-splits.html
172 | def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
173 | def abi = output.getFilter(OutputFile.ABI)
174 | if (abi != null) { // null for the universal-debug, universal-release variants
175 | output.versionCodeOverride =
176 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
177 | }
178 | }
179 | }
180 |
181 | packagingOptions {
182 | pickFirst '**/armeabi-v7a/libc++_shared.so'
183 | pickFirst '**/x86/libc++_shared.so'
184 | pickFirst '**/arm64-v8a/libc++_shared.so'
185 | pickFirst '**/x86_64/libc++_shared.so'
186 | pickFirst '**/x86/libjsc.so'
187 | pickFirst '**/armeabi-v7a/libjsc.so'
188 | }
189 | }
190 |
191 | dependencies {
192 | implementation project(':react-native-notifications')
193 | implementation fileTree(dir: "libs", include: ["*.jar"])
194 | implementation "com.facebook.react:react-native:+" // From node_modules
195 |
196 | if (enableHermes) {
197 | def hermesPath = "../../node_modules/hermesvm/android/";
198 | debugImplementation files(hermesPath + "hermes-debug.aar")
199 | releaseImplementation files(hermesPath + "hermes-release.aar")
200 | } else {
201 | implementation jscFlavor
202 | }
203 | }
204 |
205 | // Run this once to be able to run the application with BUCK
206 | // puts all compile dependencies into folder libs for BUCK to use
207 | task copyDownloadableDepsToLibs(type: Copy) {
208 | from configurations.compile
209 | into 'libs'
210 | }
211 |
212 | apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
213 |
--------------------------------------------------------------------------------
/ios/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - boost-for-react-native (1.63.0)
3 | - BugsnagReactNative (2.23.6):
4 | - BugsnagReactNative/Core (= 2.23.6)
5 | - React
6 | - BugsnagReactNative/Core (2.23.6):
7 | - React
8 | - DoubleConversion (1.1.6)
9 | - Folly (2018.10.22.00):
10 | - boost-for-react-native
11 | - DoubleConversion
12 | - Folly/Default (= 2018.10.22.00)
13 | - glog
14 | - Folly/Default (2018.10.22.00):
15 | - boost-for-react-native
16 | - DoubleConversion
17 | - glog
18 | - glog (0.3.5)
19 | - Permission-Camera (2.0.2):
20 | - RNPermissions
21 | - Permission-Notifications (2.0.2):
22 | - RNPermissions
23 | - QBImagePickerController (3.4.0)
24 | - React (0.60.5):
25 | - React-Core (= 0.60.5)
26 | - React-DevSupport (= 0.60.5)
27 | - React-RCTActionSheet (= 0.60.5)
28 | - React-RCTAnimation (= 0.60.5)
29 | - React-RCTBlob (= 0.60.5)
30 | - React-RCTImage (= 0.60.5)
31 | - React-RCTLinking (= 0.60.5)
32 | - React-RCTNetwork (= 0.60.5)
33 | - React-RCTSettings (= 0.60.5)
34 | - React-RCTText (= 0.60.5)
35 | - React-RCTVibration (= 0.60.5)
36 | - React-RCTWebSocket (= 0.60.5)
37 | - React-Core (0.60.5):
38 | - Folly (= 2018.10.22.00)
39 | - React-cxxreact (= 0.60.5)
40 | - React-jsiexecutor (= 0.60.5)
41 | - yoga (= 0.60.5.React)
42 | - React-cxxreact (0.60.5):
43 | - boost-for-react-native (= 1.63.0)
44 | - DoubleConversion
45 | - Folly (= 2018.10.22.00)
46 | - glog
47 | - React-jsinspector (= 0.60.5)
48 | - React-DevSupport (0.60.5):
49 | - React-Core (= 0.60.5)
50 | - React-RCTWebSocket (= 0.60.5)
51 | - React-jsi (0.60.5):
52 | - boost-for-react-native (= 1.63.0)
53 | - DoubleConversion
54 | - Folly (= 2018.10.22.00)
55 | - glog
56 | - React-jsi/Default (= 0.60.5)
57 | - React-jsi/Default (0.60.5):
58 | - boost-for-react-native (= 1.63.0)
59 | - DoubleConversion
60 | - Folly (= 2018.10.22.00)
61 | - glog
62 | - React-jsiexecutor (0.60.5):
63 | - DoubleConversion
64 | - Folly (= 2018.10.22.00)
65 | - glog
66 | - React-cxxreact (= 0.60.5)
67 | - React-jsi (= 0.60.5)
68 | - React-jsinspector (0.60.5)
69 | - react-native-camera (3.8.0):
70 | - React
71 | - react-native-camera/RCT (= 3.8.0)
72 | - react-native-camera/RN (= 3.8.0)
73 | - react-native-camera/RCT (3.8.0):
74 | - React
75 | - react-native-camera/RN (3.8.0):
76 | - React
77 | - react-native-get-random-values (1.3.1):
78 | - React
79 | - react-native-notifications (3.1.2):
80 | - React
81 | - react-native-randombytes (3.5.3):
82 | - React
83 | - react-native-webview (9.0.1):
84 | - React
85 | - React-RCTActionSheet (0.60.5):
86 | - React-Core (= 0.60.5)
87 | - React-RCTAnimation (0.60.5):
88 | - React-Core (= 0.60.5)
89 | - React-RCTBlob (0.60.5):
90 | - React-Core (= 0.60.5)
91 | - React-RCTNetwork (= 0.60.5)
92 | - React-RCTWebSocket (= 0.60.5)
93 | - React-RCTImage (0.60.5):
94 | - React-Core (= 0.60.5)
95 | - React-RCTNetwork (= 0.60.5)
96 | - React-RCTLinking (0.60.5):
97 | - React-Core (= 0.60.5)
98 | - React-RCTNetwork (0.60.5):
99 | - React-Core (= 0.60.5)
100 | - React-RCTSettings (0.60.5):
101 | - React-Core (= 0.60.5)
102 | - React-RCTText (0.60.5):
103 | - React-Core (= 0.60.5)
104 | - React-RCTVibration (0.60.5):
105 | - React-Core (= 0.60.5)
106 | - React-RCTWebSocket (0.60.5):
107 | - React-Core (= 0.60.5)
108 | - RNBackgroundFetch (3.0.4):
109 | - React
110 | - RNCAsyncStorage (1.6.2):
111 | - React
112 | - RNGestureHandler (1.4.1):
113 | - React
114 | - RNImageCropPicker (0.25.3):
115 | - QBImagePickerController
116 | - React-Core
117 | - React-RCTImage
118 | - RSKImageCropper
119 | - RNPermissions (2.0.2):
120 | - React
121 | - RNSVG (9.12.0):
122 | - React
123 | - RSKImageCropper (2.2.3)
124 | - yoga (0.60.5.React)
125 |
126 | DEPENDENCIES:
127 | - BugsnagReactNative (from `../node_modules/bugsnag-react-native`)
128 | - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
129 | - Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`)
130 | - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
131 | - Permission-Camera (from `../node_modules/react-native-permissions/ios/Camera.podspec`)
132 | - Permission-Notifications (from `../node_modules/react-native-permissions/ios/Notifications.podspec`)
133 | - React (from `../node_modules/react-native/`)
134 | - React-Core (from `../node_modules/react-native/React`)
135 | - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`)
136 | - React-DevSupport (from `../node_modules/react-native/React`)
137 | - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`)
138 | - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
139 | - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
140 | - react-native-camera (from `../node_modules/react-native-camera`)
141 | - react-native-get-random-values (from `../node_modules/react-native-get-random-values`)
142 | - react-native-notifications (from `../node_modules/react-native-notifications`)
143 | - react-native-randombytes (from `../node_modules/react-native-randombytes`)
144 | - react-native-webview (from `../node_modules/react-native-webview`)
145 | - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)
146 | - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`)
147 | - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`)
148 | - React-RCTImage (from `../node_modules/react-native/Libraries/Image`)
149 | - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`)
150 | - React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`)
151 | - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`)
152 | - React-RCTText (from `../node_modules/react-native/Libraries/Text`)
153 | - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`)
154 | - React-RCTWebSocket (from `../node_modules/react-native/Libraries/WebSocket`)
155 | - RNBackgroundFetch (from `../node_modules/react-native-background-fetch`)
156 | - "RNCAsyncStorage (from `../node_modules/@react-native-community/async-storage`)"
157 | - RNGestureHandler (from `../node_modules/react-native-gesture-handler`)
158 | - RNImageCropPicker (from `../node_modules/react-native-image-crop-picker`)
159 | - RNPermissions (from `../node_modules/react-native-permissions`)
160 | - RNSVG (from `../node_modules/react-native-svg`)
161 | - yoga (from `../node_modules/react-native/ReactCommon/yoga`)
162 |
163 | SPEC REPOS:
164 | https://github.com/CocoaPods/Specs.git:
165 | - boost-for-react-native
166 | trunk:
167 | - QBImagePickerController
168 | - RSKImageCropper
169 |
170 | EXTERNAL SOURCES:
171 | BugsnagReactNative:
172 | :path: "../node_modules/bugsnag-react-native"
173 | DoubleConversion:
174 | :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
175 | Folly:
176 | :podspec: "../node_modules/react-native/third-party-podspecs/Folly.podspec"
177 | glog:
178 | :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
179 | Permission-Camera:
180 | :path: "../node_modules/react-native-permissions/ios/Camera.podspec"
181 | Permission-Notifications:
182 | :path: "../node_modules/react-native-permissions/ios/Notifications.podspec"
183 | React:
184 | :path: "../node_modules/react-native/"
185 | React-Core:
186 | :path: "../node_modules/react-native/React"
187 | React-cxxreact:
188 | :path: "../node_modules/react-native/ReactCommon/cxxreact"
189 | React-DevSupport:
190 | :path: "../node_modules/react-native/React"
191 | React-jsi:
192 | :path: "../node_modules/react-native/ReactCommon/jsi"
193 | React-jsiexecutor:
194 | :path: "../node_modules/react-native/ReactCommon/jsiexecutor"
195 | React-jsinspector:
196 | :path: "../node_modules/react-native/ReactCommon/jsinspector"
197 | react-native-camera:
198 | :path: "../node_modules/react-native-camera"
199 | react-native-get-random-values:
200 | :path: "../node_modules/react-native-get-random-values"
201 | react-native-notifications:
202 | :path: "../node_modules/react-native-notifications"
203 | react-native-randombytes:
204 | :path: "../node_modules/react-native-randombytes"
205 | react-native-webview:
206 | :path: "../node_modules/react-native-webview"
207 | React-RCTActionSheet:
208 | :path: "../node_modules/react-native/Libraries/ActionSheetIOS"
209 | React-RCTAnimation:
210 | :path: "../node_modules/react-native/Libraries/NativeAnimation"
211 | React-RCTBlob:
212 | :path: "../node_modules/react-native/Libraries/Blob"
213 | React-RCTImage:
214 | :path: "../node_modules/react-native/Libraries/Image"
215 | React-RCTLinking:
216 | :path: "../node_modules/react-native/Libraries/LinkingIOS"
217 | React-RCTNetwork:
218 | :path: "../node_modules/react-native/Libraries/Network"
219 | React-RCTSettings:
220 | :path: "../node_modules/react-native/Libraries/Settings"
221 | React-RCTText:
222 | :path: "../node_modules/react-native/Libraries/Text"
223 | React-RCTVibration:
224 | :path: "../node_modules/react-native/Libraries/Vibration"
225 | React-RCTWebSocket:
226 | :path: "../node_modules/react-native/Libraries/WebSocket"
227 | RNBackgroundFetch:
228 | :path: "../node_modules/react-native-background-fetch"
229 | RNCAsyncStorage:
230 | :path: "../node_modules/@react-native-community/async-storage"
231 | RNGestureHandler:
232 | :path: "../node_modules/react-native-gesture-handler"
233 | RNImageCropPicker:
234 | :path: "../node_modules/react-native-image-crop-picker"
235 | RNPermissions:
236 | :path: "../node_modules/react-native-permissions"
237 | RNSVG:
238 | :path: "../node_modules/react-native-svg"
239 | yoga:
240 | :path: "../node_modules/react-native/ReactCommon/yoga"
241 |
242 | SPEC CHECKSUMS:
243 | boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
244 | BugsnagReactNative: 76ba231ece009a6fad369f18d89779ab75cc1c7d
245 | DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2
246 | Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51
247 | glog: 1f3da668190260b06b429bb211bfbee5cd790c28
248 | Permission-Camera: 626e0ac1c9e92e680b223522dcf9344bb1041fff
249 | Permission-Notifications: e48255cd901bf9d294b9833bfaf51b82e8f67a77
250 | QBImagePickerController: d54cf93db6decf26baf6ed3472f336ef35cae022
251 | React: 53c53c4d99097af47cf60594b8706b4e3321e722
252 | React-Core: ba421f6b4f4cbe2fb17c0b6fc675f87622e78a64
253 | React-cxxreact: 8384287780c4999351ad9b6e7a149d9ed10a2395
254 | React-DevSupport: 197fb409737cff2c4f9986e77c220d7452cb9f9f
255 | React-jsi: 4d8c9efb6312a9725b18d6fc818ffc103f60fec2
256 | React-jsiexecutor: 90ad2f9db09513fc763bc757fdc3c4ff8bde2a30
257 | React-jsinspector: e08662d1bf5b129a3d556eb9ea343a3f40353ae4
258 | react-native-camera: 21cf4ed26cf432ceb1fae959aa6924943fd6f714
259 | react-native-get-random-values: 148a42f97f2ce180a52d219144e83c278d4fe24b
260 | react-native-notifications: f56a12d741eeb2fd4d7a418a4689111c50f7cd72
261 | react-native-randombytes: 3638d24759d67c68f6ccba60c52a7a8a8faa6a23
262 | react-native-webview: 3f2f9934ba8633a170d209cb84045b6cbc5e5f48
263 | React-RCTActionSheet: b0f1ea83f4bf75fb966eae9bfc47b78c8d3efd90
264 | React-RCTAnimation: 359ba1b5690b1e87cc173558a78e82d35919333e
265 | React-RCTBlob: 5e2b55f76e9a1c7ae52b826923502ddc3238df24
266 | React-RCTImage: f5f1c50922164e89bdda67bcd0153952a5cfe719
267 | React-RCTLinking: d0ecbd791e9ddddc41fa1f66b0255de90e8ee1e9
268 | React-RCTNetwork: e26946300b0ab7bb6c4a6348090e93fa21f33a9d
269 | React-RCTSettings: d0d37cb521b7470c998595a44f05847777cc3f42
270 | React-RCTText: b074d89033583d4f2eb5faf7ea2db3a13c7553a2
271 | React-RCTVibration: 2105b2e0e2b66a6408fc69a46c8a7fb5b2fdade0
272 | React-RCTWebSocket: cd932a16b7214898b6b7f788c8bddb3637246ac4
273 | RNBackgroundFetch: 388cf1595934d22fed275b8db9b48a28bb4eb7b6
274 | RNCAsyncStorage: 60a80e72d95bf02a01cace55d3697d9724f0d77f
275 | RNGestureHandler: 4cb47a93019c1a201df2644413a0a1569a51c8aa
276 | RNImageCropPicker: bfb3ea9c8622f290532e2fe63f369e0d5a52f597
277 | RNPermissions: 9525b0f4d209fdf9a373d52d1492ae2943e691e5
278 | RNSVG: 75670614bca635d3dd64bc267bc199e539cb4fa9
279 | RSKImageCropper: a446db0e8444a036b34f3c43db01b2373baa4b2a
280 | yoga: 312528f5bbbba37b4dcea5ef00e8b4033fdd9411
281 |
282 | PODFILE CHECKSUM: 63459cdde056a32ae7a7745dd29ef2a0648a29fe
283 |
284 | COCOAPODS: 1.8.4
285 |
--------------------------------------------------------------------------------
/docs/beta builds.md:
--------------------------------------------------------------------------------
1 | # Distributing beta builds
2 |
3 | Developers love writing React Native code but no one likes deploying React Native app or distributing beta builds.
4 |
5 | All your headaches will disappear with this documentation and the amazing [Fastlane](https://fastlane.tools/) tool :)
6 |
7 |
8 | ## Before you start
9 |
10 | You need a Mac. I'm sorry, but if you are a Windows user, you can stop reading right now.
11 | Fastlane will not work on Windows PC. But in all cases, if you need to deploy your app on IOS, you must have a Mac.
12 |
13 | Let's explain which tools we are using to distribute beta builds:
14 | * [Fastlane](https://fastlane.tools/), the easiest way to automate beta deployments and releases for your iOS and Android apps. It handles all tedious tasks like generating screenshots, dealing with code signing and releasing your application.
15 | * [TestFlight](https://developer.apple.com/testflight/), part of App Store Connect, let you build your iOS app and invite internal or external users to test it
16 | * [Google Play](https://support.google.com/googleplay/android-developer/answer/3131213?hl=fr), which does the same job as TestFlight for Android apps
17 |
18 | ```
19 | If you love this documentation, give us a star, you will be a ray of sunshine in our lives :)
20 | ```
21 |
22 | _This documentation is a part of a React Native project template for building solid applications through separation of concerns between the UI, state management and business logic._
23 | _Just navigate to the [project home page](https://github.com/thecodingmachine/react-native-boilerplate) if you want to see more._
24 |
25 | ## Installing Fastlane
26 |
27 | First you need to install Fastlane on your Mac. Follow these steps:
28 |
29 | 1. Install the latest Xcode command line tools:
30 | ```
31 | $ xcode-select --install
32 | ```
33 | 2. Install Ruby using [Homebrew](https://brew.sh/):
34 | ```
35 | $ brew install ruby
36 | ```
37 | 3. Install Fastlane with RubyGems:
38 | ```
39 | $ sudo gem install fastlane -NV
40 | ```
41 |
42 | You are now ready to set up Fastlane for iOS and Android :rocket:
43 |
44 |
45 | ## iOS
46 |
47 | ### Prerequisites
48 |
49 | Before continuing make sure you have:
50 |
51 | - [ ] Install all [required dependencies](https://facebook.github.io/react-native/docs/getting-started.html#installing-dependencies), with Xcode 9 or higher
52 | - [ ] Choose the [bundle identifier](https://cocoacasts.com/what-are-app-ids-and-bundle-identifiers/) of your app (for example `com.tcm.boilerplate`)
53 | - [ ] An Apple ID with an admin user, with its username (email, for example `dev-team@yourcompany.com`) and password
54 | - [ ] Your app name, if not already created on the Developer Portal (for example `TCM React Native Boilerplate`). Fastlane can create applications in the Developer Portal and App Store Connect, so it's recommended to let Fastlane do the job for you.
55 | - [ ] Use the right [.gitignore](../ios/.gitignore) file inside the `ios` directory
56 | - [ ] You also need to create an App Icon to use Fastlane or you will get an error on running `fastlane beta`. You can simply create one using the website [MakeAppIcon](https://makeappicon.com/)
57 |
58 | Open your Xcode project and modify some information:
59 |
60 | - [ ] In the `General` tab, `Identity` section, change the `Bundle Identifier` to your identifier (useful for Fastlane)
61 | - [ ] In the `General` tab, `Signing` section, disable `Automatically manage signing`
62 | - [ ] In the `Build Settings` tab, `Signing` section and into `Code Signing Identity`, set `Don't Code Sign` for the `debug` line (including `Any iOS SDK` also) and set `iOS Distribution` for the `release` line (including `Any iOS SDK` also).
63 |
64 | Like this:
65 |
66 | | Code Signing Identity | < Multiple values > |
67 | | ------------- | ------------- |
68 | | Debug | Don't Code Sign |
69 | | Any iOS SDK | Don't Code Sign |
70 | | Release | iOS Distribution |
71 | | Any iOS SDK | iOS Distribution |
72 |
73 |
74 | ### Setting up
75 |
76 | First you need to set up Fastlane for your iOS project:
77 | ```
78 | $ cd my-project/ios
79 | $ fastlane init
80 | ```
81 |
82 | *Note: If you have an error on this step, please see the `issues` section.*
83 |
84 |
85 | Fastlane will automatically detect your project and ask for any missing information.
86 |
87 | The following questions will be asked:
88 | * `What would you like to use fastlane for?`
89 | * For this tutorial a good answer is `2 - Automate beta distribution to TestFlight`
90 | * `Select Scheme:`
91 | * Here we will select the scheme without `-tvOS` suffix
92 | * `Apple ID Username:`
93 | * If you don't know, you didn't read the "Prerequisites" step :)
94 | Our answer is `dev-team@yourcompany.com`
95 | * `Password (for Apple ID Username):`
96 | * If you don't know, you didn't read the "Prerequisites" step :)
97 | Our answer is `keep it secret`
98 |
99 | * If your account has multiple teams in the App Store Connect, you may have this question: `Multiple App Store Connect teams found, please enter the number of the team you want to use:`
100 | * Select the right team
101 | * If your account has multiple teams in the Developer Portal, you may have this question: `Multiple teams found on the Developer Portal, please enter the number of the team you want to use:`
102 | * Select the right team
103 | * If you havent't already created the App on the Developer Portal or App Store Connect, Fastlane can do it for you! (else you must have a message `Your app 'com.tcm.boilerplate' is available in your Apple Developer Portal / App Store Connect`)
104 | * It will ask `Do you want fastlane to create the App ID for you on the Apple Developer Portal / App Store Connect? (y/n)`
105 | * Type `y`
106 | * `App Name`:
107 | * `TCM React Native Boilerplate`
108 |
109 | Fastlane will then give you some information about git, the files it will create, etc. Just type `enter` to continue.
110 |
111 | **Congrats!** Fastlane has created some files.
112 |
113 | If you are using Git, commit all generated files.
114 |
115 | Once the setup has finished you can see a new folder inside the `ios` folder:
116 | ```
117 | - fastlane/
118 | - Appfile
119 | - Fastfile
120 | ```
121 |
122 | It's not finish, you need to follow `Code Signing` part to setting up a provisioning profile.
123 |
124 | For information:
125 |
126 | `Appfile` contains identifiers used to connect to the Developer Portal and App Store Connect.
127 | You can read more about this file [here](https://docs.fastlane.tools/advanced/#appfile).
128 |
129 | `Fastfile` contains all actions you can launch.
130 | You can read more about this file [here](https://docs.fastlane.tools/actions).
131 | Because we previously chose `Automate beta distribution to TestFlight` on set up, a `beta` [lane](https://docs.fastlane.tools/advanced/lanes/) is available by default.
132 | This `lane` contains 3 actions:
133 | * increment the build number of your app
134 | * build your app
135 | * upload to TestFlight
136 |
137 |
138 | ### Code signing
139 |
140 | Signing your app assures users that it is from a known source and the app hasn’t been modified since it was last signed. Before your app can integrate app services, be installed on a device, or be submitted to the App Store, it must be signed with a certificate issued by Apple.
141 |
142 | A full guide is available on the fastlane doc, describing the best approaches for your [code signing process](https://docs.fastlane.tools/codesigning/getting-started/).
143 |
144 | Using `match` is probably [the best solution](https://codesigning.guide/).
145 | Because we don't want to revoke our existing certificates, but still want an automated setup, we will use [cert and sigh](https://docs.fastlane.tools/codesigning/getting-started/#using-cert-and-sigh).
146 |
147 | Add the following lines to your `Fastfile`, just after the `increment_build_number` function and before `build_app` (Note that you will need to replace some information):
148 | ```
149 | get_certificates( # Create or get certificate, and install it
150 | output_path: "./builds" # Download certificate in the build folder (you don't need to create the folder)
151 | )
152 | get_provisioning_profile( # Create or get provisioning profile
153 | output_path: "./builds", # Download provisioning profile in the build folder
154 | filename: "provisioning.mobileprovision" # Rename the local provisioning profile
155 | )
156 | update_project_provisioning( # Set the project provisioning profile (related in Xcode to the General > Signing Release section)
157 | xcodeproj: "Boilerplate.xcodeproj",
158 | target_filter: "Boilerplate", # Name of your project
159 | profile: "./builds/provisioning.mobileprovision",
160 | build_configuration: "Release"
161 | )
162 | update_project_team( # Set the right team on your project
163 | teamid: CredentialsManager::AppfileConfig.try_fetch_value(:team_id)
164 | )
165 | ```
166 |
167 | Then, we need to configure the provisioning profile for the build step.
168 |
169 | Add the following lines to your `Fastfile`, inside the `build_app` function, just after the `scheme` parameter (Make sure you add a `,` after the `scheme` parameter):
170 | ```
171 | clean: true,
172 | export_method: "app-store",
173 | export_options: {
174 | provisioningProfiles: {
175 | CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier) => CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier) + " AppStore" # Value of this parameter is the name of the Provisioning Profile. By default, it will be "{bundleId} AppStore"
176 | }
177 | },
178 | build_path: "./builds",
179 | output_directory: "./builds"
180 | ```
181 |
182 | Thanks to this the Certificates and Provisioning Profile will be automatically created when you will create a beta build!
183 | :rocket: You are now ready to create your first beta build.
184 |
185 |
186 | ### Creating a beta build
187 |
188 | Creating a beta build and uploading it on TestFlight is now really easy.
189 | Just type the following:
190 |
191 | ```
192 | $ cd my-project/ios
193 | $ fastlane beta
194 | ```
195 |
196 |
197 | ## Android
198 |
199 | ### Prerequisites
200 |
201 | Before continuing make sure you have:
202 |
203 | - [ ] A Google Play Console *admin* account and its username (email, for example `dev-team@yourcompany.com`) and password
204 | - [ ] Create your application in the Google Play Console (unlike for iOS Fastlane cannot do that for you)
205 | - [ ] Use the right [.gitignore](../android/.gitignore) file inside the `android` directory (if you are using this boilerplate you are good to go)
206 | - [ ] [Collect your Google Credentials](https://docs.fastlane.tools/getting-started/android/setup/#collect-your-google-credentials)
207 | :warning: In the Google Play Console, add the parameter `&hl=en` at the end of the URL (before any #) to switch to English. In some languages, the "Create Service Account" will not be available.
208 | Download the JSON key file, and copy it into `my-project/android/key.json`
209 | - [ ] Install [all dependencies](https://facebook.github.io/react-native/docs/getting-started.html#installing-dependencies-1) for macOS and Android
210 |
211 |
212 | ### Setting up
213 |
214 | First you need to set up Fastlane for your android project:
215 | ```
216 | $ cd my-project/android
217 | $ fastlane init
218 | ```
219 |
220 | Fastlane will automatically detect your project and ask for any missing information.
221 |
222 | The following questions will be asked:
223 | * `Package Name (com.krausefx.app)`
224 | * Our answer is `com.tcm.boilerplate`
225 | * `Path to the json secret file`
226 | * Type `key.json` (path to the file previously created in the Prerequisites step)
227 | * Download existing metadata and setup metadata management?
228 | * `y`
229 |
230 | Fastlane will then give you some information about git, the files it will create, etc. Just type `enter` to continue.
231 |
232 | Congrats! Fastlane has created some files.
233 | If you are using Git, commit all generated files.
234 |
235 | Once the setup has finished you can see a new folder inside the `android` folder:
236 | ```
237 | - fastlane/
238 | - Appfile
239 | - Fastfile
240 | ```
241 |
242 | `Appfile` contains identifiers used to connect to the Google Play Console and the link to the `key.json` file.
243 | You can read more about this file [here](https://docs.fastlane.tools/advanced/#appfile).
244 |
245 | `Fastfile` contains all actions you can launch.
246 | You can read more about this file [here](https://docs.fastlane.tools/actions).
247 | A `beta [lane](https://docs.fastlane.tools/advanced/lanes/)`, a `deploy lane` and a `test lane` are available by default.
248 |
249 | You can remove the `deploy lane` to avoid some mistakes, and replace the `beta` lane by the following:
250 | ```
251 | desc "Submit a new Beta Build to Play Store"
252 | lane :beta do
253 | store_password = prompt(text: "Signing Store Password: ", secure_text: true)
254 | key_password = prompt(text: "Alias Key Password: ", secure_text: true)
255 | releaseFilePath = File.join(Dir.pwd, "..", "my-release-key.keystore")
256 | gradle(task: 'clean')
257 | gradle(
258 | task: 'assemble',
259 | build_type: 'Release',
260 | print_command: false,
261 | properties: {
262 | "android.injected.signing.store.file" => releaseFilePath,
263 | "android.injected.signing.store.password" => store_password,
264 | "android.injected.signing.key.alias" => "my-key-alias",
265 | "android.injected.signing.key.password" => key_password,
266 | }
267 | )
268 | upload_to_play_store(
269 | track: 'internal'
270 | )
271 | ```
272 |
273 | As you can see, we need to sign our APK with a signing key.
274 | Don't worry, we will generate it in a moment, let's just explain what the lane do.
275 |
276 | First, script ask the user two values : signing store and alias key passwords, with the [`prompt`](https://docs.fastlane.tools/actions/prompt/) fastlane plugin.
277 | Asking the user those passwords ensure that no secret keys are stored into your app.
278 | Then, this lane clean your project, assemble the application, automatically injecting signing configuration at runtime, before uploading it in the Google Play Store.
279 | Upload is made `internaly`, that means only internal testers will be allowed to download the app. You can learn more about different test types [here](https://support.google.com/googleplay/android-developer/answer/3131213).
280 |
281 |
282 | #### Generating a signing key
283 |
284 | [Official documentation](https://facebook.github.io/react-native/docs/signed-apk-android#generating-a-signing-key) well explained how to generate a signing key.
285 |
286 | You simply need to run the following :
287 | ```bash
288 | keytool -genkey -v -keystore my-release-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000
289 | ```
290 | This command prompts you for passwords for the keystore and key and for the Distinguished Name fields for your key.
291 | It then generates the keystore as a file called `my-release-key.keystore`
292 |
293 | Note: Remember to keep your keystore file private and never commit it to version control.
294 |
295 | Copy the generated `my-release-key.keystore` file into the root of `android` folder.
296 |
297 | You're now good to build and deploy !
298 |
299 |
300 | ### Creating a beta build
301 |
302 | :warning: The first time you deploy your application, you MUST upload it into Google Play Console `manually`.
303 | Google don't allow to use theirs APIs for the first upload.
304 | To do this, comment the three last lines of the `Fastfile`
305 | ```
306 | #upload_to_play_store(
307 | # track: 'internal'
308 | # )
309 | ```
310 | or create a new lane without thoses lines.
311 |
312 | :exclamation: There is no official plugin to automatically upgrade android version code (unlike the iOS lane).
313 | Before each deployment, be sure to `manually` upgrade the `versionCode` value inside `android/app/build.gradle`.
314 | We are working on an automatic way to do this.
315 |
316 | Creating a beta build and uploading it on Google Play is now really easy.
317 | Just type the following:
318 |
319 | ```
320 | $ cd my-project/android
321 | $ fastlane beta
322 | ```
323 |
324 |
325 | ## Troubleshooting
326 |
327 | ### Stuck at `bundle install` or `bundle update` running `fastlane init`
328 |
329 | If the `fastlane init` process is stuck when running `bundle install` or `bundle update` it may mean that `bundle` command is asking for root permissions.
330 | You can stop the process and retry again with `sudo fastlane init`, however you will need to change back ownership of the generated files to your user when it finishes by running this command:
331 | ```
332 | $ sudo chown
333 | ```
334 |
335 | ### Permission denied running android beta lane
336 |
337 | If you have a `Permission denied` issue on an android beta build, please run:
338 | ```
339 | $ chmod a+x /my-project/android/gradlew
340 | ```
341 |
342 | ### Fastlane init failed
343 | ```
344 | fastlane init failed
345 | ["The request could not be completed because:", "Could not receive latest API key from App Store Connect, this might be a server issue."]
346 | Something failed while running `fastlane init`
347 | Tried using Apple ID with email 'dev-team@yourcompany.com'
348 | You can either retry, or fallback to manual setup which will create a basic Fastfile
349 | Would you like to fallback to a manual Fastfile? (y/n)
350 | ```
351 | Answer `n`, and retry previous steps with a correct Apple ID and password.
352 | Make sure you are connected to internet.
353 |
354 |
355 | ---
356 | If you need more informations, don't hesitate to read the [fastlane documentation](https://docs.fastlane.tools/)
357 |
--------------------------------------------------------------------------------