### Install Pods after Environment Change in iOS Source: https://developer.meawallet.com/mpp/react-native/installation Navigate to the ios directory and run 'pod install' to update dependencies after changing the environment and cleaning the build folder. ```bash cd ios && npm exec -c 'pod install' ``` -------------------------------- ### Complete Public Key Decryption Example Source: https://developer.meawallet.com/manuals/public-key-decryption This example demonstrates the full workflow of generating a one-time session key, encrypting it with a public key, and then decrypting response data. It requires the Bouncy Castle security provider for PKCS7Padding and OAEPPadding. ```java private static final String MODULUS = "00A40828F91B332BEA96F9B15DD220A34BF5322F7A3D99C5EC2FC5398CABE52F43F408444368EDDA144D3A25F2DEF231759537F1C9DA55CF60D166DA5C5C04E161B4F7E787C15044C7368AADA3744CDAA12C9F604F16939A99106BDAC77E4D9B446CB3A56791E4409F4812010087F16D10BFFA3EE34D66A9B2EDE5FE8971C6C2AF1870BE1F5D3AFCAAE558D695F53261EB4BF2AA7F7B1FC2FF7394C78CB6542A4F2F7B4842A1DC05968614CF9B7B9BD125D742A701CA6F8A9BA08D4AE58A7BFC3F2975A2E2FABE26853DFF0DC1EA5C8C471938846BA21DF26CF90C1E2D680B92BDE7D76918CCF1DEFDD0ABC34322CED7D73619B40CA6D12C50AD5179F0A4EDFA1B"; private static final String PUBLIC_EXPONENT = "010001"; private static final String SECRET_KEY_TRANSFORMATION = "AES/CBC/PKCS7Padding"; private static final String PROVIDER = BouncyCastleProvider.PROVIDER_NAME; static { // Might be necessary for PKCS7Padding support Security.addProvider(new BouncyCastleProvider()); } public static void main(String[] args) throws Exception { // 1. Client generates AES-256 bit one-time session key (SK); SecretKey oneTimeSessionKey = generateOneTimeSessionKey(); // 2. Encrypt (wrap) the session key with MeaWallet’s Public Key (G1 key); PublicKey publicKey = buildRsaPublicKey(Hex.decodeHex(MODULUS), Hex.decodeHex(PUBLIC_EXPONENT)); String encryptedSecretKeyHex = encryptSessionKey(oneTimeSessionKey, publicKey); // 3. Client sends wrapped one time session key to MeaWallet together with publicKeyFingerprint which was used for encryption; System.out.println("Wrapped one time session key: " + encryptedSecretKeyHex); // 4. MeaWallet responds with encrypted sensitive data using the one-time session key; // 5. Client decrypts sensitive data using its session key; byte[] decryptedData = decryptPayload(oneTimeSessionKey, encryptedMeaWalletResponseData, IV); System.out.println("Data decrypted with one time session key: " + new String(decryptedData, StandardCharsets.UTF_8)); } ``` ```java private static SecretKey generateOneTimeSessionKey() throws NoSuchAlgorithmException { KeyGenerator keyGen = KeyGenerator.getInstance("AES"); keyGen.init(256); return keyGen.generateKey(); } ``` ```java public static PublicKey buildRsaPublicKey(byte[] modulus, byte[] exponent) throws NoSuchAlgorithmException, InvalidKeySpecException { RSAPublicKeySpec spec = new RSAPublicKeySpec(new BigInteger(1, modulus), new BigInteger(1, exponent)); KeyFactory factory = KeyFactory.getInstance("RSA"); return factory.generatePublic(spec); } ``` ```java private static String encryptSessionKey(SecretKey sessionKey, Key publicKey) throws GeneralSecurityException { Cipher cipher = Cipher.getInstance("RSA/ECB/OAEPPadding", PROVIDER); OAEPParameterSpec oaepParameterSpec = new OAEPParameterSpec( "SHA-512", "MGF1", MGF1ParameterSpec.SHA512, PSource.PSpecified.DEFAULT); cipher.init(Cipher.ENCRYPT_MODE, publicKey, oaepParameterSpec); byte[] encryptedKey = cipher.doFinal(sessionKey.getEncoded()); return Hex.encodeHexString(encryptedKey); } ``` ```java private static byte[] decryptPayload(SecretKey secretKey, String encryptedData, String iv) throws Exception { byte[] encryptedDataBytes = Hex.decodeHex(encryptedData); IvParameterSpec ivParameterSpec = new IvParameterSpec(Hex.decodeHex(iv)); Cipher payloadCipher = initPayloadDecryptionKey(secretKey, ivParameterSpec); return payloadCipher.doFinal(encryptedDataBytes); } ``` ```java private static Cipher initPayloadDecryptionKey(SecretKey secretKey, IvParameterSpec iv) throws Exception { Cipher payloadCipher = Cipher.getInstance(SECRET_KEY_TRANSFORMATION); payloadCipher.init(Cipher.DECRYPT_MODE, secretKey, iv); return payloadCipher; } ``` -------------------------------- ### Install Expo Config Plugins Source: https://developer.meawallet.com/mpp/react-native/installation Install the necessary Expo config plugins package to enable custom native project configurations. ```bash npm install --save-dev @expo/config-plugins ``` -------------------------------- ### App Launch URL Scheme Example Source: https://developer.meawallet.com/mpp/ios/implementation-guide This is an example of the custom URL scheme used to launch the issuer's app from Apple Wallet, including query parameters for pass identification. ```plaintext "appLaunchURL":["scheme://path"] ``` ```plaintext scheme://path?passTypeIdentifier=paymentpass.com.apple&action=verify&serialNumber=pr.prod.pod1_1... ``` -------------------------------- ### Bundle IDs for Wallet Extensions Source: https://developer.meawallet.com/mpp/react-native/wallet-extensions-guide Example bundle identifiers for the main app and its associated Issuer extensions. ```plaintext com.meawallet.app com.meawallet.app.IssuerNonUIExtension com.meawallet.app.IssuerUIExtension ``` -------------------------------- ### InitializationFailedException Source: https://developer.meawallet.com/api/mtp/com/meawallet/mtp/InitializationFailedException.html Thrown if the library initialization fails. Use `MeaCheckedException.getErrorCode()` to get failure reason error code for exception. ```APIDOC ## Class: InitializationFailedException ### Description Thrown if the library initialization fails. Use `MeaCheckedException.getErrorCode()` to get failure reason error code for exception. ### Hierarchy `java.lang.Object` -> `java.lang.Throwable` -> `java.lang.Exception` -> `com.meawallet.mtp.MeaCheckedException` -> `com.meawallet.mtp.InitializationFailedException` ### Implemented Interfaces `Serializable` ### Inherited Methods from `MeaCheckedException` - `getCardId()` - `getEligibilityReceipt()` - `getErrorCode()` - `getMeaError()` ### Inherited Methods from `Throwable` - `addSuppressed(Throwable suppressed)` - `fillInStackTrace()` - `getCause()` - `getLocalizedMessage()` - `getMessage()` - `getStackTrace()` - `getSuppressed()` - `initCause(Throwable cause)` - `printStackTrace()` - `printStackTrace(java.io.PrintStream s)` - `printStackTrace(java.io.PrintWriter s)` - `setStackTrace(StackTraceElement[] stackTrace)` - `toString()` ### Inherited Methods from `Object` - `equals(Object obj)` - `getClass()` - `hashCode()` - `notify()` - `notifyAll()` - `wait()` - `wait(long timeout)` - `wait(long timeout, int nanos)` ``` -------------------------------- ### MeaProductConfig Constructor Source: https://developer.meawallet.com/api/mtp/com/meawallet/mtp/MeaProductConfig.html Initializes a new instance of the MeaProductConfig class. ```APIDOC ## MeaProductConfig() ### Description Constructs a new MeaProductConfig object. ### Constructor `public MeaProductConfig()` ``` -------------------------------- ### Install MPP React Native Package with yarn Source: https://developer.meawallet.com/mpp/react-native/installation Install the react-native-mpp package using yarn after configuring access to the private registry. ```bash yarn add @meawallet/react-native-mpp ``` -------------------------------- ### MeaInitializeDigitizationParameters.withReceipt(String receipt, String bin) Source: https://developer.meawallet.com/api/mtp/com/meawallet/mtp/MeaInitializeDigitizationParameters.html Creates digitization parameters with push account receipt data. ```APIDOC ## MeaInitializeDigitizationParameters.withReceipt(String receipt, String bin) ### Description Creates digitization parameters with push account receipt data, in case of Mastercard obtained from MDES Token Connect. ### Method static MeaInitializeDigitizationParameters ### Parameters - **receipt** (String) - Required - The push account receipt data. - **bin** (String) - Optional - The Bank Identification Number. ``` -------------------------------- ### Install MPP React Native Package with npm Source: https://developer.meawallet.com/mpp/react-native/installation Install the react-native-mpp package using npm after configuring access to the private registry. ```bash npm install @meawallet/react-native-mpp --save ``` -------------------------------- ### MeaInitializeDigitizationParameters Methods Source: https://developer.meawallet.com/api/mtp/index-all.html Methods for initializing digitization parameters. ```APIDOC ## MeaInitializeDigitizationParameters Class Methods ### Methods - **getExpiryYear()** - Description: Retrieves the expiry year. - Return Type: Integer - **getInitialVector()** - Description: Retrieves the initial vector. - Return Type: String - **getPan()** - Description: Retrieves the Primary Account Number (PAN). - Return Type: String ``` -------------------------------- ### Associated Application Identifiers Example Source: https://developer.meawallet.com/mpp/ios/wallet-extensions-guide Example of associated application identifiers for an issuer app and its extensions. These are used to associate passes with specific applications. ```plaintext A1B2C3D4E5.com.meawallet.app A1B2C3D4E5.com.meawallet.app.IssuerNonUIExtension A1B2C3D4E5.com.meawallet.app.IssuerUIExtension ``` -------------------------------- ### initialize Source: https://developer.meawallet.com/api/mtp/com/meawallet/mtp/MeaTokenPlatform.html Initializes the MeaTokenPlatform library. ```APIDOC ## initialize ### Description Initializes the MeaTokenPlatform library. ### Method static void ### Signature initialize(android.content.Context context) ### Parameters - **context** (android.content.Context) - The application context. ``` -------------------------------- ### Initialize MeaPushProvisioning Source: https://developer.meawallet.com/mpp/android/google-pay Initializes the MeaPushProvisioning instance. If a custom configuration file is used, provide its name during initialization. ```APIDOC ## Initialize MeaPushProvisioning ### Description Initializes the MeaPushProvisioning instance. If a custom configuration file is used, provide its name during initialization. ### Code ```java if (!MeaPushProvisioning.isInitialized()) { MeaPushProvisioning.initialize(this); } ``` ### Custom Configuration ### Description When no default `mea_config` exists and a custom config file name is used instead, call method `MeaPushProvisioning.initialize(this, "custom_config_file_name")` for initialization. ### Code ```java MeaPushProvisioning.initialize(this, "custom_config_file_name"); ``` ``` -------------------------------- ### Example iFrame with Clipboard Write Permission Source: https://developer.meawallet.com/mcd/web/implementation-guide An example of an iframe element with the 'allow' attribute set for 'clipboard-write' permission, including the environment URL. ```html