### Configure robots.txt for Android Digital Asset Links Source: https://docs.benjamineruvieru.com/docs/category/react-native-credentials-manager/react-native-credentials-manager/installation Example `robots.txt` configuration to ensure that web crawlers are allowed to access the `/.well-known/` directory. This is crucial for the discoverability of `assetlinks.json` for Android Digital Asset Links. ```Text User-agent: * Allow: /.well-known/ ``` -------------------------------- ### Clean and Rebuild React Native Project Source: https://docs.benjamineruvieru.com/docs/category/react-native-credentials-manager/react-native-credentials-manager/installation Commands to clean the build artifacts for both Android and iOS projects, often used to resolve persistent build errors. ```Shell cd android && ./gradlew clean ``` ```Shell cd ios && pod install ``` -------------------------------- ### Install React Native Credentials Manager via npm, yarn, or pnpm Source: https://docs.benjamineruvieru.com/docs/category/react-native-credentials-manager/react-native-credentials-manager/installation These commands demonstrate how to add the `react-native-credentials-manager` library to your project using popular JavaScript package managers. Choose the command corresponding to your preferred package manager (npm, yarn, or pnpm) to include the dependency in your `node_modules`. ```Shell npm install react-native-credentials-manager ``` ```Shell yarn add react-native-credentials-manager ``` ```Shell pnpm add react-native-credentials-manager ``` -------------------------------- ### Apple App Site Association File Hosting Path Source: https://docs.benjamineruvieru.com/docs/category/react-native-credentials-manager/react-native-credentials-manager/installation Specifies the required HTTPS URL path where the `apple-app-site-association` file must be hosted. This path is standardized by Apple for discovery of associated domains. ```Text https://yourdomain.com/.well-known/apple-app-site-association ``` -------------------------------- ### Configure Android Digital Asset Links for Passkey Support Source: https://docs.benjamineruvieru.com/docs/category/react-native-credentials-manager/react-native-credentials-manager/installation This JSON configuration defines the Digital Asset Links file (`assetlinks.json`) required to associate your Android application with your website for passkey support. It specifies permissions for handling URLs and getting login credentials, targeting your app's package name and SHA-256 certificate fingerprint. This file must be hosted at `https://your-domain.com/.well-known/assetlinks.json`. ```JSON [ { "relation": [ "delegate_permission/common.handle_all_urls", "delegate_permission/common.get_login_creds" ], "target": { "namespace": "android_app", "package_name": "your.package.name", "sha256_cert_fingerprints": [ "YOUR_APP_SIGNING_CERTIFICATE_SHA256_FINGERPRINT" ] } } ] ``` -------------------------------- ### Apple App Site Association (AASA) File Content Source: https://docs.benjamineruvieru.com/docs/category/react-native-credentials-manager/react-native-credentials-manager/installation Defines the JSON structure for the `apple-app-site-association` file, essential for Universal Links and other Apple services. Placeholders `TEAMID` and `com.yourcompany.yourapp` must be replaced with your Apple Developer Team ID and app's bundle identifier respectively. ```JSON { "webcredentials": { "apps": ["TEAMID.com.yourcompany.yourapp"] } } ``` -------------------------------- ### Install React Native Pdf From Image Library Source: https://docs.benjamineruvieru.com/docs/category/react-native-credentials-manager/react-native-pdf-from-image Instructions for installing the React Native Pdf From Image library using npm or yarn, and setting up iOS pods for native dependencies. ```Shell npm install react-native-pdf-from-image ``` ```Shell yarn add react-native-pdf-from-image ``` ```Shell cd ios && pod install ``` -------------------------------- ### Add ProGuard Rules for Android Credential Manager Source: https://docs.benjamineruvieru.com/docs/category/react-native-credentials-manager/react-native-credentials-manager/installation These ProGuard rules are necessary if you are using code shrinking in your Android application. They ensure that the `androidx.credentials.playservices` classes, which are part of the Credential Manager library, are not obfuscated or removed, preventing runtime issues. Add these lines to your `android/app/proguard-rules.pro` file. ```ProGuard -if class androidx.credentials.CredentialManager -keep class androidx.credentials.playservices.** { *; } ``` -------------------------------- ### Install React Native Text Touch Highlight Library Source: https://docs.benjamineruvieru.com/docs/category/react-native-credentials-manager/rn-text-touch-highlight Instructions for installing the `rn-text-touch-highlight` package and its peer dependencies (`react-native-reanimated`, `react-native-gesture-handler`) using npm or yarn. ```npm npm install react-native-reanimated npm install react-native-gesture-handler npm install rn-text-touch-highlight ``` ```yarn yarn add react-native-reanimated yarn add react-native-gesture-handler yarn add rn-text-touch-highlight ``` -------------------------------- ### Install React Native Push Down Alert Library Source: https://docs.benjamineruvieru.com/docs/category/react-native-credentials-manager/react-native-pushdown-alert Commands to install the `react-native-pushdown-alert` library using npm or yarn, providing options for different package managers. ```bash npm install react-native-pushdown-alert # or yarn add react-native-pushdown-alert ``` -------------------------------- ### Retrieve Android SHA-1 Signing Certificate Fingerprint Source: https://docs.benjamineruvieru.com/docs/category/react-native-credentials-manager/react-native-credentials-manager/installation Command to execute in your project's root directory to generate a signing report for your Android application. This report includes the SHA-1 fingerprint, which is necessary for configuring Google Sign-In in the Google Cloud Console. ```Shell cd android && ./gradlew signingReport ``` -------------------------------- ### JavaScript Examples for TypeAnimationProps Configuration Source: https://docs.benjamineruvieru.com/docs/category/react-native-credentials-manager/react-native-type-animation Demonstrates various configurations of `TypeAnimationProps` for a typing animation component, including sequence definition, timing controls, looping, and styling. ```javascript const animationProps = { sequence: [ { text: "Hello, ", typeSpeed: 100 }, { text: "World!", typeSpeed: 150, delayBetweenSequence: 500 }, ], delayBetweenSequence: 200, repeat: 2, blinkSpeed: 400, cursorStyle: { color: "red" }, }; ``` ```javascript const animationProps = { sequence: [ { text: "Hello World!", typeSpeed: 100 }, { text: "Hola World!", typeSpeed: 150, delayBetweenSequence: 500 }, ], delayBetweenSequence: 200, loop: true, blinkSpeed: 400, cursorStyle: { color: "red" }, direction: "back", }; ``` -------------------------------- ### Configure iOS Associated Domains for Webcredentials Source: https://docs.benjamineruvieru.com/docs/category/react-native-credentials-manager/react-native-credentials-manager/installation This configuration snippet shows how to add the 'Associated Domains' capability in Xcode for your iOS project. Specifically, it demonstrates adding a `webcredentials` entry for your domain. This is crucial for enabling features like Passkeys and shared credentials between your app and website on iOS. ```APIDOC webcredentials:yourdomain.com ``` -------------------------------- ### Install React Native Type Animation with yarn Source: https://docs.benjamineruvieru.com/docs/category/react-native-credentials-manager/react-native-type-animation This snippet demonstrates how to install the `react-native-type-animation` library using the yarn package manager. It's an alternative to npm for adding the library as a project dependency. ```bash yarn add react-native-type-animation ``` -------------------------------- ### Install React Native Type Animation with npm Source: https://docs.benjamineruvieru.com/docs/category/react-native-credentials-manager/react-native-type-animation This snippet shows how to install the `react-native-type-animation` library using the npm package manager. It adds the library as a dependency to your project, making it available for use in your React Native application. ```bash npm install react-native-type-animation ``` -------------------------------- ### React Native Flexible Authentication System Implementation Source: https://docs.benjamineruvieru.com/docs/category/react-native-credentials-manager/react-native-credentials-manager/basic-usage This React Native component (`AuthScreen`) provides a full example of an authentication flow. It integrates `react-native-credentials-manager` to handle user registration with passkeys, sign-in using various methods (passkeys, password, Google, Apple), and user sign-out. It includes platform-specific logic for Google and Apple sign-in and manages UI state based on authentication status. ```javascript import React, { useState } from "react"; import { View, Button, Text, Platform, Alert } from "react-native"; import { signUpWithPasskeys, signUpWithPassword, signUpWithGoogle, signIn, signOut, } from "react-native-credentials-manager"; // Configuration const WEB_CLIENT_ID = "YOUR_GOOGLE_WEB_CLIENT_ID"; const DOMAIN = "yourdomain.com"; export default function AuthScreen() { const [loading, setLoading] = useState(false); const [user, setUser] = useState(null); // Helper to generate a random challenge const generateChallenge = () => { const array = new Uint8Array(32); window.crypto.getRandomValues(array); return btoa(String.fromCharCode.apply(null, Array.from(array))); }; // Register with passkey const handlePasskeyRegistration = async () => { setLoading(true); try { const userId = btoa(`user_${Math.random().toString(36).substring(2)}`); const challenge = generateChallenge(); const request = { challenge, rp: { name: "Your App", id: DOMAIN }, user: { id: userId, name: "user@example.com", displayName: "User" }, pubKeyCredParams: [ { type: "public-key", alg: -7 }, { type: "public-key", alg: -257 }, ], timeout: 60000, attestation: "none", authenticatorSelection: { authenticatorAttachment: "platform", requireResidentKey: true, residentKey: "required", userVerification: "required", }, }; const response = await signUpWithPasskeys(request); // In a real app, you would send this to your server // await api.registerPasskey(response); Alert.alert("Success", "Passkey registered successfully"); setUser({ id: userId, type: "passkey" }); } catch (error) { Alert.alert("Error", `Registration failed: ${error.message}`); } finally { setLoading(false); } }; // Sign in with any available method const handleSignIn = async () => { setLoading(true); try { const methods = ["passkeys", "password"]; // Add platform-specific method if (Platform.OS === "android") { methods.push("google-signin"); } else { methods.push("apple-signin"); } const params = { passkeys: { challenge: generateChallenge(), rpId: DOMAIN, timeout: 60000, userVerification: "required", }, }; if (Platform.OS === "android") { params.googleSignIn = { serverClientId: WEB_CLIENT_ID, autoSelectEnabled: true, }; } else { params.appleSignIn = { requestedScopes: ["fullName", "email"], }; } const credential = await signIn(methods, params); // Handle different credential types let userData = null; switch (credential.type) { case "passkey": userData = { type: "passkey", verified: true }; break; case "password": userData = { type: "password", username: credential.username }; break; case "google-signin": userData = { type: "google", id: credential.id, name: credential.displayName, }; break; case "apple-signin": userData = { type: "apple", id: credential.id, email: credential.email, }; break; } setUser(userData); Alert.alert("Success", `Signed in with ${credential.type}`); } catch (error) { Alert.alert("Error", `Sign in failed: ${error.message}`); } finally { setLoading(false); } }; // Sign out const handleSignOut = async () => { setLoading(true); try { await signOut(); setUser(null); Alert.alert("Success", "Signed out successfully"); } catch (error) { Alert.alert("Error", `Sign out failed: ${error.message}`); } finally { setLoading(false); } }; return ( {user ? ( <> Signed in as: {JSON.stringify(user, null, 2)}