CocoaPods wrapper for Google's Nearby Connections library, providing peer-to-peer connectivity for iOS applications.
π Features:
- β
Dynamic dependency download (like
node_modules
) - β Modular subspecs (AbseilCpp, Core, Swift, Full)
- β Works with normal pod installation AND modular headers
- β
React Native Expo compatible (no
use_modular_headers!
required) - β iOS 13.0+ and macOS 10.15+ support
- β Small git repository (~1MB vs 79MB)
# Simple installation - works for most projects
pod 'GoogleNearbyPod',
:git => 'https://github.com/puguhsudarma/google-nearby-pod.git',
:tag => '1.0.2'
# For Expo or projects with header conflicts
pod 'GoogleNearbyPod',
:git => 'https://github.com/puguhsudarma/google-nearby-pod.git',
:tag => '1.0.2',
:modular_headers => true
require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods")
platform :ios, '13.0'
install! 'cocoapods', :deterministic_uuids => false
target 'YourExpoApp' do
use_expo_modules!
config = use_native_modules!
use_react_native!(
:path => config[:reactNativePath],
:hermes_enabled => false,
:fabric_enabled => false,
:flipper_configuration => FlipperConfiguration.disabled,
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
# π GoogleNearbyPod with targeted modular headers
pod 'GoogleNearbyPod',
:git => 'https://github.com/puguhsudarma/google-nearby-pod.git',
:tag => '1.0.2',
:modular_headers => true
post_install do |installer|
react_native_post_install(
installer,
config[:reactNativePath],
:mac_catalyst_enabled => false
)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
end
end
end
end
- Small Repository: Only ~1MB in git (no large dependencies committed)
- Automatic Download: Dependencies downloaded during
pod install
(likenode_modules
) - Always Fresh: Gets latest Google Nearby source code
- Modular: Choose only the components you need
- Flexible Installation: Works with both normal and modular header approaches
import GoogleNearbyPod
let connectionManager = ConnectionManager(
serviceID: "your.app.service",
strategy: .pointToPoint
)
Installation Method | Use Case | Pros | Cons |
---|---|---|---|
Normal | Most iOS/RN projects | β
Simple β Fast setup β No extra config |
β May conflict in complex projects |
Modular Headers | Expo/Complex projects | β
No conflicts β Expo compatible β Clean modules |
β Slightly more setup |
GoogleNearbyPod/Full
(default) - Complete packageGoogleNearbyPod/Swift
- Swift API onlyGoogleNearbyPod/Core
- Core C++ implementationGoogleNearbyPod/AbseilCpp
- Abseil C++ utilities only
Issue: "Module not found" or header conflicts
# Clean and reinstall
rm -rf ios/Pods ios/Podfile.lock
cd ios && pod install --verbose
Issue: Regular installation has conflicts
- β Try the modular headers approach instead
- β Make sure you're using iOS 13.0+ deployment target
Issue: Expo build fails
- β
Make sure you're using
:modular_headers => true
(not globaluse_modular_headers!
) - β
Include
pod 'BoringSSL-GRPC', :modular_headers => true
- β Verify deployment target is iOS 13.0+
Run comprehensive tests:
chmod +x test-all.sh
./test-all.sh
This tests:
- β Podspec validation
- β Native iOS installation
- β Expo React Native installation
- β Dynamic dependencies download
git add .
git commit -m "feat: Ready for production deployment"
git push origin master
git tag 1.0.0
git push origin 1.0.0
# Test in a new project
pod 'GoogleNearbyPod',
:git => 'https://github.com/puguhsudarma/google-nearby-pod.git',
:tag => '1.0.0'
Native iOS Installation:
β
Pod install completed successfully
β
GoogleNearbyPod pod directory created
β
Dynamic dependencies downloaded successfully
β
ConnectionManager created successfully!
Expo Installation:
β
GoogleNearbyPod with modular headers found in Podfile
β
Pod install completed successfully!
β
No conflicts with other Expo modules
β
Xcode workspace created successfully
Are you using Expo React Native?
βββ Yes β Use Modular Headers
β βββ pod 'GoogleNearbyPod', :modular_headers => true
βββ No β Are you having header conflicts?
βββ Yes β Use Modular Headers
β βββ pod 'GoogleNearbyPod', :modular_headers => true
βββ No β Use Normal Installation
βββ pod 'GoogleNearbyPod'
Based on Google Nearby commit: 0c0a59d8a1c5114c1101a1b00d88591330dd5cde
To update dependencies manually:
./scripts/update-upstream-fast.sh
Apache 2.0 - Based on Google's Nearby Connections