{"__v":1,"_id":"5692b5f80e58a40d00f1b6ee","category":{"__v":2,"_id":"5692b5f20e58a40d00f1b6b8","pages":["5692b5f80e58a40d00f1b6ed","5692b5f80e58a40d00f1b6ee","5692b5f80e58a40d00f1b6ef","5692b5f80e58a40d00f1b6f0","5692b5f80e58a40d00f1b6f1","5692b5f80e58a40d00f1b6f2","5692b5f80e58a40d00f1b6f3","5692b5f80e58a40d00f1b6f4","5692b5f80e58a40d00f1b6f5","5692b5f80e58a40d00f1b6f6","5692b5f80e58a40d00f1b6f7","5692b5f80e58a40d00f1b6f8","56ddeac11f41212900450142"],"project":"5538be9dfd56310d00b173d0","version":"5692b5f00e58a40d00f1b6b5","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-01-04T10:01:51.119Z","from_sync":false,"order":2,"slug":"ios","title":"iOS Guide"},"parentDoc":null,"project":"5538be9dfd56310d00b173d0","user":"5538be74fd56310d00b173cf","version":{"__v":7,"_id":"5692b5f00e58a40d00f1b6b5","project":"5538be9dfd56310d00b173d0","createdAt":"2016-01-10T19:50:08.651Z","releaseDate":"2016-01-10T19:50:08.651Z","categories":["5692b5f20e58a40d00f1b6b6","5692b5f20e58a40d00f1b6b7","5692b5f20e58a40d00f1b6b8","5692b5f20e58a40d00f1b6b9","5692b5f20e58a40d00f1b6ba","5692b5f20e58a40d00f1b6bb","5692b5f20e58a40d00f1b6bc","5692c21b6ebadc0d005b716c","5692c2386ebadc0d005b716e","5692c245b716520d0067bbb6","5692c251b716520d0067bbb7","5692c370b716520d0067bbbd","56e763e15669091700c5b2be"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"0.4.0","version":"0.4"},"updates":[],"createdAt":"2015-12-15T10:11:53.896Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"## Installing with CocoaPods\n\nThe easiest way to install Tapglue into your iOS project is to use [CocoaPods](http://cocoapods.org/).\n\n1. Install CocoaPods with `gem install cocoapods`\n2. Run `pod setup` to create a local CocoaPods spec mirror, if this is the first time using CocoaPods.\n3. Create a `Podfile` in your Xcode project and add:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"pod 'Tapglue'\",\n      \"language\": \"text\",\n      \"name\": \"Podfile\"\n    }\n  ]\n}\n[/block]\n4. Run `pod install` in your project directory and Tapglue will be downloaded and installed.\n5. Restart your Xcode project\n\n## Manual Installation\n\nIf you don't want to use CocoaPods you download the latest version of [Tapglue from Github](https://github.com/tapglue/ios_sdk/releases) and copy it into your project.\n\n1. Clone the SDK with `git clone https://github.com/tapglue/ios_sdk.git`\n2. Copy the SDK into your Xcode project's folder\n3. Import all dependencies\n4. Integrate `<Tapglue/Tapglue.h>` into your files\n\n## Initialise the library\n\nTo start using Tapglue, you must initialise our SDK with your app token first. You can find your app token in the [Tapglue dashboard](https://dashboard.tapglue.com).\n\nTo initialise the library, import `Tapglue.h` and in your AppDelegate’s -`application:didFinishLaunchingWithOptions:` call `setUpWithAppToken:` with your app token as its argument.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"#import <Tapglue/Tapglue.h>\\n\\n#define tapglueToken :::at:::\\\"[[app:key]]\\\"\\n\\n// Initialise the SDK with your app token\\n[Tapglue setUpWithAppToken:tapglueToken];\",\n      \"language\": \"objectivec\"\n    },\n    {\n      \"code\": \"import Tapglue\\n  \\nlet tapglueToken = \\\"[[app:key]]\\\"\\n\\n// Initialise the SDK with your app token\\nTapglue.setUpWithAppToken(tapglueToken)\",\n      \"language\": \"objectivec\",\n      \"name\": \"Swift\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Bridging header\",\n  \"body\": \"Our SDK is fully compatible with Swift. If you are using Swift, create a `Objective-C-Bridging-Header.h` file and add `#import <Tapglue/Tapglue.h>` to it. You can learn more about bridging headers on [Apples official documentation](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html).\\n\\nYou don't need a bridging header if you enable `use_frameworks!` in your Podfile.\"\n}\n[/block]\n## SDK Configuration\n\nIf you want to initialise SDK with a custom configuration you can specify following attributes:\n\n- `apiBaseUrl`\n- `loggingEnabled`\n- `flushInterval (in seconds)`\n- `showNetworkActivityIndicator`\n- `analyticsEnabled`\n\nSimply call `setUpWithAppToken: andConfig:` and define a config like in the following:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"#import <Tapglue/Tapglue.h>`\\n\\n#define tapglueToken @\\\"[[app:key]]\\\"\\n\\n// Create config object\\nTGConfiguration *customConfig = [TGConfiguration defaultConfiguration];\\n    \\n// Configure custom settings\\ncustomConfig.loggingEnabled = true;\\n    \\n// Initialize the SDK with app token and config\\n[Tapglue setUpWithAppToken:tapglueToken andConfig:customConfig];\",\n      \"language\": \"objectivec\"\n    },\n    {\n      \"code\": \"import Tapglue\\n  \\nlet tapglueToken = \\\"[[app:key]]\\\"\\n\\n// Create config object\\nlet customConfig = TGConfiguration.defaultConfiguration()\\n\\n// Configure custom settings\\ncustomConfig.loggingEnabled = true\\n\\n// Initialise the SDK with your app token and config\\nTapglue.setUpWithAppToken(tapglueToken, andConfig: customConfig)\",\n      \"language\": \"objectivec\",\n      \"name\": \"Swift\"\n    }\n  ]\n}\n[/block]\nIn most cases, it makes sense to do this in `application:didFinishLaunchingWithOptions:`.\n\n## Compatibility\n\nVersions of Tapglue greater than 0.1.0 will work for a deployment target of iOS 7.0 and above. You need to be using Xcode 5 and a Base SDK of iOS 7.0 for your app to build.","excerpt":"This page provides instructions to install the iOS SDK.","slug":"installation-ios","type":"basic","title":"Installation"}

Installation

This page provides instructions to install the iOS SDK.

## Installing with CocoaPods The easiest way to install Tapglue into your iOS project is to use [CocoaPods](http://cocoapods.org/). 1. Install CocoaPods with `gem install cocoapods` 2. Run `pod setup` to create a local CocoaPods spec mirror, if this is the first time using CocoaPods. 3. Create a `Podfile` in your Xcode project and add: [block:code] { "codes": [ { "code": "pod 'Tapglue'", "language": "text", "name": "Podfile" } ] } [/block] 4. Run `pod install` in your project directory and Tapglue will be downloaded and installed. 5. Restart your Xcode project ## Manual Installation If you don't want to use CocoaPods you download the latest version of [Tapglue from Github](https://github.com/tapglue/ios_sdk/releases) and copy it into your project. 1. Clone the SDK with `git clone https://github.com/tapglue/ios_sdk.git` 2. Copy the SDK into your Xcode project's folder 3. Import all dependencies 4. Integrate `<Tapglue/Tapglue.h>` into your files ## Initialise the library To start using Tapglue, you must initialise our SDK with your app token first. You can find your app token in the [Tapglue dashboard](https://dashboard.tapglue.com). To initialise the library, import `Tapglue.h` and in your AppDelegate’s -`application:didFinishLaunchingWithOptions:` call `setUpWithAppToken:` with your app token as its argument. [block:code] { "codes": [ { "code": "#import <Tapglue/Tapglue.h>\n\n#define tapglueToken @\"[[app:key]]\"\n\n// Initialise the SDK with your app token\n[Tapglue setUpWithAppToken:tapglueToken];", "language": "objectivec" }, { "code": "import Tapglue\n \nlet tapglueToken = \"[[app:key]]\"\n\n// Initialise the SDK with your app token\nTapglue.setUpWithAppToken(tapglueToken)", "language": "objectivec", "name": "Swift" } ] } [/block] [block:callout] { "type": "info", "title": "Bridging header", "body": "Our SDK is fully compatible with Swift. If you are using Swift, create a `Objective-C-Bridging-Header.h` file and add `#import <Tapglue/Tapglue.h>` to it. You can learn more about bridging headers on [Apples official documentation](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html).\n\nYou don't need a bridging header if you enable `use_frameworks!` in your Podfile." } [/block] ## SDK Configuration If you want to initialise SDK with a custom configuration you can specify following attributes: - `apiBaseUrl` - `loggingEnabled` - `flushInterval (in seconds)` - `showNetworkActivityIndicator` - `analyticsEnabled` Simply call `setUpWithAppToken: andConfig:` and define a config like in the following: [block:code] { "codes": [ { "code": "#import <Tapglue/Tapglue.h>`\n\n#define tapglueToken @\"[[app:key]]\"\n\n// Create config object\nTGConfiguration *customConfig = [TGConfiguration defaultConfiguration];\n \n// Configure custom settings\ncustomConfig.loggingEnabled = true;\n \n// Initialize the SDK with app token and config\n[Tapglue setUpWithAppToken:tapglueToken andConfig:customConfig];", "language": "objectivec" }, { "code": "import Tapglue\n \nlet tapglueToken = \"[[app:key]]\"\n\n// Create config object\nlet customConfig = TGConfiguration.defaultConfiguration()\n\n// Configure custom settings\ncustomConfig.loggingEnabled = true\n\n// Initialise the SDK with your app token and config\nTapglue.setUpWithAppToken(tapglueToken, andConfig: customConfig)", "language": "objectivec", "name": "Swift" } ] } [/block] In most cases, it makes sense to do this in `application:didFinishLaunchingWithOptions:`. ## Compatibility Versions of Tapglue greater than 0.1.0 will work for a deployment target of iOS 7.0 and above. You need to be using Xcode 5 and a Base SDK of iOS 7.0 for your app to build.