Commit b7768815 by Giang Tran

update deeep link

parent e7ab62e4
......@@ -32,6 +32,14 @@
android:exported="true"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="appdcvinvest" android:host="screen" android:pathPrefix="/"
/>
</intent-filter>
</activity>
<activity
android:name="com.zoontek.rnbootsplash.RNBootSplashActivity"
......@@ -43,12 +51,7 @@
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="dcvinvest" />
</intent-filter>
</activity>
......
<resources>
<color name="bootsplash_background">#1C6AF6</color>
<color name="white">#1C6AF6</color>
<color name="white">#fff</color>
</resources>
......@@ -5,7 +5,7 @@
#import <React/RCTRootView.h>
@import Firebase;
#import <React/RCTLinkingManager.h>
#import <AVFoundation/AVFoundation.h>
#import "RNBootSplash.h"
#if DEBUG
......@@ -17,6 +17,7 @@
#import <FlipperKitReactPlugin/FlipperKitReactPlugin.h>
//#import <CallAppSDK/CallAppInterface.h>
static void InitializeFlipper(UIApplication *application) {
FlipperClient *client = [FlipperClient sharedClient];
SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];
......@@ -55,6 +56,33 @@ static void InitializeFlipper(UIApplication *application) {
return YES;
}
#import <React/RCTLinkingManager.h>
// - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
// sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
// {
// return [RCTLinkingManager application:application openURL:url
// sourceApplication:sourceApplication annotation:annotation];
// }
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
return [RCTLinkingManager application:application openURL:url options:options];
}
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity
restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler
{
return [RCTLinkingManager application:application
continueUserActivity:userActivity
restorationHandler:restorationHandler];
}
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
......
......@@ -33,7 +33,7 @@
<string>dcv.investcustomer.vn. linking</string>
<key>CFBundleURLSchemes</key>
<array>
<string>dcvinvest</string>
<string>appdcvinvest</string>
</array>
</dict>
</array>
......
......@@ -37,6 +37,7 @@ const PacketCQG = (props) => {
props.showLoading();
const res = await openCQG({packages: newList});
props.hideLoading();
console.log(res);
if (res.data.code == 200) {
props.saveUserToRedux(res.data.data);
setTimeout(() => {
......
......@@ -6,6 +6,11 @@ import {
Dimensions,
TouchableOpacity,
Alert,
TouchableWithoutFeedback,
Keyboard,
KeyboardAvoidingView,
Platform,
ScrollView,
} from 'react-native';
import R from '../../../assets/R';
import HeaderBack from '../../../components/Header/HeaderBack';
......@@ -32,7 +37,10 @@ const WalletDeposit = (props) => {
const navigate = useNavigation();
const onClick = async () => {
const titles = [I18n.t('AmountOfMoney').toLowerCase(), I18n.t('Note').toLowerCase()];
const titles = [
I18n.t('AmountOfMoney').toLowerCase(),
I18n.t('Note').toLowerCase(),
];
const index = checkFormatArray([amount, notes]);
if (index === true) {
......@@ -63,45 +71,64 @@ const WalletDeposit = (props) => {
}
};
return (
<View style={{flex: 1}}>
<HeaderBack title={'InvestmentDeposit'} />
<View style={styles.container}>
<View style={styles.wrapTop}>
<View style={styles.itemTop}>
<Text style={styles.txtTitle}>{I18n.t('Wallet')}</Text>
<Text style={styles.txtMoney}>
{' '}
{props.user.current_money != 0
? toPriceVnd(props.user.current_money)
: 0}{' '}
</Text>
<KeyboardAvoidingView
behavior={Platform.Os === 'ios' ? 'padding' : 'height'}
style={{flex: 1, backgroundColor: 'white'}}
keyboardVerticalOffset={-50}>
<TouchableWithoutFeedback onPress={Keyboard.dismiss}>
<View style={{flex: 1}}>
<HeaderBack title={'InvestmentDeposit'} />
<ScrollView showsVerticalScrollIndicator={false}>
<View style={styles.container}>
<View style={styles.wrapTop}>
<View style={styles.itemTop}>
<Text style={styles.txtTitle}>{I18n.t('Wallet')}</Text>
<Text style={styles.txtMoney}>
{' '}
{props.user.current_money != 0
? toPriceVnd(props.user.current_money)
: 0}{' '}
</Text>
</View>
<View style={{width: 1, backgroundColor: '#DBDBDB'}} />
<View style={styles.itemTop}>
<Text style={styles.txtTitle}>CQG</Text>
<Text style={styles.txtMoney}>
{' '}
{props.user.current_cqg_money != 0
? toPriceVnd(props.user.current_cqg_money)
: 0}{' '}
đ
</Text>
</View>
</View>
<View style={styles.wrapBody}>
{/* <TextDisable value={'10010101'} title={'Số tài khoản CQG'} /> */}
<TextMoney
onChangeText={(val) => setAmount(val)}
title={I18n.t('AmountOfMoney')}
value={amount}
/>
<TextMulti
onChangeText={(val) => setNotes(val)}
title={I18n.t('Note')}
/>
</View>
</View>
</ScrollView>
<View
style={{
paddingVertical: 10,
justifyContent: 'center',
alignItems: 'center',
}}>
<TouchableOpacity onPress={onClick} style={styles.btnSend}>
<Text style={styles.txtSend}>{I18n.t('Deposit')}</Text>
</TouchableOpacity>
</View>
<View style={{width: 1, backgroundColor: '#DBDBDB'}} />
<View style={styles.itemTop}>
<Text style={styles.txtTitle}>CQG</Text>
<Text style={styles.txtMoney}>
{' '}
{props.user.current_cqg_money != 0
? toPriceVnd(props.user.current_cqg_money)
: 0}{' '}
đ
</Text>
</View>
</View>
<View style={styles.wrapBody}>
{/* <TextDisable value={'10010101'} title={'Số tài khoản CQG'} /> */}
<TextMoney
onChangeText={(val) => setAmount(val)}
title={I18n.t('AmountOfMoney')}
value={amount}
/>
<TextMulti onChangeText={(val) => setNotes(val)} title={I18n.t('Note')} />
</View>
</View>
<TouchableOpacity onPress={onClick} style={styles.btnSend}>
<Text style={styles.txtSend}>{I18n.t('Deposit')}</Text>
</TouchableOpacity>
</View>
</TouchableWithoutFeedback>
</KeyboardAvoidingView>
);
};
......@@ -147,9 +174,6 @@ const styles = StyleSheet.create({
fontWeight: 'bold',
},
btnSend: {
position: 'absolute',
bottom: 30,
right: width / 2 - 70,
width: 140,
height: 40,
backgroundColor: R.colors.main,
......
......@@ -10,6 +10,7 @@ import {
TouchableWithoutFeedback,
Keyboard,
KeyboardAvoidingView,
ScrollView,
} from 'react-native';
import R from '../../../assets/R';
import HeaderBack from '../../../components/Header/HeaderBack';
......@@ -61,9 +62,8 @@ const WalletWithdraw = (props) => {
});
if (res.data.code == 200 && res.data.data) {
if (res.data.data.length == 0) {
confirmAlert(
I18n.t('SettingPaymentMethodConfirm'),
() => navigate.navigate(ADDMETHODPAY),
confirmAlert(I18n.t('SettingPaymentMethodConfirm'), () =>
navigate.navigate(ADDMETHODPAY),
);
} else {
const newList = res.data.data.map((e) => {
......@@ -77,7 +77,10 @@ const WalletWithdraw = (props) => {
};
const onPressWithdraw = async () => {
const titles = [I18n.t('BeneficiaryAccount'), I18n.t('AmountOfMoney').toLowerCase()];
const titles = [
I18n.t('BeneficiaryAccount'),
I18n.t('AmountOfMoney').toLowerCase(),
];
const index = checkFormatArray([type, amount]);
......@@ -120,78 +123,87 @@ const WalletWithdraw = (props) => {
<TouchableWithoutFeedback onPress={Keyboard.dismiss}>
<View style={{flex: 1}}>
<HeaderBack title={'Withdraw'} />
<View style={styles.container}>
<View style={styles.wrapTop}>
<View style={styles.itemTop}>
<Text style={styles.txtTitle}>{I18n.t('Wallet')}</Text>
<Text style={styles.txtMoney}>
{' '}
{props.user.current_money != 0
? toPriceVnd(props.user.current_money)
: 0}{' '}
</Text>
</View>
<ScrollView showsVerticalScrollIndicator={false}>
<View style={styles.container}>
<View style={styles.wrapTop}>
<View style={styles.itemTop}>
<Text style={styles.txtTitle}>{I18n.t('Wallet')}</Text>
<Text style={styles.txtMoney}>
{' '}
{props.user.current_money != 0
? toPriceVnd(props.user.current_money)
: 0}{' '}
</Text>
</View>
<View style={{width: 1, backgroundColor: '#DBDBDB'}} />
<View style={{width: 1, backgroundColor: '#DBDBDB'}} />
<View style={styles.itemTop}>
<Text style={styles.txtTitle}>CQG</Text>
<Text style={styles.txtMoney}>
{props.user.current_cqg_money != 0
? toPriceVnd(props.user.current_cqg_money)
: 0}{' '}
đ
<View style={styles.itemTop}>
<Text style={styles.txtTitle}>CQG</Text>
<Text style={styles.txtMoney}>
{props.user.current_cqg_money != 0
? toPriceVnd(props.user.current_cqg_money)
: 0}{' '}
đ
</Text>
</View>
</View>
<View style={styles.wrapBody}>
<Text
style={{
fontSize: getFontXD(42),
color: R.colors.color777,
}}>
{I18n.t('SourceAccount')}
</Text>
{/* <View style={styles.row}> */}
<RadioForm
radio_props={radio_props}
labelStyle={{fontSize: getFontXD(42)}}
formHorizontal={true}
style={styles.row}
initial={0}
onPress={(value) => {
setSrc(value);
}}
/>
{/* </View> */}
<Text
style={{
fontSize: getFontXD(42),
color: R.colors.color777,
}}>
{I18n.t('ChooseBeneficiaryAccount')}
</Text>
<PickerItem
width={width - 20}
data={data}
onValueChange={(value, items) => {
setType(items);
}}
/>
<TextMoney
onChangeText={(val) => setAmount(val)}
title={I18n.t('AmountOfMoney')}
value={amount}
/>
<TextMulti
onChangeText={(val) => setNotes(val)}
title={I18n.t('Note')}
/>
</View>
</View>
<View style={styles.wrapBody}>
<Text
style={{
fontSize: getFontXD(42),
color: R.colors.color777,
}}>
{I18n.t('SourceAccount')}
</Text>
{/* <View style={styles.row}> */}
<RadioForm
radio_props={radio_props}
labelStyle={{fontSize: getFontXD(42)}}
formHorizontal={true}
style={styles.row}
initial={0}
onPress={(value) => {
setSrc(value);
}}
/>
{/* </View> */}
<Text
style={{
fontSize: getFontXD(42),
color: R.colors.color777,
}}>
{I18n.t('ChooseBeneficiaryAccount')}
</Text>
<PickerItem
width={width - 20}
data={data}
onValueChange={(value, items) => {
setType(items);
}}
/>
<TextMoney
onChangeText={(val) => setAmount(val)}
title={I18n.t('AmountOfMoney')}
value={amount}
/>
<TextMulti
onChangeText={(val) => setNotes(val)}
title={I18n.t('Note')}
/>
</View>
</ScrollView>
<View
style={{
paddingVertical: 10,
justifyContent: 'center',
alignItems: 'center',
}}>
<TouchableOpacity onPress={onPressWithdraw} style={styles.btnSend}>
<Text style={styles.txtSend}>{I18n.t('Withdraw')}</Text>
</TouchableOpacity>
</View>
<TouchableOpacity onPress={onPressWithdraw} style={styles.btnSend}>
<Text style={styles.txtSend}>{I18n.t('Withdraw')}</Text>
</TouchableOpacity>
</View>
</TouchableWithoutFeedback>
</KeyboardAvoidingView>
......@@ -240,9 +252,6 @@ const styles = StyleSheet.create({
fontWeight: 'bold',
},
btnSend: {
position: 'absolute',
bottom: 30,
right: width / 2 - 70,
width: 140,
height: 40,
backgroundColor: R.colors.main,
......
import React, {useEffect} from 'react';
import {View, Text} from 'react-native';
import {View, Text, Linking} from 'react-native';
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
import Icon from 'react-native-vector-icons/FontAwesome5';
import Ionicons from 'react-native-vector-icons/Ionicons';
......@@ -22,6 +22,7 @@ import I18n from '../helper/i18/i18n';
import {changeLanguage} from '../actions/language';
import KEY from '../assets/AsynStorage';
import AsyncStorage from '@react-native-community/async-storage';
import {DETAILNEW} from '../routers/ScreenNames';
const Tab = createBottomTabNavigator();
......@@ -33,11 +34,35 @@ const TabNavigator = (props) => {
const navigate = useNavigation();
useEffect(() => {
setInitLanguage();
checkDeepking();
setTimeout(() => {
showPopUp();
}, 3000);
}, []);
const checkDeepking = () => {
Linking.getInitialURL().then((url) => {
deeplinkScreen(url);
});
Linking.addEventListener('url', (url) => {
handleOpenURL(url);
});
};
const handleOpenURL = (event) => {
deeplinkScreen(event.url);
};
const deeplinkScreen = (url) => {
const route = url.replace(/.*?:\/\//g, '');
const id = route.match(/\/([^\/]+)\/?$/)[1];
const root = route.split('/')[0];
// const routeName = route.split('/')[1];
if (root == 'screen') {
navigate.navigate(DETAILNEW, {id});
}
};
useEffect(() => {
checkScreenInit();
}, [props.screenInit]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment