AEM Mobile: hybrid reference app
This is a basic AEM Mobile Hybrid reference application authored using Ionic Framework.
We've taken a different approach with this mobile application, starting with a purely Ionic 'Host' that any web developer familiar with Angluar.js will be instantly familiar. Then we created an AEM directory to separately create and build the AEM authored content.
As an Angular.js developer you can create great expereinces in the hybrid-app directly, build and deploy your work using your favourite toolchain.
As an AEM developer, you can create great authorable experiences in the aem-package.
We then bring the two together by deploying the AEM-Package via AEM Package Manager and simply dragging and dropping the hyrbid-app (/www + config.xml) as a zip into the AEM Mobile Console (hint: we have scripts to help you automate this AND once you've done it once you can update individual files as needed).
- Mobile application written in Ionic Framework,
- AEM ContentSync OTA updates,
- AEM Basic authentication,
- AEM oAuth2 authentication,
- AEM User profile management,
- AEM authorable templates and components for: locations, events, and about us and,
- Native device feature support with: location services, beacons, camera, accelerometer, file system, file transfer and, vibration.
Minimum requirements for development
- Maven (tested: Apache Maven
- Git (tested: git version
- Xcode (tested:
- Cordova (tested:
- node.js version
- AEM 6.2
Clone this repository to your machine to begin.
Review the Adding OTA wiki for details on how to enable OTA updates in an existing hybrid app (Cordova/PhoneGap).
Create Hybrid App Archive
A script is available that will create an archive of the app or you can use any ZIP creation tool of your choosing.
cd aem-mobile-hybrid-reference/hybrid-app npm install npm run zip
Import Hybrid App into AEM
- Drag and drop archive onto AEM 6.1 FP3 Apps admin console
- Configure your dashboard with analytics, push and phonegap build support
- Create, read, update and, delete (CRUD) app pages
- Publish updates OTA with ContentSync
- Open AEM Mobile Verify to view your app
Review the Customizing App Import wiki for details on how to control and customize the AEM Mobile app import process.
Install AEM Package
cd aem-mobile-hybrid-reference/aem-package mvn -PautoInstallPackage clean install
NOTE: If you are installing the packages manually you need to install content-dev first.
NOTE: For logout, user profile creation and update, the packages must be installed on the publisher.
mvn -PautoInstallPackagePublish clean install
Edit in AEM
NOTE: Once built and installed via maven, your hybrid app should be editable in AEM.
WARNING: You should only edit the sample that is deployed for quick demo purposes. If you plan to create content and expect to continue to redeploy developer updates over time (you will), you need to create a new application based on this template by selecting the '+' new app button on the Mobile Console and selecting the Hybrid Template during the creation process. This will create a clean separation between the Author creating content in the new application and any developer updates (the newly created app will pick up the developer updates without clobbering the author's content). Taking this one step further, navigate into the package manager and create a new package for your new application (including assets). Then download and save this package as a backup (you can automate this process).
The dashboard for the app that was previously added will now contain a new entry called English under the Manage Content section.
If you followed the instructions correctly and have your author instance running locally on
:4502, you should be able to author the hybrid app that was previously added via the following link:
When deploying an existing hybrid app for production it should be wrapped in an AEM package to simplify versioning and deployment. An additional content package is included with this sample which will wrap the existing ionic app into the correct JCR structure. Undesirable results may occur when installing this package to a server instance that previously imported the app via drag and drop.
cd aem-mobile-hybrid-reference/aem-package mvn -PautoInstallProduction clean install
Build Hybrid App
Building the hybrid app can be completed entirely from the command line.
First ensure your script dependencies are up-to-date.
cd aem-mobile-hybrid-reference/hybrid-app npm install
Merge Authored Content
This method would generally be used by the ionic developer to test the app with authored content.
NOTE: Default AEM server is http://localhost:4502 with credentials admin:admin. Modify scripts/fetch.sh if needed.
Content being managed by AEM will be automatically merged into the hybrid app during the Cordova build process when the
--aem-merge argument is provided.
cd aem-mobile-hybrid-reference/hybrid-app cordova platform add ios cordova run ios --emulator --aem-merge
This app contains a browser-perf test that reports performance metrics on the scrolling of the News and Events page. There are a few dependencies you will need before running the test.
- PhoneGap cli
- (iOS) Appium
- (iOS) Xcode
- (iOS, for real devices) ideviceinstaller:
brew install ideviceinstaller
- (iOS, for real devices) ios-webkit-debug-proxy:
brew install ios-webkit-debug-proxy
- (Android) ChromeDriver
== 2.24: (download here)
If running the tests on a real device, figure out the UDID of that device:
$ phonegap run --list -d
ios_webkit_debug_proxy on port :27753. Replace
<device UDID> with yours (from above):
$ ios_webkit_debug_proxy -c <device UDID>:27753 -d
Run the test:
$ node tests/performance/ios-news-scrolling-test.js iphone-6s-9.3
If successful, results will be printed to the console. Otherwise, an error will be printed. Observe the Appium logs for further details.