Skip to content

Moddakir-App/ModdakirSDK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ModdakirSDK

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 📖

Getting Started

These instructions will help you setup, integrate and run your project integrated with our SDK.

Prerequisits

  • Xcode (version 12.0 or newer)
  • iOS (version 13.0 or newer)

Integration (SPM)

To install ModdakirSDK, follow these steps:

  1. Open your Xcode project.

  2. Go to File > Swift Packages > Add Package Dependency.

  3. Paste the following URL of this repository:

    https://github.com/Moddakir-App/ModdakirSDK
    
  4. Make sure to add ModdakirSDK Product to your target.

  5. Add Moddakir_ID and Moddakir_Key Provided by Moddakir team into info.plist

  6. Add Voice over IP Capapility to your app in order to allow CallKit Screen to manage the call


Quick Start

In order to Initialize ModdakirSDK, you're required to provide user details, and the root view controller in addition to a png image of your appIcon

Note that: we need tha png data object of app icon in order to show it in the system calling screen

import ModdakirSDK
/*
 * rest of code
 *
 */

let name = "name"
let gender: ModdakirGender = .male
let email = "moddakir@gmail.com"
guard let pngData = UIImage(named: "AppIcon").pngData() else {return}

ModdakirService.initiateCall(
      userInfo: .init(
          fullName: name,
          gender: gender,
          email: email
      ),
      rootView: self,
      appIcon: pngData
)

assign yourself as a delegate of ModdakirSDK in order to get notified when something happened

ModdakirService.delegate = self

and 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
        }
    }
}