Built for SoS, 911 and WalkSafe events for Safety Kuvrr
App.
SafetyKuvrrKit
is integrated in the SafetyKuvrrExample demo. You can download the iOS demo from our open-source repository on Github.
The source code of the demo does not involve SDKs and SafetyKuvrrKit
. You can directly import them or install them using CocoaPods.
Install CocoaPods if you have not. For details, see Getting Started with CocoaPods.
If you use CocoaPods for installation, first navigate to the directory where podfile
resides and run the following command in the Terminal:
pod install
After the required SDKs and SafetyKuvrrKit
are installed, open the workspace SafetyKuvrrExample.xcworkspace
on Xcode and connect to the mobile phone to run the demo.
Before proceeding, ensure that your development environment meets the following requirements:
- A device running iOS 13.0 or above.
- SafetyKuvrrKit is integrated to provide basic functions like login, SoS, 911, and WalkSafe.
- An SafetKuvrr app is created.
Follow these steps to integrate SafetyKuvrrKit
:
- The user calls the API to initialize
SafetyKuvrrKit
. - The caller calls the API to get device details.
- The caller calls the API to initiate 911.
SafetyKuvrrKit
depends on the Alamofire
, INTULocationManager
, DeviceGuru
, and PermissionKit
libraries. Therefore, you also need to import these libraries to the project, for example by using CocoaPods.
As SafetyKuvrrKit
is a dynamic library, you must add use_frameworks! to podfile
.
SafetyKuvrrKit
can be imported manually or using CocoaPods.
In the Terminal, navigate to the root directory of the project and run the pod init
command to generate the Podfile
file in the project folder.
Open the Podfile
file and modify the file content as follows. Remember to replace AppName
with your own app name.
use_frameworks!
target 'AppName' do
pod 'SafetyKuvrrKit'
end
In the Terminal, run the pod update
command to update the version of the local SafetyKuvrrKit
.
Run the pod install
command to install SafetyKuvrrKit
. If the installation succeeds, the message Pod installation complete!
is displayed in the Terminal. Then the xcworkspace
file is generated in the project folder.
- Copy
SafetyKuvrrKit.framework
downloaded when you run through the demo, to the project folder. - On Xcode, choose Project Settings > General, drag
SafetyKuvrrKit.framework
to the project, and setSafetyKuvrrKit.framework
toEmbed & Sign
underFrameworks, Libraries, and Embedded Content
.
The app requires permissions of location. In the info.plist
file, click +
to add the following information:
Key | Type | Value |
---|---|---|
Privacy - Location Always and When in use usage description | String | The description, like "SafetyKuvrrKit needs to use your location." |
Privacy - Camera Usage Description | String | The description, like "SafetyKuvrrKit needs to use your Camera." |
Privacy - Microphone Usage Description | String | The description, like "SafetyKuvrrKit needs to use your Microphone." |
Privacy - Bluetooth Always Usage Description | String | The description, like "SafetyKuvrrKit needs to use your Bluetooth." |
If you hope to run SafetyKuvrrKit
in the background, you also need to add the permission to get location in the background:
- Click
+
to addRequired background modes
toinfo.plist
, withType
set asArray
. - Add the
Location Updates
element underArray
.
If you install from CocoaPods, you have to import the module. If you used drag and drop then there is no need of import
import SafetyKuvrrKit
Initialize it in your AppDelegate file:
SafetyKit.initialize()
For 911:
SafetyKit.raise911()
For SoS:
SafetyKit.raiseSOS()
For ERPs:
SafetyKit.getERPList()
For Maps:
SafetyKit.getMapList()
For Kuvrr Panic Buttons:
SafetyKit.getKuvrrPanicButtonList()
Checkout Example Project
!