Integrate high level sdk
Integration with pod
We have configured the XCframework with pod. You can install the sdk by adding the pod dependency to your project. If you have not configures the pod dependency then please follow the below steps to add the pod depenency -
- Open the terminal
- Command on the terminal: sudo gem install cocoapods
- Set your project path in the terminal.
- Command: pod init
- Go to the pod file of your project and add the pod which you want to install
- Added in the pod file: pod 'RWRiderSDK'
- Command: Pod install
- Close the Xcode project
- open your project from the terminal
- Command: open
.xcworkspace
If You have already added the pod depencency to you project then please skip the above 5 steps and follow after 5th step.
Please find the below pod details -
pod 'RWRiderSDK'
Github repo -
How to use in Swift
How to use in Objective C
If you feel any issue while using the installed pod file in client app then please run the below script at the end of your pod file -
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
end
Launch the sdk
We just need to call the single method to launch the sdk. Please make sure this should called after steup.
Please find the below snippet code to launch the sdk from window scene //eg.let window = UIWindow(windowScene: windowScene)
let wrapper = RWRiderWrapper.sharedInstance
window.rootViewController = wrapper.root(delegate: self)
self.window = window
window.makeKeyAndVisible()
let wrapper = RWRiderWrapper.sharedInstance
self.present(wrapper.root(delegate: self), animated: true, completion: nil)
Exapmle code for intializing and launching the sdk
let config = RWRiderConfig(clientCode: <sdkKey>)
config.showCampaign()
config.showPromocode()
config.showDriverRegistration()
config.setRegistrationMethod(method: .PasswordWithOTP)
RWRiderWrapper.setup(config)
let wrapper = RWRiderWrapper.sharedInstance
wrapper.registerForPushNotification(delegate: self)
self.present(wrapper.root(delegate: self), animated: true, completion: nil)