A React Native wrapper for the native (iOS and Android) Bringg driver SDKs (currently supporting the active customer use case)
npm install @bringg/react-native-bringg-driver-sdk --save
or
yarn add @bringg/react-native-bringg-driver-sdk
- Change minimum iOS version to 12. This should be done in the
Podfile
and on the target in the project settings inXcode
. - Add
use_frameworks!
toPodfile
. When addinguse_frameworks!
, if you are usingFlipper
you will need to either disable it or change linking to static libraries. If you can not useuse_frameworks!
in your Podfile, please see item #6 - Perform a
pod install
cd ios && pod install && cd ..
- Add capabilities and privacy usage description
- Set
BUILD_LIBRARY_FOR_DISTRIBUTION
for Pods required by the BringgDriverSDK
# All dependencies of the BringgDriverSDK needs to be built with the 'BUILD_LIBRARY_FOR_DISTRIBUTION' configuration set to 'YES'
BringgDriverSDKDependencies = [
'Socket.IO-Client-Swift',
'Starscream',
'libPhoneNumber-iOS',
'GzipSwift',
'Alamofire',
'XCGLogger',
'RealmSwift',
'ObjcExceptionBridging',
'Kingfisher',
'KeychainAccess',
'DeviceKit'
]
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if BringgDriverSDKDependencies.include? target.name
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
end
end
- (Optional) If you can not use
use_frameworks!
in your Podfile, please add the following code to your Podfile to configure all Bringg dependencies as dynamic frameworks.
pre_install do |installer|
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
installer.pod_targets.each do |pod|
if BringgDriverSDKDependencies.include?(pod.name)
def pod.build_type
Pod::BuildType.dynamic_framework
end
end
end
end
- In the
Podfile
remove the following from your target
add_flipper_pods!
post_install do |installer|
flipper_post_install(installer)
end
- Remove initialization code of
Flipper
fromAppDelegate.m
.
An example of how to keep Flipper
working with use_frameworks!
exists in /example/ios/Podfile
$static_framework = [
'FlipperKit',
'Flipper',
'Flipper-Folly',
'CocoaAsyncSocket',
'ComponentKit',
'Flipper-PeerTalk',
'Flipper-RSocket',
'YogaKit',
'CocoaLibEvent',
'openssl-ios-bitcode',
'boost-for-react-native'
]
pre_install do |installer|
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
installer.pod_targets.each do |pod|
next unless $static_framework.include?(pod.name)
def pod.build_type
Pod::BuildType.static_library
end
end
end
- Make sure to set the
minSdkVersion
to at least 21. - Make sure your app meets Google Play's target API level requirements.
The example app has a basic implementation of expected use case flows. To run it, clone the repo and then do:
yarn #prepares the sdk for the example app
cd example
yarn
# for ios
cd ios && pod install && cd ..
yarn ios
# for android
yarn android
Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) More details
A known issue with React NAtive dependecy. reference:
When you get this error:
error: Cycle in dependencies between targets 'BringgDriverSdkIosExample' and 'FBReactNativeSpec';
building could produce unreliable results.
On the example app, the solution is to go to the Pods/FBReactNativeSpec target in Xcode, and move the [CP-User] build script above the Headers.
The Native iOS SDK is precompiled - when using a swift version that is not the latest, you will need to do another step in order to use a native SDK that was compiled with the same Swift version that you are using.
In podfile add to your application target the following pods:
pod 'BringgDriverSDK', :git => 'https://github.com/bringg/Bringg-iOS-DriverSDK.git', :branch => '1.10.0-xcode-11.3.1'
pod 'BringgDriverSDKObjc', :git => 'https://github.com/bringg/Bringg-iOS-DriverSDK.git', :branch => '1.10.0-xcode-11.3.1'
You can see an example of this in /Example/ios/Podfile