Commit b7768815 by Giang Tran

update deeep link

parent e7ab62e4
...@@ -32,6 +32,14 @@ ...@@ -32,6 +32,14 @@
android:exported="true" android:exported="true"
android:launchMode="singleTask" android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize"> 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>
<activity <activity
android:name="com.zoontek.rnbootsplash.RNBootSplashActivity" android:name="com.zoontek.rnbootsplash.RNBootSplashActivity"
...@@ -43,12 +51,7 @@ ...@@ -43,12 +51,7 @@
</intent-filter> </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> </activity>
......
<resources> <resources>
<color name="bootsplash_background">#1C6AF6</color> <color name="bootsplash_background">#1C6AF6</color>
<color name="white">#1C6AF6</color> <color name="white">#fff</color>
</resources> </resources>
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#import <React/RCTRootView.h> #import <React/RCTRootView.h>
@import Firebase; @import Firebase;
#import <React/RCTLinkingManager.h>
#import <AVFoundation/AVFoundation.h> #import <AVFoundation/AVFoundation.h>
#import "RNBootSplash.h" #import "RNBootSplash.h"
#if DEBUG #if DEBUG
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#import <FlipperKitReactPlugin/FlipperKitReactPlugin.h> #import <FlipperKitReactPlugin/FlipperKitReactPlugin.h>
//#import <CallAppSDK/CallAppInterface.h> //#import <CallAppSDK/CallAppInterface.h>
static void InitializeFlipper(UIApplication *application) { static void InitializeFlipper(UIApplication *application) {
FlipperClient *client = [FlipperClient sharedClient]; FlipperClient *client = [FlipperClient sharedClient];
SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults]; SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];
...@@ -55,6 +56,33 @@ static void InitializeFlipper(UIApplication *application) { ...@@ -55,6 +56,33 @@ static void InitializeFlipper(UIApplication *application) {
return YES; 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 - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{ {
#if DEBUG #if DEBUG
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<string>dcv.investcustomer.vn. linking</string> <string>dcv.investcustomer.vn. linking</string>
<key>CFBundleURLSchemes</key> <key>CFBundleURLSchemes</key>
<array> <array>
<string>dcvinvest</string> <string>appdcvinvest</string>
</array> </array>
</dict> </dict>
</array> </array>
......
...@@ -37,6 +37,7 @@ const PacketCQG = (props) => { ...@@ -37,6 +37,7 @@ const PacketCQG = (props) => {
props.showLoading(); props.showLoading();
const res = await openCQG({packages: newList}); const res = await openCQG({packages: newList});
props.hideLoading(); props.hideLoading();
console.log(res);
if (res.data.code == 200) { if (res.data.code == 200) {
props.saveUserToRedux(res.data.data); props.saveUserToRedux(res.data.data);
setTimeout(() => { setTimeout(() => {
......
...@@ -6,6 +6,11 @@ import { ...@@ -6,6 +6,11 @@ import {
Dimensions, Dimensions,
TouchableOpacity, TouchableOpacity,
Alert, Alert,
TouchableWithoutFeedback,
Keyboard,
KeyboardAvoidingView,
Platform,
ScrollView,
} from 'react-native'; } from 'react-native';
import R from '../../../assets/R'; import R from '../../../assets/R';
import HeaderBack from '../../../components/Header/HeaderBack'; import HeaderBack from '../../../components/Header/HeaderBack';
...@@ -32,7 +37,10 @@ const WalletDeposit = (props) => { ...@@ -32,7 +37,10 @@ const WalletDeposit = (props) => {
const navigate = useNavigation(); const navigate = useNavigation();
const onClick = async () => { 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]); const index = checkFormatArray([amount, notes]);
if (index === true) { if (index === true) {
...@@ -63,45 +71,64 @@ const WalletDeposit = (props) => { ...@@ -63,45 +71,64 @@ const WalletDeposit = (props) => {
} }
}; };
return ( return (
<View style={{flex: 1}}> <KeyboardAvoidingView
<HeaderBack title={'InvestmentDeposit'} /> behavior={Platform.Os === 'ios' ? 'padding' : 'height'}
<View style={styles.container}> style={{flex: 1, backgroundColor: 'white'}}
<View style={styles.wrapTop}> keyboardVerticalOffset={-50}>
<View style={styles.itemTop}> <TouchableWithoutFeedback onPress={Keyboard.dismiss}>
<Text style={styles.txtTitle}>{I18n.t('Wallet')}</Text> <View style={{flex: 1}}>
<Text style={styles.txtMoney}> <HeaderBack title={'InvestmentDeposit'} />
{' '} <ScrollView showsVerticalScrollIndicator={false}>
{props.user.current_money != 0 <View style={styles.container}>
? toPriceVnd(props.user.current_money) <View style={styles.wrapTop}>
: 0}{' '} <View style={styles.itemTop}>
</Text> <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>
<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>
</View> </TouchableWithoutFeedback>
<TouchableOpacity onPress={onClick} style={styles.btnSend}> </KeyboardAvoidingView>
<Text style={styles.txtSend}>{I18n.t('Deposit')}</Text>
</TouchableOpacity>
</View>
); );
}; };
...@@ -147,9 +174,6 @@ const styles = StyleSheet.create({ ...@@ -147,9 +174,6 @@ const styles = StyleSheet.create({
fontWeight: 'bold', fontWeight: 'bold',
}, },
btnSend: { btnSend: {
position: 'absolute',
bottom: 30,
right: width / 2 - 70,
width: 140, width: 140,
height: 40, height: 40,
backgroundColor: R.colors.main, backgroundColor: R.colors.main,
......
...@@ -10,6 +10,7 @@ import { ...@@ -10,6 +10,7 @@ import {
TouchableWithoutFeedback, TouchableWithoutFeedback,
Keyboard, Keyboard,
KeyboardAvoidingView, KeyboardAvoidingView,
ScrollView,
} from 'react-native'; } from 'react-native';
import R from '../../../assets/R'; import R from '../../../assets/R';
import HeaderBack from '../../../components/Header/HeaderBack'; import HeaderBack from '../../../components/Header/HeaderBack';
...@@ -61,9 +62,8 @@ const WalletWithdraw = (props) => { ...@@ -61,9 +62,8 @@ const WalletWithdraw = (props) => {
}); });
if (res.data.code == 200 && res.data.data) { if (res.data.code == 200 && res.data.data) {
if (res.data.data.length == 0) { if (res.data.data.length == 0) {
confirmAlert( confirmAlert(I18n.t('SettingPaymentMethodConfirm'), () =>
I18n.t('SettingPaymentMethodConfirm'), navigate.navigate(ADDMETHODPAY),
() => navigate.navigate(ADDMETHODPAY),
); );
} else { } else {
const newList = res.data.data.map((e) => { const newList = res.data.data.map((e) => {
...@@ -77,7 +77,10 @@ const WalletWithdraw = (props) => { ...@@ -77,7 +77,10 @@ const WalletWithdraw = (props) => {
}; };
const onPressWithdraw = async () => { 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]); const index = checkFormatArray([type, amount]);
...@@ -120,78 +123,87 @@ const WalletWithdraw = (props) => { ...@@ -120,78 +123,87 @@ const WalletWithdraw = (props) => {
<TouchableWithoutFeedback onPress={Keyboard.dismiss}> <TouchableWithoutFeedback onPress={Keyboard.dismiss}>
<View style={{flex: 1}}> <View style={{flex: 1}}>
<HeaderBack title={'Withdraw'} /> <HeaderBack title={'Withdraw'} />
<View style={styles.container}> <ScrollView showsVerticalScrollIndicator={false}>
<View style={styles.wrapTop}> <View style={styles.container}>
<View style={styles.itemTop}> <View style={styles.wrapTop}>
<Text style={styles.txtTitle}>{I18n.t('Wallet')}</Text> <View style={styles.itemTop}>
<Text style={styles.txtMoney}> <Text style={styles.txtTitle}>{I18n.t('Wallet')}</Text>
{' '} <Text style={styles.txtMoney}>
{props.user.current_money != 0 {' '}
? toPriceVnd(props.user.current_money) {props.user.current_money != 0
: 0}{' '} ? toPriceVnd(props.user.current_money)
</Text> : 0}{' '}
</View> </Text>
</View>
<View style={{width: 1, backgroundColor: '#DBDBDB'}} /> <View style={{width: 1, backgroundColor: '#DBDBDB'}} />
<View style={styles.itemTop}> <View style={styles.itemTop}>
<Text style={styles.txtTitle}>CQG</Text> <Text style={styles.txtTitle}>CQG</Text>
<Text style={styles.txtMoney}> <Text style={styles.txtMoney}>
{props.user.current_cqg_money != 0 {props.user.current_cqg_money != 0
? toPriceVnd(props.user.current_cqg_money) ? toPriceVnd(props.user.current_cqg_money)
: 0}{' '} : 0}{' '}
đ đ
</Text>
</View>
</View>
<View style={styles.wrapBody}>
<Text
style={{
fontSize: getFontXD(42),
color: R.colors.color777,
}}>
{I18n.t('SourceAccount')}
</Text> </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> </View>
<View style={styles.wrapBody}> </ScrollView>
<Text <View
style={{ style={{
fontSize: getFontXD(42), paddingVertical: 10,
color: R.colors.color777, justifyContent: 'center',
}}> alignItems: 'center',
{I18n.t('SourceAccount')} }}>
</Text> <TouchableOpacity onPress={onPressWithdraw} style={styles.btnSend}>
{/* <View style={styles.row}> */} <Text style={styles.txtSend}>{I18n.t('Withdraw')}</Text>
<RadioForm </TouchableOpacity>
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>
<TouchableOpacity onPress={onPressWithdraw} style={styles.btnSend}>
<Text style={styles.txtSend}>{I18n.t('Withdraw')}</Text>
</TouchableOpacity>
</View> </View>
</TouchableWithoutFeedback> </TouchableWithoutFeedback>
</KeyboardAvoidingView> </KeyboardAvoidingView>
...@@ -240,9 +252,6 @@ const styles = StyleSheet.create({ ...@@ -240,9 +252,6 @@ const styles = StyleSheet.create({
fontWeight: 'bold', fontWeight: 'bold',
}, },
btnSend: { btnSend: {
position: 'absolute',
bottom: 30,
right: width / 2 - 70,
width: 140, width: 140,
height: 40, height: 40,
backgroundColor: R.colors.main, backgroundColor: R.colors.main,
......
import React, {useEffect} from 'react'; 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 {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
import Icon from 'react-native-vector-icons/FontAwesome5'; import Icon from 'react-native-vector-icons/FontAwesome5';
import Ionicons from 'react-native-vector-icons/Ionicons'; import Ionicons from 'react-native-vector-icons/Ionicons';
...@@ -22,6 +22,7 @@ import I18n from '../helper/i18/i18n'; ...@@ -22,6 +22,7 @@ import I18n from '../helper/i18/i18n';
import {changeLanguage} from '../actions/language'; import {changeLanguage} from '../actions/language';
import KEY from '../assets/AsynStorage'; import KEY from '../assets/AsynStorage';
import AsyncStorage from '@react-native-community/async-storage'; import AsyncStorage from '@react-native-community/async-storage';
import {DETAILNEW} from '../routers/ScreenNames';
const Tab = createBottomTabNavigator(); const Tab = createBottomTabNavigator();
...@@ -33,11 +34,35 @@ const TabNavigator = (props) => { ...@@ -33,11 +34,35 @@ const TabNavigator = (props) => {
const navigate = useNavigation(); const navigate = useNavigation();
useEffect(() => { useEffect(() => {
setInitLanguage(); setInitLanguage();
checkDeepking();
setTimeout(() => { setTimeout(() => {
showPopUp(); showPopUp();
}, 3000); }, 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(() => { useEffect(() => {
checkScreenInit(); checkScreenInit();
}, [props.screenInit]); }, [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