diff --git a/app.json b/app.json index faae236..8ce15ed 100644 --- a/app.json +++ b/app.json @@ -28,6 +28,12 @@ { "initialOrientation": "DEFAULT" } + ], + [ + "expo-location", + { + "locationWhenInUsePermission": "この位置情報は、リンク画面で現在地側近の駅情報を取得するのに使用されます。" + } ] ], "version": "5.0", @@ -44,8 +50,8 @@ }, "assetBundlePatterns": ["**/*"], "ios": { - "buildNumber": "34", - "supportsTablet": true, + "buildNumber": "38", + "supportsTablet": false, "bundleIdentifier": "jrshikokuinfo.xprocess.hrkn", "config": { "googleMapsApiKey": "AIzaSyAVGDTjBkR_0wkQiNkoo5WDLhqXCjrjk8Y" diff --git a/menu.js b/menu.js index 066a74b..eefde48 100644 --- a/menu.js +++ b/menu.js @@ -41,12 +41,16 @@ export default function Menu({ getCurrentTrain }) { const [locationStatus, setLocationStatus] = useState(null); useEffect(() => { Location.requestForegroundPermissionsAsync().then((data) => { - setLocationStatus(data.status); + setLocationStatus( + Platform.OS == "ios" + ? data.status == "granted" + : data.android.accuracy == "fine" + ); }); }, []); const getCurrentPosition = () => { - if (locationStatus !== "granted") return () => {}; + if (!locationStatus) return () => {}; Location.getCurrentPositionAsync({}).then((location) => makeCurrentStation(location) );