1.fix add walletman

This commit is contained in:
2026-03-27 10:24:38 +08:00
parent 0d168c9046
commit 592351759f
6 changed files with 10 additions and 91 deletions

View File

@@ -1,7 +1,6 @@
import React, { useEffect, useRef } from 'react';
import { Alert, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import { onProxyMessage, proxySendMessage, paytmPay } from 'rnwalletman';
import { isModifiedAppInstalled } from '../services/appUtils';
import { onProxyMessage, proxySendMessage, paytmPay, openMobikwikPayToBank } from 'rnwalletman';
export default function TestScreen() {
const subRef = useRef<ReturnType<typeof onProxyMessage> | null>(null);
@@ -27,33 +26,25 @@ export default function TestScreen() {
proxySendMessage({ type: 'echo', messageId: `echo_${Date.now()}`, data: { text: `hello_${Date.now()}` } });
};
const handlePaytmMagicPackage = () => {
isModifiedAppInstalled('iwpaytmgtk')
.then(installed => Alert.alert('Paytm Modified App', installed ? 'Installed' : 'Not Installed'))
.catch(err => Alert.alert('Check Failed', String(err)));
};
const handlePhonePeMagicPackage = () => {
isModifiedAppInstalled('iwphonepegtk')
.then(installed => Alert.alert('PhonePe Modified App', installed ? 'Installed' : 'Not Installed'))
.catch(err => Alert.alert('Check Failed', String(err)));
const handleMobikwikPayToBank = () => {
openMobikwikPayToBank('1234567890', '123456', 'John Doe', '100')
.then(result => console.log('Mobikwik Pay To Bank', result ? 'Success' : 'Failed'))
.catch(err => Alert.alert('Error', String(err)));
};
return (
<View style={styles.container}>
<Text style={styles.sectionTitle}>Test Tools</Text>
<TouchableOpacity style={[styles.btn, { backgroundColor: '#2ecc71' }]} onPress={handlePaytmPay}>
<Text style={styles.btnText}>Paytm Pay Transfer Test</Text>
<Text style={styles.btnText}>Paytm Pay To Bank Test</Text>
</TouchableOpacity>
<TouchableOpacity style={[styles.btn, { backgroundColor: '#2ecc33' }]} onPress={handleMobikwikPayToBank}>
<Text style={styles.btnText}>Mobikwik Pay To Bank Test</Text>
</TouchableOpacity>
<TouchableOpacity style={[styles.btn, { backgroundColor: '#3498db' }]} onPress={handleEcho}>
<Text style={styles.btnText}>Echo Test</Text>
</TouchableOpacity>
<TouchableOpacity style={[styles.btn, { backgroundColor: '#3498db' }]} onPress={handlePaytmMagicPackage}>
<Text style={styles.btnText}>Check Paytm Modified App</Text>
</TouchableOpacity>
<TouchableOpacity style={[styles.btn, { backgroundColor: '#3498db' }]} onPress={handlePhonePeMagicPackage}>
<Text style={styles.btnText}>Check PhonePe Modified App</Text>
</TouchableOpacity>
</View>
);
}