-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
59d8040
commit 9e4e0de
Showing
13 changed files
with
140 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ web-build/ | |
# macOS | ||
.DS_Store* | ||
.env* | ||
environment.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import Constants from "expo-constants"; | ||
|
||
const ENV = { | ||
dev: { | ||
parseAppId: "exampleAppId", | ||
parseJavascriptKey: "exampleJavascriptKey", | ||
parseServerUrl: "https://parseapi.back4app.com/", | ||
parseMasterKey: "exampleMasterKey" | ||
}, | ||
staging: { | ||
parseAppId: "exampleAppId", | ||
parseJavascriptKey: "exampleJavascriptKey", | ||
parseServerUrl: "https://parseapi.back4app.com/", | ||
parseMasterKey: "exampleMasterKey" | ||
}, | ||
prod: { | ||
parseAppId: "exampleAppId", | ||
parseJavascriptKey: "exampleJavascriptKey", | ||
parseServerUrl: "https://parseapi.back4app.com/", | ||
parseMasterKey: "exampleMasterKey" | ||
} | ||
}; | ||
|
||
const getEnvVars = (env = Constants.manifest.releaseChannel) => { | ||
// What is __DEV__ ? | ||
// This variable is set to true when react-native is running in Dev mode. | ||
// __DEV__ is true when run locally, but false when published. | ||
if (__DEV__) { | ||
return ENV.dev; | ||
} else if (env === 'staging') { | ||
return ENV.staging; | ||
} else if (env === 'prod') { | ||
return ENV.prod; | ||
} | ||
}; | ||
|
||
export default getEnvVars; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Parse } from 'parse/react-native'; | ||
import { AsyncStorage } from "react-native"; | ||
import getEnvVars from '../../../environment'; | ||
|
||
function initialize() { | ||
const { parseAppId, parseJavascriptKey, parseServerUrl } = getEnvVars(); | ||
|
||
Parse.setAsyncStorage(AsyncStorage); | ||
Parse.initialize(parseAppId, parseJavascriptKey); | ||
Parse.serverURL = parseServerUrl; | ||
console.log(`Initialize Parse with App ID:${parseAppId}, Javascript Key: ${parseJavascriptKey}`) | ||
|
||
} | ||
|
||
export { initialize } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Parse } from 'parse/react-native'; | ||
|
||
function retrieveHelloFunction() { | ||
Parse.Cloud.run(`hello`).then((result) => { | ||
console.log(result); | ||
return result; | ||
|
||
}) | ||
} | ||
|
||
|
||
export { retrieveHelloFunction } |
Empty file.