General Guidelines https://trello.com/c/IX6n2xmz/73-general-guidelines https://trello.com/c/DHKrU6mA/81-data-sync-general-guidelines Prerequisites 1. Postgres DB deployed to an OpenShift project (use any DB parameters you want, but remember them since you will need them for provisioning Sync App APB) 2. MDC provisioned + Mobile App with the name "org.aerogear.ionic.showcase" created 3. Sync App APB provisioned with Ionic Showcase Server application (it should be available on aerogear dockerhub or you can build & push your own docker image from this repo: https://github.com/aerogear/ionic-showcase/tree/master/server)
- for DB parameters, use the same parameters you used when deploying Postgres DB
- bind the service to a Mobile App in MDC
4. Identity Management APB provisioned and bound to Mobile App in MDC 5. Metrics APB provisioned and bound to Mobile App in MDC 6. UnifiedPush APB provisioned (see this JIRA to get the Sender ID and Server key) and bound to Mobile App in MDC (Android) Unable to render embedded object: File (TODO - add link to iOS push credentials) not found.
Configuration of provisioned services Identity Management 1. Add new user to your realm (login to Keycloak -> Users -> Add user -> Type in Username -> Save -> Credentials -> add password, switch Temporary to off -> Reset password)
- you will use this user to log in when you run the ionic application
2. Add a valid redirect URI (in Keycloak go to Clients -> select "org.aerogear.ionic.showcase-public" -> Add "http://localhost/" to *Valid Redirect URIs field, and add "" to *Web Origins
Steps 1. Clone latest release of ionic showcase app 2. Add mobile-services.json file configuration from MDC to src/mobile-services.js 3. Run npm install Below steps should be done with example app on both Android and iOS real devices. Test Auth 1. Run npm run ionic:android/npm run ionic:ios You should be redirected to a Keycloak Login page 2. Login as a user you've created in the Keycloak configuration step 3. Go to Manage tasks section You should see an empty list of tasks. Network status should be Online 4. Try to add/update/delete some tasks and verify the app works as expected 5. Go to User profile section of the app You should see the details about your user profile (first & last name, email, roles) 6. Click on Logout You should be logged out and stay on the User profile page with option to Login again 7. Click on Login You should see the details about your user profile (first & last name, email, roles) 8. Go to Manage tasks section 9. Try to add/update/delete some tasks and verify the app works as expected Subscriptions 1. Keep Manage Tasks app opened on your mobile device 2. In OpenShift, open your Sync App's URL and with '/graphql' endpoint (e.g. https://yourapp.openshift.com/graphql) 3. Create a task in the graphql playground (following mutation should work for ionic-showcase-server app)
mutation{createTask(title: "mytitle", description: "my desc"){id, version, title, description}} |
Check your application on mobile device. The new task should appear there immediately 4. Change the task's title or description
mutation edit{updateTask(id:"<TASK_ID>", version: 1, title: "change"){id}} |
Check your application on mobile device. The change in the task should appear timmediately 5. Delete the task in graphql playground The task should disappear from the app Offline mutations 1. Turn off wi-fi on your mobile device 2. Try to add some items The status in manage tasks section should be set to offline The counter should show you correct amount of mutations you performed (1 mutation per update/deletion/creation) 3. Go online The status should be updated to "online" and the counter of mutations should be set to "0" All the changes you did offline should be applied and available after you went online. No conflicts should appear. Offline conflicts 1. Trello link |