https://github.com/react-native-maps/react-native-maps/blob/master/docs/installation.md
yarn add react-native-maps
npx pod-install ios
ios/[service]App/AppDelegate.mm 경로에
#import <GoogleMaps/GoogleMaps.h>
[GMSServices provideAPIKey:@"YOUR_API_KEY"];
#import "AppDelegate.h"
#import <GoogleMaps/GoogleMaps.h>
#import <React/RCTBundleURLProvider.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[GMSServices provideAPIKey:@"_YOUR_API_KEY_"];
self.moduleName = @"ReviewItApp";
를 추가하고 YOUR_API_KEY여기에 구글 맵 API 키를 넣어줍니다.
rn_maps_path = '../node_modules/react-native-maps'
pod 'react-native-google-maps', :path => rn_maps_path
여기 두 줄을 추가해줍니다
platform :ios, '13.4'
prepare_react_native_project!
rn_maps_path = '../node_modules/react-native-maps'
pod 'react-native-google-maps', :path => rn_maps_path
config = use_native_modules!
config = use_native_modules!위에 두 줄을 추가해주면 됩니다.
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="Your Google maps API Key Here"/>
이 코드를 추가해주고 구글 맵 API 키를 넣어줍니다.
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>위치 확인을 위해서 위치 접근 권한 동의가 필요합니다.</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>위치 확인을 위해서 위치 접근 권한 동의가 필요합니다.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>위치 확인을 위해서 위치 접근 권한 동의가 필요합니다.</string>
<key>NSMotionUsageDescription</key>
<string>위치 확인을 위해서 위치 접근 권한 동의가 필요합니다.</string>
코드를 추가해줍니다.
설명을 자세하게 작성해야 앱 배포시 거절당하지 않습니다.