diff --git a/RNGoogleMapsPlus.podspec b/RNGoogleMapsPlus.podspec index 7f279db..78dbf5f 100644 --- a/RNGoogleMapsPlus.podspec +++ b/RNGoogleMapsPlus.podspec @@ -13,11 +13,9 @@ Pod::Spec.new do |s| s.platforms = { :ios => 16.0 } s.source = { :git => "https://github.com/pinpong/react-native-google-maps-plus.git", :tag => "#{s.version}" } - s.source_files = "ios/**/*.{h,m,mm,swift}" - s.source_files = [ "ios/**/*.{swift}", - "ios/**/*.{m,mm}", + "ios/**/*.{h,m,mm}", "cpp/**/*.{hpp,cpp}", ] @@ -26,9 +24,36 @@ Pod::Spec.new do |s| s.dependency 'React-jsi' s.dependency 'React-callinvoker' - s.dependency 'GoogleMaps', '10.4.0' - s.dependency 'Google-Maps-iOS-Utils', '6.1.3' - s.dependency 'SVGKit', '3.0.0' + spm_dependency(s, + url: "https://github.com/googlemaps/ios-maps-sdk", + requirement: { :kind => "exactVersion", :version => "10.4.0" }, + products: ["GoogleMaps"] + ) + + spm_dependency(s, + url: "https://github.com/googlemaps/google-maps-ios-utils", + requirement: { :kind => "exactVersion", :version => "6.1.3" }, + products: ["GoogleMapsUtils"] + ) + + spm_dependency(s, + url: "https://github.com/SVGKit/SVGKit", + requirement: { :kind => "exactVersion", :version => "3.0.0" }, + products: ["SVGKit"] + ) + + Pod::UI.puts "\n" + Pod::UI.puts " ╔═══════════════════════════════════════════════════════════════════════════╗".green + Pod::UI.puts " ║ ║".green + Pod::UI.puts " ║ react-native-google-maps-plus ║".green + Pod::UI.puts " ║ ║".green + Pod::UI.puts " ║ Static framework linking is fully supported! ║".green + Pod::UI.puts " ║ ║".green + Pod::UI.puts " ║ If you see a CocoaPods warning about SPM packages with static ║".green + Pod::UI.puts " ║ linking, you can safely ignore it - it's a generic warning. ║".green + Pod::UI.puts " ║ ║".green + Pod::UI.puts " ╚═══════════════════════════════════════════════════════════════════════════╝".green + Pod::UI.puts "\n" load 'nitrogen/generated/ios/RNGoogleMapsPlus+autolinking.rb' add_nitrogen_files(s) diff --git a/example/ios/GoogleMapsPlusExample.xcworkspace/xcshareddata/swiftpm/Package.resolved b/example/ios/GoogleMapsPlusExample.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000..e165ecd --- /dev/null +++ b/example/ios/GoogleMapsPlusExample.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,51 @@ +{ + "originHash" : "5b3176553191512269fe08154b0bed67dd9c4d150590d9de300fa71d864556fc", + "pins" : [ + { + "identity" : "cocoalumberjack", + "kind" : "remoteSourceControl", + "location" : "https://github.com/CocoaLumberjack/CocoaLumberjack.git", + "state" : { + "revision" : "a9ed4b6f9bdedce7d77046f43adfb8ce1fd54114", + "version" : "3.9.0" + } + }, + { + "identity" : "google-maps-ios-utils", + "kind" : "remoteSourceControl", + "location" : "https://github.com/googlemaps/google-maps-ios-utils", + "state" : { + "revision" : "1727a5e25036cecc07296569b8ad3f85d4baca4b", + "version" : "6.1.3" + } + }, + { + "identity" : "ios-maps-sdk", + "kind" : "remoteSourceControl", + "location" : "https://github.com/googlemaps/ios-maps-sdk", + "state" : { + "revision" : "e4c8ab764c05a7e50501f8f7b35a1f8b45203da2", + "version" : "10.4.0" + } + }, + { + "identity" : "svgkit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/SVGKit/SVGKit", + "state" : { + "revision" : "58152b9f7c85eab239160b36ffdfd364aa43d666", + "version" : "3.0.0" + } + }, + { + "identity" : "swift-log", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-log", + "state" : { + "revision" : "bc386b95f2a16ccd0150a8235e7c69eab2b866ca", + "version" : "1.8.0" + } + } + ], + "version" : 3 +} diff --git a/example/ios/Podfile b/example/ios/Podfile index c126450..5f0f24f 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -28,8 +28,5 @@ target 'GoogleMapsPlusExample' do :mac_catalyst_enabled => false, # :ccache_enabled => true ) - - require_relative '../../scripts/svgkit_patch' - apply_svgkit_patch(installer) end end diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 48b4387..737f383 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -30,19 +30,11 @@ PODS: - ReactCommon/turbomodule/core - SocketRocket - Yoga - - CocoaLumberjack (3.9.0): - - CocoaLumberjack/Core (= 3.9.0) - - CocoaLumberjack/Core (3.9.0) - DoubleConversion (1.1.6) - fast_float (8.0.0) - FBLazyVector (0.82.1) - fmt (11.0.2) - glog (0.3.5) - - Google-Maps-iOS-Utils (6.1.3): - - GoogleMaps (~> 10.0) - - GoogleMaps (10.4.0): - - GoogleMaps/Maps (= 10.4.0) - - GoogleMaps/Maps (10.4.0) - hermes-engine (0.82.1): - hermes-engine/Pre-built (= 0.82.1) - hermes-engine/Pre-built (0.82.1) @@ -2504,14 +2496,12 @@ PODS: - ReactCommon/turbomodule/core - SocketRocket - Yoga - - RNGoogleMapsPlus (1.10.1): + - RNGoogleMapsPlus (1.10.2): - boost - DoubleConversion - fast_float - fmt - glog - - Google-Maps-iOS-Utils (= 6.1.3) - - GoogleMaps (= 10.4.0) - hermes-engine - NitroModules - RCT-Folly @@ -2535,7 +2525,6 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - SocketRocket - - SVGKit (= 3.0.0) - Yoga - RNReanimated (4.1.5): - boost @@ -2778,8 +2767,6 @@ PODS: - SocketRocket - Yoga - SocketRocket (0.7.1) - - SVGKit (3.0.0): - - CocoaLumberjack (~> 3.0) - Yoga (0.0.0) DEPENDENCIES: @@ -2869,11 +2856,7 @@ DEPENDENCIES: SPEC REPOS: trunk: - - CocoaLumberjack - - Google-Maps-iOS-Utils - - GoogleMaps - SocketRocket - - SVGKit EXTERNAL SOURCES: boost: @@ -3043,14 +3026,11 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: boost: 7e761d76ca2ce687f7cc98e698152abd03a18f90 Clusterer: 6b8e946e6d4593644d04acd9c1fca686e8d4f5cb - CocoaLumberjack: 5644158777912b7de7469fa881f8a3f259c2512a DoubleConversion: cb417026b2400c8f53ae97020b2be961b59470cb fast_float: b32c788ed9c6a8c584d114d0047beda9664e7cc6 FBLazyVector: 0aa6183b9afe3c31fc65b5d1eeef1f3c19b63bfa fmt: a40bb5bd0294ea969aaaba240a927bd33d878cdd glog: 5683914934d5b6e4240e497e0f4a3b42d1854183 - Google-Maps-iOS-Utils: bed22fa703c919259b3901449434d60d994fae20 - GoogleMaps: a40d3b1f511f0fa2036e7b08c920c33279b1d5fd hermes-engine: 273e30e7fb618279934b0b95ffab60ecedb7acf5 NitroModules: cf8804dafa637b6535c73fd113c3202b11307bfd RCT-Folly: 846fda9475e61ec7bcbf8a3fe81edfcaeb090669 @@ -3120,14 +3100,13 @@ SPEC CHECKSUMS: ReactCodegen: 0bce2d209e2e802589f4c5ff76d21618200e74cb ReactCommon: 801eff8cb9c940c04d3a89ce399c343ee3eff654 RNGestureHandler: 67501c6d447027581aa1d8e5a7a3ea5a7f0a89ff - RNGoogleMapsPlus: 86ba03df25878d125da670854ba6d4da6a3be09d + RNGoogleMapsPlus: b03dfe02d5c76529862b307ad8ed0af9fa96421e RNReanimated: 05c5a85c3ee54ac68d60c8a9b42dbc441e3326ca RNScreens: 98771ad898d1c0528fc8139606bbacf5a2e9d237 RNWorklets: ab618bf7d1c7fd2cb793b9f0f39c3e29274b3ebf SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748 - SVGKit: 1ad7513f8c74d9652f94ed64ddecda1a23864dea Yoga: 526f25666395d30c297d53154398ffd249eaf9e1 -PODFILE CHECKSUM: 53fea21acf44c419ecb277b368cb4c1e34124dfb +PODFILE CHECKSUM: c4bfd5273ff3a913a7734e2ea5ae40fdd7a557bb COCOAPODS: 1.15.2 diff --git a/expoConfig/src/ios/withIosGoogleMapsPlus.ts b/expoConfig/src/ios/withIosGoogleMapsPlus.ts index f99f8a2..79dc1bc 100644 --- a/expoConfig/src/ios/withIosGoogleMapsPlus.ts +++ b/expoConfig/src/ios/withIosGoogleMapsPlus.ts @@ -40,23 +40,6 @@ const withIosGoogleMapsPlus: ConfigPlugin = ( }).contents; } - const podFilePatch = ` - require_relative '../node_modules/react-native-google-maps-plus/scripts/svgkit_patch' - apply_svgkit_patch(installer) - `; - - if (src.includes('post_install do |installer|')) { - src = src.replace( - /post_install do \|installer\|([\s\S]*?)end/, - (match, inner) => { - if (inner.includes('SVGKit Patch')) return match; // idempotent - return `post_install do |installer|${inner}\n${podFilePatch}\nend`; - } - ); - } else { - src += `\npost_install do |installer|\n${podFilePatch}\nend\n`; - } - conf.modResults.contents = src; return conf; }); diff --git a/scripts/svgkit_patch.rb b/scripts/svgkit_patch.rb deleted file mode 100644 index 67a6377..0000000 --- a/scripts/svgkit_patch.rb +++ /dev/null @@ -1,41 +0,0 @@ -def apply_svgkit_patch(installer) - svgkit_path = File.join(installer.sandbox.root, "SVGKit", "Source") - return unless Dir.exist?(svgkit_path) - - package = JSON.parse(File.read(File.join(__dir__, "..", "package.json"))) - package_name = package["name"] - - puts "[#{package_name}] Applying SVGKit patch..." - - files = Dir.glob(File.join(svgkit_path, "**/*.{h,m}")) - - replacements = { - '#import "Node.h"' => '#import "SVGKit/Node.h"', - '#import "CSSValue.h"' => '#import "SVGKit/CSSValue.h"', - '#import "SVGLength.h"' => '#import "SVGKit/SVGLength.h"' - } - - count = 0 - - files.each do |file| - text = File.read(file) - new_text = text.dup - - replacements.each do |original, patched| - new_text.gsub!(original, patched) - end - - next if new_text == text - - File.write(file, new_text) - count += 1 - end - - if count > 0 - puts "[#{package_name}] SVGKit patch applied (#{count} files modified)" - else - puts "[#{package_name}] SVGKit was already patched or no matches" - end - - -end diff --git a/src/index.tsx b/src/index.tsx index d113b4b..f2024b1 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -9,23 +9,6 @@ * yarn add react-native-google-maps-plus react-native-nitro-modules * ``` * - * ## iOS Setup (Bare RN only) - * - * Add this to your Podfile: - * - * ```ruby - * post_install do |installer| - * react_native_post_install( - * installer, - * config[:reactNativePath], - * :mac_catalyst_enabled => false, - * ) - * - * require_relative '../node_modules/react-native-google-maps-plus/scripts/svgkit_patch' - * apply_svgkit_patch(installer) - * end - * ``` - * * ## Expo Setup * * Add your keys via the config plugin: