🔧Installation
Installation Instructions
Getting Started
This package is designed to work inside Expo projects as it leverages the use of Expo Native Modules. Installation instructions have been provided for when it is used either in Expo CNG or if you have detached your project and are managing the native folders separately.
Installation in expo CNG is as easy as just directly installing the package through expo and regenerating your Android native directory. The following command installs this package.
npx expo install android-credential-managerOnce the installation has been completed, check out the following section on what digital asset linking is and how to configure it in your application.
If you have detached your project from expo CNG and are manually maintaining the native folders, follow these steps to install this package
1. Install the Package With Your Package Manager
npm install android-credential-manager2. Add the Kotlin Dependencies
Add the following two dependencies inside your app-level build.gradle file.
dependencies {
implementation("androidx.credentials:credentials:1.5.0-rc01")
implementation("androidx.credentials:credentials-play-services-auth:1.5.0-rc01")
}3. Edit your AndroidManifest.xml
Add the following to your AndroidManifest.xml file.
<meta-data android:name="asset_statements" android:resource="@string/asset_statements" />
4. Configure Your Digital Asset Linking
Refer to
📃Digitial Asset Linkingon what is Digital Asset Linking and how to create one.
5. Link DigitalAsset URL To Your App
Add the following code inside your strings.xml file. Make sure you update the domain to reflect the domain that you have used to hos the Digital Asset JSON as detailed in the previous step
<string name="asset_statements" translatable="false">
[{
\"include\": \"https://signin.example.com/.well-known/assetlinks.json\"
}]
</string>
Add the Plugin to your app.json. Make sure you pass in your domain URL as instructed in the DigitalAsset Linking Section.
{
"expo": {
"plugins": [
[
"android-credential-manager",
{
"domainUrl": "https://guhansensam.com"
}
]
]
}
}Now you can run your app
To run your app locally use the following commands:
npm run androidThis will regenerate your native android folder and build your application
If you use EAS build for your development run the following command
eas buildThen install the built APK onto your emulator or mobile device and start the expo Dev-client with the following command
npx expo start --dev-clientLast updated
