diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a85cfd2d..8dfe17d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -240,7 +240,7 @@ jobs: with: path: | **/ios/Pods - key: ${{ runner.os }}-cocoapods-${{ hashFiles('**/package.json') }} + key: ${{ runner.os }}-cocoapods-${{ hashFiles('**/package.json', '**/*.podspec', '**/Podfile.lock') }} restore-keys: | ${{ runner.os }}-cocoapods- @@ -248,7 +248,7 @@ jobs: if: env.turbo_cache_hit != 1 || steps.cocoapods-cache.outputs.cache-hit != 'true' run: | cd example/ios - RCT_NEW_ARCH_ENABLED=0 pod install + pod install env: NO_FLIPPER: 1 diff --git a/MIGRATING.md b/MIGRATING.md index fddf58e7..63c76e4d 100644 --- a/MIGRATING.md +++ b/MIGRATING.md @@ -4,11 +4,42 @@ This document covers breaking changes and migration steps between major versions ## Table of Contents +- [Migrating from 0.17.x to 0.18.x](#migrating-from-017x-to-018x) - [Migrating from 0.16.x to 0.17.x](#migrating-from-016x-to-017x) - [Migrating from 0.13.x to 0.14.x](#migrating-from-013x-to-014x) --- +## Migrating from 0.17.x to 0.18.x + +Version 0.18.0 resolves the iOS Google Navigation SDK through Swift Package Manager and upgrades it to `11.0.0`. + +### Summary of Breaking Changes + +| Category | Change | +| ----------- | ------------------------------------------------------------------------------------- | +| Native SDKs | iOS Navigation SDK upgraded to `11.0.0` and resolved through Swift Package Manager | +| iOS display | `showTrafficLights` and `showStopSigns` no longer affect iOS navigation views | +| iOS maps | `MapType.TERRAIN` is unavailable during active navigation on iOS | + +### What changed + +Google Navigation is now resolved through Swift Package Manager during `pod install`, rather than through a CocoaPods `GoogleNavigation` dependency. CocoaPods continues to manage React Native autolinking and other pods, but it no longer fetches Google Navigation. Configure framework linkage in your app's Podfile according to your app's dependency requirements; the example app uses dynamic frameworks. + +Navigation SDK 11 always displays traffic lights and stop signs during navigation. The deprecated `showTrafficLights` and `showStopSigns` display options have no effect on iOS, but continue to apply on Android. Terrain map type is no longer available during active navigation on iOS; `MapType.TERRAIN` remains available for non-navigation maps. Add an `NSMotionUsageDescription` entry to your app's `Info.plist` to prevent future motion sensor-related crashes. + +### Reinstall iOS pods + +Reinstall pods after upgrading: + +```bash +cd ios && pod install +``` + +### Release notes + +For native SDK changes introduced upstream, review the [iOS Navigation SDK 11.0.0 release notes](https://developers.google.com/maps/documentation/navigation/ios-sdk/release-notes). + ## Migrating from 0.16.x to 0.17.x Version 0.17.0 upgrades the underlying Google Navigation SDKs and raises the minimum Android build toolchain requirements. diff --git a/README.md b/README.md index 36408286..a52ebfe5 100644 --- a/README.md +++ b/README.md @@ -126,6 +126,15 @@ This package requires React Native's new architecture. Make sure new architectur ENV['RCT_NEW_ARCH_ENABLED'] = '1' ``` +#### Motion sensor usage description + +Google recommends adding an `NSMotionUsageDescription` entry to your app's `Info.plist` to ensure compatibility with future motion sensor-related functionality in the underlying Navigation SDK for iOS. + +```xml +NSMotionUsageDescription +Used to improve navigation features. +``` + #### Set Google Maps API Key To set up, specify your API key in the application delegate `ios/Runner/AppDelegate.m`: @@ -301,8 +310,6 @@ try { const displayOptions: DisplayOptions = { showDestinationMarkers: true, - showStopSigns: true, - showTrafficLights: true, }; await navigationController.setDestinations([waypoint], { routingOptions, displayOptions }); diff --git a/example/Gemfile.lock b/example/Gemfile.lock new file mode 100644 index 00000000..0fe9f6eb --- /dev/null +++ b/example/Gemfile.lock @@ -0,0 +1,120 @@ +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (3.0.7) + base64 + nkf + rexml + activesupport (6.1.7.10) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + zeitwerk (~> 2.3) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + algoliasearch (1.27.5) + httpclient (~> 2.8, >= 2.8.3) + json (>= 1.5.1) + atomos (0.1.3) + base64 (0.3.0) + benchmark (0.4.1) + bigdecimal (3.2.2) + claide (1.1.0) + cocoapods (1.15.2) + addressable (~> 2.8) + claide (>= 1.0.2, < 2.0) + cocoapods-core (= 1.15.2) + cocoapods-deintegrate (>= 1.0.3, < 2.0) + cocoapods-downloader (>= 2.1, < 3.0) + cocoapods-plugins (>= 1.0.0, < 2.0) + cocoapods-search (>= 1.0.0, < 2.0) + cocoapods-trunk (>= 1.6.0, < 2.0) + cocoapods-try (>= 1.1.0, < 2.0) + colored2 (~> 3.1) + escape (~> 0.0.4) + fourflusher (>= 2.3.0, < 3.0) + gh_inspector (~> 1.0) + molinillo (~> 0.8.0) + nap (~> 1.0) + ruby-macho (>= 2.3.0, < 3.0) + xcodeproj (>= 1.23.0, < 2.0) + cocoapods-core (1.15.2) + activesupport (>= 5.0, < 8) + addressable (~> 2.8) + algoliasearch (~> 1.0) + concurrent-ruby (~> 1.1) + fuzzy_match (~> 2.0.4) + nap (~> 1.0) + netrc (~> 0.11) + public_suffix (~> 4.0) + typhoeus (~> 1.0) + cocoapods-deintegrate (1.0.5) + cocoapods-downloader (2.1) + cocoapods-plugins (1.0.0) + nap + cocoapods-search (1.0.1) + cocoapods-trunk (1.6.0) + nap (>= 0.8, < 2.0) + netrc (~> 0.11) + cocoapods-try (1.2.0) + colored2 (3.1.2) + concurrent-ruby (1.3.3) + drb (2.2.3) + escape (0.0.4) + ethon (0.15.0) + ffi (>= 1.15.0) + ffi (1.17.2) + fourflusher (2.3.1) + fuzzy_match (2.0.4) + gh_inspector (1.1.3) + httpclient (2.9.0) + mutex_m + i18n (1.14.7) + concurrent-ruby (~> 1.0) + json (2.7.6) + logger (1.7.0) + minitest (6.0.6) + drb (~> 2.0) + prism (~> 1.5) + molinillo (0.8.0) + mutex_m (0.3.0) + nanaimo (0.3.0) + nap (1.1.0) + netrc (0.11.0) + nkf (0.2.0) + prism (1.9.0) + public_suffix (4.0.7) + rexml (3.4.2) + ruby-macho (2.5.1) + typhoeus (1.5.0) + ethon (>= 0.9.0, < 0.16.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + xcodeproj (1.25.1) + CFPropertyList (>= 2.3.3, < 4.0) + atomos (~> 0.1.3) + claide (>= 1.0.2, < 2.0) + colored2 (~> 3.1) + nanaimo (~> 0.3.0) + rexml (>= 3.3.6, < 4.0) + zeitwerk (2.6.18) + +PLATFORMS + ruby + +DEPENDENCIES + activesupport (>= 6.1.7.5, != 7.1.0) + benchmark + bigdecimal + cocoapods (>= 1.13, != 1.15.1, != 1.15.0) + concurrent-ruby (< 1.3.4) + logger + mutex_m + xcodeproj (< 1.26.0) + +RUBY VERSION + ruby 3.2.2p53 + +BUNDLED WITH + 2.4.10 diff --git a/example/README.md b/example/README.md index 9af829fe..620fedd4 100644 --- a/example/README.md +++ b/example/README.md @@ -22,7 +22,7 @@ First, make sure you go through the setup from the main [README](../README.md). `pod install` - Note: This example app requires React Native's new architecture to be enabled (RCT_NEW_ARCH_ENABLED=1), which is configured in the Podfile. + Note: This example app requires React Native's new architecture and uses dynamic framework linkage, both configured in the Podfile. Open `SampleApp.xcworkspace` in Xcode after installing pods. 2. Copy the `Keys.plist.sample` file located in `example/ios/SampleApp/` to a new file named `Keys.plist`. This file is git ignored and won't be accidentally committed. In your Google cloud console, add the Google API key to the project and add this newly created API key to the `Keys.plist` file. diff --git a/example/ios/Podfile b/example/ios/Podfile index 20b0857b..5e27170d 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -23,11 +23,7 @@ setup_permissions([ 'Notifications', ]) -linkage = ENV['USE_FRAMEWORKS'] -if linkage != nil - Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green - use_frameworks! :linkage => linkage.to_sym -end +use_frameworks! :linkage => :dynamic config = use_native_modules! diff --git a/example/ios/SampleApp.xcodeproj/project.pbxproj b/example/ios/SampleApp.xcodeproj/project.pbxproj index df02e920..0a89131a 100644 --- a/example/ios/SampleApp.xcodeproj/project.pbxproj +++ b/example/ios/SampleApp.xcodeproj/project.pbxproj @@ -8,12 +8,9 @@ /* Begin PBXBuildFile section */ 00E356F31AD99517003FC87E /* SampleAppTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* SampleAppTests.mm */; }; - 062AC10D618662A05665211C /* libPods-SampleAppCarPlay.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F7A476D4E03B73E48762E4D4 /* libPods-SampleAppCarPlay.a */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.mm */; }; - 29F89EA4FF546EABE968E1D2 /* libPods-SampleApp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 354226CC8A58229ECC025410 /* libPods-SampleApp.a */; }; 2A20E8122C8994DB00DB7ADA /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.mm */; }; - 2A20E8142C8994DB00DB7ADA /* BuildFile in Frameworks */ = {isa = PBXBuildFile; }; 2A20E8282C899A1400DB7ADA /* Info-CarPlay.plist in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB61A68108700A75B9A /* Info-CarPlay.plist */; }; 2AB8C27A2C89A07000250560 /* Keys.plist in Resources */ = {isa = PBXBuildFile; fileRef = 52D4271C2C81D3F300C7FB36 /* Keys.plist */; }; 2AB8C27E2C89A0B400250560 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; @@ -25,8 +22,10 @@ 52206E862C8B2FEC00B34D22 /* PhoneSceneDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 52206E822C8B2FEC00B34D22 /* PhoneSceneDelegate.mm */; }; 52206E892C8B303700B34D22 /* AppDelegateCarPlay.mm in Sources */ = {isa = PBXBuildFile; fileRef = 52206E882C8B303700B34D22 /* AppDelegateCarPlay.mm */; }; 52D4271D2C81D3F300C7FB36 /* Keys.plist in Resources */ = {isa = PBXBuildFile; fileRef = 52D4271C2C81D3F300C7FB36 /* Keys.plist */; }; - 77BA6ED186FC355B21D3A62F /* libPods-SampleAppTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 36A733F29B6732CA2CF27A17 /* libPods-SampleAppTests.a */; }; + 64D1697D489B0F3255985321 /* Pods_SampleAppCarPlay.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 95931FFADA3D5522923A0F5B /* Pods_SampleAppCarPlay.framework */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; + AA3CA297C8EC7B693A13A44B /* Pods_SampleAppTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 33E9EBE1CFC402F90D5DE484 /* Pods_SampleAppTests.framework */; }; + C89FA619825746794A19ACB5 /* Pods_SampleApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B0D6ABF2B0017DFBAB6F7A58 /* Pods_SampleApp.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -51,8 +50,7 @@ 2A20E8202C8994DB00DB7ADA /* SampleApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SampleApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; 2AB8C27C2C89A09D00250560 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = SampleApp/Info.plist; sourceTree = ""; }; 2AEB719D2C7C80F9002224A5 /* SampleApp.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = SampleApp.entitlements; path = SampleApp/SampleApp.entitlements; sourceTree = ""; }; - 354226CC8A58229ECC025410 /* libPods-SampleApp.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SampleApp.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 36A733F29B6732CA2CF27A17 /* libPods-SampleAppTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SampleAppTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 33E9EBE1CFC402F90D5DE484 /* Pods_SampleAppTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SampleAppTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 3B4392A12AC88292D35C810B /* Pods-SampleApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SampleApp.debug.xcconfig"; path = "Target Support Files/Pods-SampleApp/Pods-SampleApp.debug.xcconfig"; sourceTree = ""; }; 4735EA9AB0E8831D741A3A3E /* Pods-SampleAppCarPlay.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SampleAppCarPlay.debug.xcconfig"; path = "Target Support Files/Pods-SampleAppCarPlay/Pods-SampleAppCarPlay.debug.xcconfig"; sourceTree = ""; }; 5205C1212C8B314F00D0FC6B /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = SampleApp/AppDelegate.mm; sourceTree = ""; }; @@ -70,9 +68,10 @@ 750C10660A3F190F6072C5DA /* Pods-SampleAppCarPlay.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SampleAppCarPlay.release.xcconfig"; path = "Target Support Files/Pods-SampleAppCarPlay/Pods-SampleAppCarPlay.release.xcconfig"; sourceTree = ""; }; 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = SampleApp/LaunchScreen.storyboard; sourceTree = ""; }; 89C6BE57DB24E9ADA2F236DE /* Pods-SampleApp-SampleAppTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SampleApp-SampleAppTests.release.xcconfig"; path = "Target Support Files/Pods-SampleApp-SampleAppTests/Pods-SampleApp-SampleAppTests.release.xcconfig"; sourceTree = ""; }; + 95931FFADA3D5522923A0F5B /* Pods_SampleAppCarPlay.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SampleAppCarPlay.framework; sourceTree = BUILT_PRODUCTS_DIR; }; A9D547919643FC330CF84EC3 /* Pods-SampleAppTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SampleAppTests.release.xcconfig"; path = "Target Support Files/Pods-SampleAppTests/Pods-SampleAppTests.release.xcconfig"; sourceTree = ""; }; + B0D6ABF2B0017DFBAB6F7A58 /* Pods_SampleApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SampleApp.framework; sourceTree = BUILT_PRODUCTS_DIR; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; - F7A476D4E03B73E48762E4D4 /* libPods-SampleAppCarPlay.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SampleAppCarPlay.a"; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -80,7 +79,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 77BA6ED186FC355B21D3A62F /* libPods-SampleAppTests.a in Frameworks */, + AA3CA297C8EC7B693A13A44B /* Pods_SampleAppTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -88,7 +87,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 062AC10D618662A05665211C /* libPods-SampleAppCarPlay.a in Frameworks */, + 64D1697D489B0F3255985321 /* Pods_SampleAppCarPlay.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -96,8 +95,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 2A20E8142C8994DB00DB7ADA /* BuildFile in Frameworks */, - 29F89EA4FF546EABE968E1D2 /* libPods-SampleApp.a in Frameworks */, + C89FA619825746794A19ACB5 /* Pods_SampleApp.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -148,9 +146,9 @@ isa = PBXGroup; children = ( ED297162215061F000B7C4FE /* JavaScriptCore.framework */, - F7A476D4E03B73E48762E4D4 /* libPods-SampleAppCarPlay.a */, - 36A733F29B6732CA2CF27A17 /* libPods-SampleAppTests.a */, - 354226CC8A58229ECC025410 /* libPods-SampleApp.a */, + B0D6ABF2B0017DFBAB6F7A58 /* Pods_SampleApp.framework */, + 95931FFADA3D5522923A0F5B /* Pods_SampleAppCarPlay.framework */, + 33E9EBE1CFC402F90D5DE484 /* Pods_SampleAppTests.framework */, ); name = Frameworks; sourceTree = ""; @@ -806,6 +804,22 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "${PODS_ROOT}/ReactCommon", + "${PODS_ROOT}/ReactCommon/react/nativemodule/core", + "${PODS_ROOT}/React-runtimeexecutor", + "${PODS_ROOT}/React-runtimeexecutor/platform/ios", + "${PODS_ROOT}/ReactCommon-Samples", + "${PODS_ROOT}/ReactCommon-Samples/platform/ios", + "${PODS_ROOT}/React-Fabric/react/renderer/components/view/platform/cxx", + "${PODS_ROOT}/React-NativeModulesApple", + "${PODS_ROOT}/React-bridging", + "${PODS_ROOT}/React-graphics", + "${PODS_ROOT}/React-graphics/react/renderer/graphics/platform/ios", + "${PODS_ROOT}/React-featureflags", + "${PODS_ROOT}/React-renderercss", + ); IPHONEOS_DEPLOYMENT_TARGET = 16.6; LD_RUNPATH_SEARCH_PATHS = ( /usr/lib/swift, @@ -881,6 +895,22 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "${PODS_ROOT}/ReactCommon", + "${PODS_ROOT}/ReactCommon/react/nativemodule/core", + "${PODS_ROOT}/React-runtimeexecutor", + "${PODS_ROOT}/React-runtimeexecutor/platform/ios", + "${PODS_ROOT}/ReactCommon-Samples", + "${PODS_ROOT}/ReactCommon-Samples/platform/ios", + "${PODS_ROOT}/React-Fabric/react/renderer/components/view/platform/cxx", + "${PODS_ROOT}/React-NativeModulesApple", + "${PODS_ROOT}/React-bridging", + "${PODS_ROOT}/React-graphics", + "${PODS_ROOT}/React-graphics/react/renderer/graphics/platform/ios", + "${PODS_ROOT}/React-featureflags", + "${PODS_ROOT}/React-renderercss", + ); IPHONEOS_DEPLOYMENT_TARGET = 16.6; LD_RUNPATH_SEARCH_PATHS = ( /usr/lib/swift, diff --git a/example/ios/SampleApp.xcworkspace/xcshareddata/swiftpm/Package.resolved b/example/ios/SampleApp.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 00000000..b6355040 --- /dev/null +++ b/example/ios/SampleApp.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,24 @@ +{ + "originHash" : "d019271120bd6ba66c643fd40240ec82425d2ff6bfc56160815084a565cd83bf", + "pins" : [ + { + "identity" : "ios-maps-sdk", + "kind" : "remoteSourceControl", + "location" : "https://github.com/googlemaps/ios-maps-sdk", + "state" : { + "revision" : "c37c4946d60f0ab069476d5781053b837771546e", + "version" : "11.0.0" + } + }, + { + "identity" : "ios-navigation-sdk", + "kind" : "remoteSourceControl", + "location" : "https://github.com/googlemaps/ios-navigation-sdk.git", + "state" : { + "revision" : "a1918c947b971570a8f7167a6ec09e9d08ee2b3f", + "version" : "11.0.0" + } + } + ], + "version" : 3 +} diff --git a/example/ios/SampleApp/Info-CarPlay.plist b/example/ios/SampleApp/Info-CarPlay.plist index 09ed6a74..8b039bdc 100644 --- a/example/ios/SampleApp/Info-CarPlay.plist +++ b/example/ios/SampleApp/Info-CarPlay.plist @@ -39,6 +39,8 @@ [Enter any description related to the key] NSLocationWhenInUseUsageDescription [Add your description here] + NSMotionUsageDescription + Used to improve navigation features. UIApplicationSceneManifest UIApplicationSupportsMultipleScenes diff --git a/example/ios/SampleApp/Info.plist b/example/ios/SampleApp/Info.plist index 882d8bcf..f73a671a 100644 --- a/example/ios/SampleApp/Info.plist +++ b/example/ios/SampleApp/Info.plist @@ -43,6 +43,8 @@ [Add your description here] NSLocationWhenInUseUsageDescription [Add your description here] + NSMotionUsageDescription + Used to improve navigation features. RCTNewArchEnabled UIBackgroundModes diff --git a/ios/react-native-navigation-sdk/NavModule.mm b/ios/react-native-navigation-sdk/NavModule.mm index a13d210e..36701c77 100644 --- a/ios/react-native-navigation-sdk/NavModule.mm +++ b/ios/react-native-navigation-sdk/NavModule.mm @@ -16,6 +16,7 @@ #import "NavModule.h" #import +#import #import "NavAutoModule.h" #import "NavViewModule.h" #import "ObjectTranslationUtil.h" @@ -28,6 +29,7 @@ @"Make sure to initialize the navigator is ready before executing."; static NSString *const kNoDestinationsErrorCode = @"NO_DESTINATIONS"; static NSString *const kNoDestinationsErrorMessage = @"Destinations not set"; +static dispatch_once_t deprecatedDisplayOptionsWarningOnce; @implementation NavModule { GMSNavigationSession *_session; @@ -468,11 +470,14 @@ - (void)setDestinations:(NSArray *)waypoints std::optional showDestinationMarkers = displayOptionsCopy.showDestinationMarkers(); std::optional showStopSigns = displayOptionsCopy.showStopSigns(); std::optional showTrafficLights = displayOptionsCopy.showTrafficLights(); - if (showDestinationMarkers.has_value() || showStopSigns.has_value() || - showTrafficLights.has_value()) { - [strongSelf applyNavigationUISettingsShowDestinationMarkers:showDestinationMarkers - showStopSigns:showStopSigns - showTrafficLights:showTrafficLights]; + if (showDestinationMarkers.has_value()) { + [strongSelf applyNavigationUISettingsShowDestinationMarkers:showDestinationMarkers]; + } + if (showStopSigns.has_value() || showTrafficLights.has_value()) { + dispatch_once(&deprecatedDisplayOptionsWarningOnce, ^{ + RCTLogWarn(@"showStopSigns and showTrafficLights are ignored on iOS because " + "Navigation SDK 11 always shows them during navigation."); + }); } } @@ -551,20 +556,11 @@ - (void)setDestinations:(NSArray *)waypoints }); } -- (void)applyNavigationUISettingsShowDestinationMarkers:(std::optional)showDestinationMarkers - showStopSigns:(std::optional)showStopSigns - showTrafficLights:(std::optional)showTrafficLights { +- (void)applyNavigationUISettingsShowDestinationMarkers: + (std::optional)showDestinationMarkers { for (NavViewController *viewController in [[NavViewModule viewControllersRegistry] objectEnumerator]) { - if (showDestinationMarkers.has_value()) { - [viewController setShowDestinationMarkersEnabled:showDestinationMarkers.value()]; - } - if (showStopSigns.has_value()) { - [viewController setShowStopSignsEnabled:showStopSigns.value()]; - } - if (showTrafficLights.has_value()) { - [viewController setShowTrafficLightsEnabled:showTrafficLights.value()]; - } + [viewController setShowDestinationMarkersEnabled:showDestinationMarkers.value()]; } } diff --git a/ios/react-native-navigation-sdk/NavViewController.h b/ios/react-native-navigation-sdk/NavViewController.h index 33c754f4..7ec933c9 100644 --- a/ios/react-native-navigation-sdk/NavViewController.h +++ b/ios/react-native-navigation-sdk/NavViewController.h @@ -59,8 +59,6 @@ typedef void (^OnArrayResult)(NSArray *_Nullable result); - (void)setMyLocationButtonEnabled:(BOOL)isEnabled; - (void)setMyLocationEnabled:(BOOL)isEnabled; - (void)setShowDestinationMarkersEnabled:(BOOL)isEnabled; -- (void)setShowTrafficLightsEnabled:(BOOL)isEnabled; -- (void)setShowStopSignsEnabled:(BOOL)isEnabled; - (void)setRotateGesturesEnabled:(BOOL)isEnabled; - (void)setScrollGesturesEnabled:(BOOL)isEnabled; - (void)setScrollGesturesEnabledDuringRotateOrZoom:(BOOL)isEnabled; diff --git a/ios/react-native-navigation-sdk/NavViewController.mm b/ios/react-native-navigation-sdk/NavViewController.mm index 0757392d..e8a4507e 100644 --- a/ios/react-native-navigation-sdk/NavViewController.mm +++ b/ios/react-native-navigation-sdk/NavViewController.mm @@ -536,26 +536,6 @@ - (void)setShowDestinationMarkersEnabled:(BOOL)isEnabled { [_mapView.settings setShowsDestinationMarkers:isEnabled]; } -- (void)setShowTrafficLightsEnabled:(BOOL)isEnabled { - // setShowsTrafficLights: is deprecated in Google Maps SDK 10.1.0+. - // Traffic lights are shown by default. - if ([_mapView.settings respondsToSelector:@selector(setShowsTrafficLights:)]) { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - [_mapView.settings setShowsTrafficLights:isEnabled]; -#pragma clang diagnostic pop - } -} - -- (void)setShowStopSignsEnabled:(BOOL)isEnabled { - // setShowStopSignsEnabled: is deprecated in Google Maps SDK 10.1.0+. - // Stop signs are shown by default. -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - [_mapView.settings setShowsStopSigns:isEnabled]; -#pragma clang diagnostic pop -} - - (void)setMyLocationEnabled:(BOOL)isEnabled { _mapView.myLocationEnabled = isEnabled; } diff --git a/react-native-navigation-sdk.podspec b/react-native-navigation-sdk.podspec index 3b1cc381..702d287f 100644 --- a/react-native-navigation-sdk.podspec +++ b/react-native-navigation-sdk.podspec @@ -35,7 +35,20 @@ Pod::Spec.new do |s| s.public_header_files = "ios/**/*.h" s.dependency "React-Core" - s.dependency "GoogleNavigation", "10.15.0" + + unless defined?(spm_dependency) + raise Pod::Informative, <<~MESSAGE + react-native-navigation-sdk requires React Native support for Swift Package Manager dependencies. + Upgrade React Native to 0.87 or later to install GoogleNavigation through Swift Package Manager. + MESSAGE + end + + spm_dependency( + s, + url: "https://github.com/googlemaps/ios-navigation-sdk.git", + requirement: { kind: "exactVersion", version: "11.0.0" }, + products: ["GoogleNavigation"] + ) install_modules_dependencies(s) end diff --git a/src/navigation/navigation/types.ts b/src/navigation/navigation/types.ts index 06827b65..0fcc5b4b 100644 --- a/src/navigation/navigation/types.ts +++ b/src/navigation/navigation/types.ts @@ -122,22 +122,14 @@ export interface DisplayOptions { showDestinationMarkers?: boolean; /** - * @deprecated Stop signs are enabled by default and this option will be removed in a future release. - * - * Configures whether stop signs are shown during navigation. - * If true, stop signs are shown. - * - * Defaults to true. + * @deprecated Stop signs are always shown during navigation on iOS Navigation SDK 11+ and + * this option will be removed in a future release. It currently applies only to Android. */ showStopSigns?: boolean; /** - * @deprecated Traffic lights are enabled by default and this option will be removed in a future release. - * - * Configures whether traffic lights are shown during navigation. - * If true, traffic lights are shown. - * - * Defaults to true. + * @deprecated Traffic lights are always shown during navigation on iOS Navigation SDK 11+ and + * this option will be removed in a future release. It currently applies only to Android. */ showTrafficLights?: boolean; }