Closed5
ReactNativeでバックグラウンドで動作して位置情報をトラッキングするアプリのTips
概要
タイトルの通り、React Native
でバックグラウンドで起動し、位置情報を取得できるようなTips
,ライブラリを調べる。
ゴールとしては「お散歩アプリ」や「ランニングアプリ」のように、地図に端末の軌跡を表示する。
react-native-background-geolocation
install
yarn add react-native-background-geolocation
yarn add react-native-background-fetch@3.1.0
cd ios
pod install
info.plist
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>なにかしら記載</string>
<key>NSMotionUsageDescription</key>
<string>なにかしら記載</string>
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
<string>fetch</string>
<string>location</string>
</array>
下記記事がいい感じにまとまっていた。
Androidはライセンス購入が必要とのこと。
このスクラップは2023/01/19にクローズされました