Framework as a Swift package for Integrating with Moddakir Services, it connects you Directly with on of our distinct teachers in order to share the learning of the Holy Qur’an 📖
These instructions will help you setup, integrate and run your project integrated with our SDK.
Xcode (version 12.0 or newer)iOS (version 13.0 or newer)
To install ModdakirSDK, follow these steps:
-
Open your Xcode project.
-
Go to File > Swift Packages > Add Package Dependency.
-
Paste the following URL of this repository:
https://github.com/Moddakir-App/ModdakirSDK
-
Make sure to add ModdakirSDK Product to your target.
-
Add Moddakir_ID and Moddakir_Key Provided by Moddakir team into info.plist
-
Add Voice over IP Capapility to your app in order to allow CallKit Screen to manage the call
In order to Initialize ModdakirSDK, you're required to provide user details, and the root view controller in addition to themeMode and primaryColor
import ModdakirSDK
/*
* rest of code
*
*/
let name = "name"
let gender: ModdakirGender = .male
let email = "moddakir@gmail.com"
let color = UIColor.red
let themeMode: ModdakirThemeManager.ThemeMode = .dark
ModdakirService.initiateCall(
userInfo: .init(
fullName: name,
gender: gender,
email: email
),
rootView: self,
primaryColor: color,
themeMode: themeMode
)assign yourself as a delegate of ModdakirSDK in order to get notified when something happened
ModdakirService.delegate = selfand then conform to the delegate
extension YourClass: ModdakirServiceDelegate {
func failedToInitiateCall(withError error: String, andType type: ModdakirService.InitiateCallError) {
switch type {
case .noInternet:
do_something
case .notValidEmail:
do_something
case .emptyName:
do_something
case .unauthorized:
check_info.plist
}
}
}