The Wrap feature in Power Apps provides an ability to wrap canvas apps as custom branded Android / iOS apps for native distribution. The below article lists down the high level steps involved in setting up the infrastructure to generate an APK file for distribution in Android ecosystem.
- SET THE STAGE
- Open Power Platform Admin Centre
- Navigate to Dynamics 365 Apps and Search for ‘Wrap for Power Apps’
- Install ‘Wrap for Power Apps’
- Create a new solution
- Create new app
- Select the App and on toolbar select ‘Wrap’ command to edit configuration settings
- Collect Configuration Parameters and keep it handy
- Azure Active Directory App Registration
- Tenant ID
- Client ID
- App Center
- Bundle ID
- App Center URL
- App Center API Token
- Code Signing
- Generate Certificate (.pfx, .jks)
- Export Certificate (keyhash generation for platform registration)
- Get Signature Hash
- Azure Active Directory App Registration
- APP CENTER CONFIGURATION
- Navigate to appcenter.ms/apps
- Add new App
- Copy App center URL and save it somewhere safe (replace ‘users’ with ‘orgs’)
- Generate API token and save it somewhere safe
- RUN POWERSHELL COMMANDS
- Install module for Power Apps and Power Apps Administration
- Execute command to allow Third Party Apps
- Execute command to enable Azure API Connections
- APP REGISTRATION CONFIGURATION
- Navigate to Azure Active Directory >> App registration
- Create new App registration
- Under Overview of App registration note down the Client ID and Tenant ID
- Under Authentication > Add a platform (iOS / Android)
- Specify the bundle ID and save
- Configure API Permissions
- Dynamics CRM
- Power Apps Service
- Azure API Connections
- CODE SIGNING PROCESS (Android)
- Tools – Pre-requisites
- Install Android Studio
- Install Open SSL Toolkit (I used GIT Open SSL)
- APKSigner Tool (comes with Android Studio)
- Generate Certificate
- Use keytool.exe to generate the certificate (.pfx or .jks)
- Use keytool.exe to export the generated certificate (Store the hash value)
- Use the hash value to register the platform (android) in the App registration process
- Azure AD App Registration Settings
- Navigate to Azure Active Directory > App Registration
- Under Authentication > Add a Platform
- Select ‘Android’
- Specify the package name
- Under Signature hash type in the value returned by executing keytool exportcert command (Step iii)
- Tools – Pre-requisites
- WRAP SETTINGS CONFIGURATION
- Fill up the values collected earlier and populate in the sections below
- General Section
- Specify the Display Name
- Specify the Bundle ID & Client ID
- Publishing Section
- Specify the App Center URL
- Specify the App Center API Token
- Save and Build the configuration
- Download the .apk file from ‘Releases’ of App Center
- Proceed for Code Signing Process
- SIGN, INSTALL & TEST .apk file