|
| 1 | +# scorocode-SDK-swift |
| 2 | +SDK предоставляет доступ к платформе Scorocode для построения приложений, основанных на swift. |
| 3 | +Подробности на нашем сайте: https://scorocode.ru |
| 4 | + |
| 5 | +### Установка |
| 6 | +Подключение библиотеки к проекту: |
| 7 | +1) Установить [CocoaPods](https://cocoapods.org) |
| 8 | +``` |
| 9 | +sudo gem install cocoapods |
| 10 | +``` |
| 11 | +2) Создать новый проект в xcode, например "MyProject" (Имя проекта не должно совпадать со строкой "Scorocode") |
| 12 | + |
| 13 | +3) Создать в корне проекта файл с именем "Podfile" с текстом: |
| 14 | +``` |
| 15 | +source 'https://github.com/CocoaPods/Specs.git' |
| 16 | +platform :ios, '8.0' |
| 17 | +use_frameworks! |
| 18 | +
|
| 19 | +target 'MyProject' do |
| 20 | + pod 'Scorocode' |
| 21 | +end |
| 22 | +``` |
| 23 | +4) Закрыть проект в xcode, запустить в консоли: |
| 24 | +``` |
| 25 | +pod install |
| 26 | +``` |
| 27 | +5) В папке с проектом появится файл MyProject.xcworkspace, открыть его в xcode. |
| 28 | +В AppDelegate.swift в метод didFinishLaunchingWithOptions указать значения параметров инициализации API из личного кабинета. Пример: |
| 29 | +``` |
| 30 | +//scorocode init |
| 31 | +let applicationId = "98bc4bacb5edeb727cfb8fae25f71b59" |
| 32 | +let clientId = "39169707deb69fc06145c995aa4cdefe" |
| 33 | +let accessKey = "61ad813bd71bd4f45aea53a3c996d53a" |
| 34 | +let fileKey = "351cb3d71efef69e3d6ac5657dd16c1c" |
| 35 | +let messageKey = "35d5a173e0391a283d60a6a756a44051" |
| 36 | +
|
| 37 | +SC.initWith(applicationId: applicationId, clientId: clientId, accessKey: accessKey, fileKey: fileKey, messageKey: messageKey) |
| 38 | +``` |
| 39 | + |
| 40 | +### License |
| 41 | +``` |
| 42 | +MIT License |
| 43 | +
|
| 44 | +Copyright (c) 2016 ProfIT-Ventures LLC |
| 45 | +
|
| 46 | +Permission is hereby granted, free of charge, to any person obtaining a copy |
| 47 | +of this software and associated documentation files (the "Software"), to deal |
| 48 | +in the Software without restriction, including without limitation the rights |
| 49 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 50 | +copies of the Software, and to permit persons to whom the Software is |
| 51 | +furnished to do so, subject to the following conditions: |
| 52 | +
|
| 53 | +The above copyright notice and this permission notice shall be included in all |
| 54 | +copies or substantial portions of the Software. |
| 55 | +
|
| 56 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 57 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 58 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 59 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 60 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 61 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 62 | +SOFTWARE. |
| 63 | +``` |
0 commit comments