...
Code Block | ||||
---|---|---|---|---|
| ||||
function scan() { cordova.exec(success, failure, "ScanditSDK", "scan", ["123456abcdefg", {"beep": true, "1DScanning": true, "2DScanning": true, "scanningHotspot": "0.5/0.5", "vibrate": true}]); } |
Scandit for iOS
To begin, you will need to download the Scandit SDK for iOS, as well as the Phonegap Plugin for Scandit SDK for iOS. You must first register with Scandit first. The link for this can be found here: Scandit Options
Here you are presented with 3 options. For this tutorial, the community edition will suffice. Once you select an option, you will receive instructions on registering and an email confirming your registration. From there, you will be presented with a link to download the SDKs. You will need to download both the Barcode Scanner SDK for iOS, Community version and PhoneGap Plugin for Barcode Scanner SDK for iOS
After the downloads are finished, extract the contents to a folder on your computer.
Setting up you Xcode Project
Keep in mind where you have extracted the downloaded folders, because you will need to grab and copy files from these directories into your existing project.
1. Find the main folder for your Xcode project, in this example case BarcodeScan. Inside of your SDK download (as of this writing, the default folder name of the extracted SDK download is scanditsdk-community-ios_2.2.4), locate and copy the ScanditSDK folder and then go to BarcodeScan->barcodeScan->Plugins and paste the ScanditSDK folder you copied into here.
2. Inside of your extracted* PhoneGap Plugin for Barcode Scanner SDK for iOS folder (as of this writing, default name is *scanditsdk-phonegap-plugin-iphone_1.0.8, go into CordovaDemo->CordovaDemo->Plugins, and copy the files ScanditSDKRotatingBarcodePicker.h, ScanditSDKRotatingBarcodePicker.m, ScanditSDK.h, and ScanditSDK.mm into the same Plugins folder of your XCode project that you placed ScanditSDK in.
3. Open up your Project in XCode.
4. Right click on your project and select "Add files to..."and select the ScanditSDK folder you copied into Plugins in Step 1.
5.