Before you install and run any of the sample apps provided in this repo, you will need to setup your Configuration file with your Layer appID and the URL to your Identity Provider (authenticator) server.
This JSON file contains an array of at least one:
app_id: Go to The Developer Dashboard, select your Application, and selectKeysin the table of contents on the left. You should see your Application ID.identity_provider_url: If you are using the Layer Sample Identity server deployed to your server or your Heroku account, enter the url to that server here. Note that if you are using your own custom identity service (recommended once you are no longer working on demos), you will need to replace your client's authentication code, and this configuration file is no longer needed.name: Support for this field will be added eventually to let you select between different configurations when logging in.
[{
"app_id": "layer:///apps/staging/f34bdf52-fd26-11e6-9f75-336a5aaaaaaa",
"identity_provider_url": "https://layer-quickstart-frodo-the-dodo.herokuapp.com"
"name": "Staging Demo"
}]npm run floworyarn flow
npm installORyarn installnpm startORyarn start
To deploy this demo onto a web server that is not running on localhost, its worth noting that this project
is created using react-scripts, which has extensive instructions at React Scripts Docs.
For a quick deploy:
npm run build- Deploy the
buildfolder to your server
However, note that if this app is not running at the root path of your web server, you will need the following changes:
- Add an entry to your
package.jsonfile:"homepage": "http://myco.com/mypath/toapp" - Edit your
App.jsfile and update the<BrowserRouter/>to:<BrowserRouter basename={'/mypath/toapp'}>
Some Custom Messages are included but disabled by default. All code for custom messages can be seen in src/custom-message-types. To enable this code, comment out the stub code at the top of src/custom-message-types/index.js and uncomment the rest of the file.
Custom Messages currently are part of this sample app alone, and are not part of iOS or Android sample apps.
Custom Messages can be sent by:
- Selecting
Create Custom Opinion MessageorCreate Custom Pie Chart Messagefrom the Create Message menu in the Compose Bar - Using the File Upload button and selecting a PDF File