update fetch fcm on login

This commit is contained in:
BDA MacMini 2025-09-23 18:07:43 +07:00
parent 9f7f2cebb8
commit 238e7a98ea
5 changed files with 35 additions and 17 deletions

View File

@ -462,6 +462,8 @@ PODS:
- React-Core
- react-native-pager-view (5.4.25):
- React-Core
- react-native-safe-area-context (4.7.4):
- React-Core
- react-native-splash-screen (3.3.0):
- React-Core
- react-native-view-shot (3.8.0):
@ -655,6 +657,7 @@ DEPENDENCIES:
- "react-native-cameraroll (from `../node_modules/@react-native-camera-roll/camera-roll`)"
- react-native-fbsdk-next (from `../node_modules/react-native-fbsdk-next`)
- react-native-pager-view (from `../node_modules/react-native-pager-view`)
- react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)
- react-native-splash-screen (from `../node_modules/react-native-splash-screen`)
- react-native-view-shot (from `../node_modules/react-native-view-shot`)
- react-native-webview (from `../node_modules/react-native-webview`)
@ -769,6 +772,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-fbsdk-next"
react-native-pager-view:
:path: "../node_modules/react-native-pager-view"
react-native-safe-area-context:
:path: "../node_modules/react-native-safe-area-context"
react-native-splash-screen:
:path: "../node_modules/react-native-splash-screen"
react-native-view-shot:
@ -886,6 +891,7 @@ SPEC CHECKSUMS:
react-native-cameraroll: 43049a467518f86545d6aba4caf8e373b03e7bbf
react-native-fbsdk-next: 52f81e60eb3e8e0e06cf9728b4572d3509ca9d01
react-native-pager-view: 873aef831fb4fe6e1a2e1ba7a79857e240dea380
react-native-safe-area-context: 8dba469126c1d5fb9502bfb49996026593292cf4
react-native-splash-screen: 95994222cc95c236bd3cdc59fe45ed5f27969594
react-native-view-shot: d1a701eb0719c6dccbd20b4bb43b1069f304cb70
react-native-webview: 5bb1454f1eb43e0bad229bb428a378d6b865a0ad

View File

@ -689,14 +689,14 @@
CODE_SIGN_ENTITLEMENTS = csareactrn60/csareactrn60.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CURRENT_PROJECT_VERSION = 166;
CURRENT_PROJECT_VERSION = 2;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = 84F3R56BUC;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 84F3R56BUC;
INFOPLIST_FILE = csareactrn60/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 2.108;
MARKETING_VERSION = 2.111;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
@ -720,13 +720,13 @@
CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 166;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = 84F3R56BUC;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 84F3R56BUC;
INFOPLIST_FILE = csareactrn60/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 2.108;
MARKETING_VERSION = 2.111;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",

View File

@ -363,7 +363,7 @@ const MainHeader = ({ navigation }) => {
}, [])
return <View style={[{ flex: 1, alignItems: 'center', flexDirection: 'row', marginTop: 0, paddingLeft: 10, backgroundColor: server_mode === 'develop' ? '#ff0000' : 'transparent' }]}>
<TouchableOpacity
onPress={openSecretChamber}
// onPress={openSecretChamber}
activeOpacity={1}>
<Image
style={{ width: 35, height: 35, }}

View File

@ -4,7 +4,7 @@ import AppStack from './AppStack'
import React from 'react'
import AppLoading from '../screens/app/AppLoading'
import LanguageSelect from '../screens/app/LanguageSelect'
import { View } from 'react-native'
import { Platform, View } from 'react-native'
import NavigationService from '../utils/NavigationService'
import {SafeAreaProvider, SafeAreaView} from "react-native-safe-area-context";
@ -20,11 +20,21 @@ export class AppNavContainer extends React.Component {
}
render () {
return <SafeAreaProvider>
<SafeAreaView style={{flex: 1}} edges={['top', 'bottom']}>
<MainNav ref={navigatorRef => {NavigationService.setTopLevelNavigator(navigatorRef)}}/>
</SafeAreaView>
</SafeAreaProvider>
if(Platform.OS === 'android') {
return (
<SafeAreaProvider>
<SafeAreaView style={{flex: 1}} edges={['top', 'bottom']}>
<MainNav ref={navigatorRef => {NavigationService.setTopLevelNavigator(navigatorRef)}}/>
</SafeAreaView>
</SafeAreaProvider>
)
}else {
return (
<View style={{flex: 1}}>
<MainNav ref={navigatorRef => {NavigationService.setTopLevelNavigator(navigatorRef)}}/>
</View>
)
}
}
}

View File

@ -33,6 +33,12 @@ class LoginScreen extends Component {
this._login = this._login.bind(this)
}
async componentDidMount() {
await messaging().deleteToken()
console.log('deletetoken');
}
async _login () {
this.setState({
isLoading: true
@ -40,7 +46,7 @@ class LoginScreen extends Component {
if (this.state.username && this.state.password) {
var regex = /^\d+$/;
const fcmToken = null;
let fcmToken = null;
if (regex.test(this.state.username) === true) {
console.log('true')
try {
@ -57,11 +63,7 @@ class LoginScreen extends Component {
if (enabled) {
console.log('Notification permission granted.');
if(Platform.OS === 'android') {
fcmToken = await messaging().getToken();
}else {
fcmToken = await messaging().getAPNSToken();
}
fcmToken = await messaging().getToken();
console.log('fcmToken >>>> ', fcmToken)
} else {
console.log('Notification permission denied.');