diff --git a/index.android.js b/index.android.js index ff23e6ea..131604fe 100644 --- a/index.android.js +++ b/index.android.js @@ -2,6 +2,8 @@ import { AppRegistry } from 'react-native'; +import { name as appName } from './package.json'; + import App from './src/'; -AppRegistry.registerComponent('devhub', () => App); +AppRegistry.registerComponent(appName, () => App); diff --git a/index.ios.js b/index.ios.js index ff23e6ea..131604fe 100644 --- a/index.ios.js +++ b/index.ios.js @@ -2,6 +2,8 @@ import { AppRegistry } from 'react-native'; +import { name as appName } from './package.json'; + import App from './src/'; -AppRegistry.registerComponent('devhub', () => App); +AppRegistry.registerComponent(appName, () => App); diff --git a/index.web.js b/index.web.js index 1293dac5..77edfa56 100644 --- a/index.web.js +++ b/index.web.js @@ -5,8 +5,9 @@ import { AppRegistry } from 'react-native'; import './web/src/index.css'; import App from './src/'; +import { name as appName } from './package.json'; -AppRegistry.registerComponent('devhub', () => App); -AppRegistry.runApplication('devhub', { +AppRegistry.registerComponent(appName, () => App); +AppRegistry.runApplication(appName, { rootTag: document.getElementById('root'), }); diff --git a/src/api/github.js b/src/api/github.js index 7d29c186..9860e705 100644 --- a/src/api/github.js +++ b/src/api/github.js @@ -2,6 +2,8 @@ import GitHubAPI from 'github'; +import { name as appName } from '../../package.json'; + const PUBLIC_EVENTS: 'PUBLIC_EVENTS' = 'PUBLIC_EVENTS'; const REPO_EVENTS: 'REPO_EVENTS' = 'REPO_EVENTS'; const REPO_ISSUE_EVENTS: 'REPO_ISSUE_EVENTS' = 'REPO_ISSUE_EVENTS'; @@ -18,7 +20,7 @@ const MARK_NOTIFICATION_THREAD_AS_READ: 'MARK_NOTIFICATION_THREAD_AS_READ' = 'MA const MARK_ALL_NOTIFICATIONS_AS_READ_FOR_REPO: 'MARK_ALL_NOTIFICATIONS_AS_READ_FOR_REPO' = 'MARK_ALL_NOTIFICATIONS_AS_READ_FOR_REPO'; const github = new GitHubAPI({ - agent: 'devhub', + agent: appName, // debug: process.env.NODE_ENV !== 'production', }); diff --git a/src/sagas/oauth/index.js b/src/sagas/oauth/index.js index 058481c3..3aa5d627 100644 --- a/src/sagas/oauth/index.js +++ b/src/sagas/oauth/index.js @@ -2,8 +2,9 @@ import qs from 'qs'; import { Linking } from 'react-native'; import { getUrlParamsIfMatches, listenForNextUrl } from './helpers'; +import { name as appName } from '../../../package.json'; -const callbackURL = 'devhub://oauth/github'; +const callbackURL = `${appName}://oauth/github`; export default async function (serverURL, scopes = []) { const scopesStr = (scopes || []).join(' '); diff --git a/src/utils/helpers/github/url.js b/src/utils/helpers/github/url.js index a243306d..05a99751 100644 --- a/src/utils/helpers/github/url.js +++ b/src/utils/helpers/github/url.js @@ -5,6 +5,8 @@ import { Linking, Platform } from 'react-native'; import { get } from '../../immutable'; +import { name as appName } from '../../../../package.json'; + import type { GithubIssue, GithubPullRequest, @@ -112,7 +114,7 @@ function openURL(url: string) { } else { // replace http with devhub:// so the app deeplinking will handle this // the app will decide if it will push an app screen or open the web browser - _url = _url.replace(/(http[s]?)/, 'devhub'); + _url = _url.replace(/(http[s]?)/, appName); } return Linking.openURL(_url);