mdrajibsk8 / react-native-device-number

MIT License
3 stars 7 forks source link

Application is getting closed directly after this line DeviceNumber this was working fine before googlePlayServicesVersion 20.7.0 #16

Open RishiSetpal777 opened 4 months ago

RishiSetpal777 commented 4 months ago

Application is getting closed directly after this line DeviceNumber.get().then((res) => {}

import DeviceNumber from 'react-native-device-number';
const number = () => {
        if (Platform.OS === 'android') {
            DeviceNumber.get().then((res) => {
                let mobilenumber=(res.mobileNumber).replace(/\+91/, "");
                const numstring = (mobilenumber).toString();
                let mobile = "+91" + "-" + numstring;
                navigateToNextScreen();
            });
        }
    }

package.json

{
  "name": "****",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "@gorhom/bottom-sheet": "^4.5.1",
    "@motify/components": "^0.18.0",
    "@react-native-async-storage/async-storage": "^1.17.11",
    "@react-native-community/checkbox": "^0.5.14",
    "@react-native-community/clipboard": "^1.5.1",
    "@react-native-community/netinfo": "^9.4.1",
    "@react-native-google-signin/google-signin": "^10.0.1",
    "@react-navigation/bottom-tabs": "^6.5.3",
    "@react-navigation/drawer": "^6.5.7",
    "@react-navigation/material-top-tabs": "^6.5.1",
    "@react-navigation/native": "^6.1.1",
    "@react-navigation/native-stack": "^6.9.6",
    "@sentry/react-native": "^5.5.0",
    "@twotalltotems/react-native-otp-input": "^1.3.11",
    "axios": "^1.2.1",
    "formik": "^2.2.9",
    "jwt-decode": "^3.1.2",
    "lottie-react-native": "^5.1.4",
    "moment": "^2.29.4",
    "react": "18.2.0",
    "react-native": "^0.70.6",
    "react-native-app-auth": "^7.0.0-rc2",
    "react-native-background-timer": "^2.4.1",
    "react-native-base64": "^0.2.1",
    "react-native-confirmation-code-field": "^7.3.1",
    "react-native-dashed-line": "^1.1.0",
    "react-native-device-info": "^10.9.0",
    "react-native-device-number": "^1.0.9",
    "react-native-document-picker": "^8.1.3",
    "react-native-dropdown-picker": "^5.4.4",
    "react-native-elements": "^3.4.3",
    "react-native-fast-image": "^8.6.3",
    "react-native-file-viewer": "^2.1.5",
    "react-native-fs": "^2.20.0",
    "react-native-gesture-handler": "^2.9.0",
    "react-native-html-to-pdf": "^0.12.0",
    "react-native-keyboard-aware-scroll-view": "^0.9.5",
    "react-native-localize": "^3.0.2",
    "react-native-material-menu": "^2.0.0",
    "react-native-modal-dropdown": "^1.0.2",
    "react-native-otp-verify": "^1.1.8",
    "react-native-pager-view": "^6.1.2",
    "react-native-paper": "^5.0.2",
    "react-native-paper-dates": "^0.11.15",
    "react-native-paper-dropdown": "^1.0.7",
    "react-native-permissions": "^3.8.0",
    "react-native-progress": "^5.0.0",
    "react-native-raw-bottom-sheet": "^2.2.0",
    "react-native-reanimated": "^2.13.0",
    "react-native-render-html": "^6.3.4",
    "react-native-root-toast": "^3.4.1",
    "react-native-safe-area-context": "^4.4.1",
    "react-native-screens": "^3.18.2",
    "react-native-simple-toast": "^3.0.2",
    "react-native-snap-carousel": "^1.3.1",
    "react-native-status-bar-height": "^2.6.0",
    "react-native-svg": "^13.9.0",
    "react-native-tab-view": "^3.3.4",
    "react-native-vector-icons": "^9.2.0",
    "react-native-video": "^5.2.1",
    "react-native-webview": "^11.26.1",
    "react-redux": "^8.0.5",
    "redux": "^4.2.0",
    "redux-persist": "^6.0.0",
    "redux-thunk": "^2.4.2",
    "yup": "^0.32.11"
  },
  "reactNativePermissionsIOS": [
    "AppTrackingTransparency",
    "Camera",
    "MediaLibrary",
    "PhotoLibrary",
    "PhotoLibraryAddOnly"
  ],
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@babel/runtime": "^7.12.5",
    "@react-native-community/eslint-config": "^2.0.0",
    "babel-jest": "^26.6.3",
    "eslint": "^7.32.0",
    "jest": "^26.6.3",
    "metro-react-native-babel-preset": "0.72.3",
    "react-test-renderer": "18.1.0"
  },
  "jest": {
    "preset": "react-native"
  }
}

recently i have updated react-native-otp-verify from 1.0.7 to 1.0.9

mdrajibsk8 commented 4 months ago
Screenshot 2024-03-02 at 12 49 39 AM

I tried with this everything works fine for me. @RishiSetpal777 Would you please share more about what you changed so that I can try reproducing the issue?

DineshLt93 commented 4 months ago

I am also getting the same kind of issues with the below React native version. So please suggest to me a needful solution.

"react-native": "0.72.6",

run the below code in the first line.

DeviceNumber.get().then((res) => { console.log(res); });

priyanshu2000 commented 3 months ago

@DineshLt93 / @RishiSetpal777 did you guys find any solution ?

Deepak9811 commented 2 months ago

Not working on Android 14.