{"id":28544228,"url":"https://github.com/bitly/bitly_ios_sdk_release","last_synced_at":"2026-02-15T16:04:45.727Z","repository":{"id":137883638,"uuid":"69371582","full_name":"bitly/bitly_ios_sdk_release","owner":"bitly","description":"Bitly SDK for iOS","archived":false,"fork":false,"pushed_at":"2022-09-27T23:32:44.000Z","size":15216,"stargazers_count":8,"open_issues_count":6,"forks_count":4,"subscribers_count":16,"default_branch":"master","last_synced_at":"2026-02-11T02:06:52.372Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2016-09-27T15:32:31.000Z","updated_at":"2024-07-31T15:30:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"f0dedf02-1b64-4c0c-9f19-bb56fbfc16bb","html_url":"https://github.com/bitly/bitly_ios_sdk_release","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/bitly/bitly_ios_sdk_release","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitly%2Fbitly_ios_sdk_release","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitly%2Fbitly_ios_sdk_release/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitly%2Fbitly_ios_sdk_release/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitly%2Fbitly_ios_sdk_release/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitly","download_url":"https://codeload.github.com/bitly/bitly_ios_sdk_release/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitly%2Fbitly_ios_sdk_release/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29483347,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T15:33:17.885Z","status":"ssl_error","status_checked_at":"2026-02-15T15:32:53.698Z","response_time":118,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-09T22:07:05.480Z","updated_at":"2026-02-15T16:04:45.721Z","avatar_url":"https://github.com/bitly.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bitly iOS SDK\n\n![Supported Platforms](https://img.shields.io/cocoapods/p/BitlySDK.svg) ![Releases](https://img.shields.io/github/release/bitly/bitly_ios_sdk_release.svg) [![Latest pod release](https://img.shields.io/cocoapods/v/BitlySDK.svg)](http://cocoapods.org/pods/BitlySDK) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Build Status](https://travis-ci.com/bitly/bitly_ios_sdk.svg?token=GQk2M5gzMUKUJCESKF18\u0026branch=master)](https://travis-ci.com/bitly/bitly_ios_sdk) [![Coverage Status](https://coveralls.io/repos/github/bitly/bitly_ios_sdk/badge.svg?t=xurvl2)](https://coveralls.io/github/bitly/bitly_ios_sdk)\n\n## Getting Started\nBefore integrating the SDK you will need to configure your mobile app in Bitly. To do this go to Brand Manager -\u003e Mobile Apps. When creating the iOS app you will need to provide your Apple ID. The Apple ID is your team ID and bundle ID joined with a period (ex - 1A234H7ABC.com.yourdomain.YourApp).  In the Apple’s Developer Portal your team ID appears on Organization Profile \u003e Account Summary.  When you enter the Member Center on http://developer.apple.com, click you name on the top right and click on “View Account” and you will find your team ID under the Developer Account Summary. If you choose to implement a Custom Scheme you may enter it at app creation time as well.\n\nOnce the app is created the app ID required later will be available on the app detail panel.  Copy it for later in the setup.\n\nTo create the Apple Site Association File, which would be located at https://yourdomain.com/.well-known/apple-app-site-association, you must got to Branded Short Domains -\u003e yourdomain.com -\u003e Mobile Behavior and associate the newly created iOS App with your domain. After saving the changes you can validate the file exists.\n\n## Install the SDK\n\n### CocoaPods\n1. Add the following to your Podfile\n\n  ```\n  pod 'BitlySDK'\n  ```\n2. Run the following to download and install the SDK\n\n  ```\n  pod install\n  ```\n\n### Carthage\n1. Add the following to your Cartfile\n\n  ```\n  github \"bitly/bitly_ios_sdk_release\"\n  ```\n2. Run the following to download and build the framework\n\n  ```\n  carthage update\n  ```\n3. Drag the built `BitlySDK.framework` into your Xcode project\n\n## Configure the Universal Links\n1. In Xcode open your project file\n2. Go to the Capabilities tab\n3. Ensure that Associated Domains is enabled and expand it\n4. Click on the + button and add your domain as `applinks:yourdomain.com`\n5. Ensure that the yourprojectname.entitlements file is added to the appropriate build target\n\n## Configure the Custom Scheme\n1. In Xcode open your Info.plist\n2. Add a row for \"URL types\" as an array\n3. Add an entry to that array as \"URL Schemes\" also as an array\n4. Add a row with your custom scheme as the value\n\n  \u003e Custom Schemes are the older way of handling deep linking. However having an app that supports both Universal Links and Custom Schemes allows Bitly to work with Facebook App Links, Facebook Ads and other apps that launch content utilizing Custom Scheme deep links.\n\n## Configure the SDK for Deep Links\n1. Import the SDK in your AppDelegate\n\n  **Swift**\n  ```swift\n  import BitlySDK\n  ```\n\n  **Objective-C**\n  ```objective-c\n  #import \u003cBitlySDK/BitlySDK.h\u003e\n  ```\n2. Initialize the SDK on application initialization\n\n  **Swift**\n  ```swift\n  func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -\u003e Bool {\n      Bitly.initialize(\"YOUR_APP_ID\", supportedDomains:[\"yourdomain.com\",\"yourotherdomain.com\"], supportedSchemes:[\"yourscheme\"]) { response, error in\n          // response provides a BitlyResponse object which contains the full URL information\n          // response includes a status code\n          // error provides any errors in retrieving information about the URL\n          // Your custom logic goes here...\n      }\n      return true\n  }\n  ```\n\n  **Objective-C**\n  ```objective-c\n  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {\n      [Bitly initialize:@\"YOUR_APP_ID\" supportedDomains:[NSArray arrayWithObjects: @\"yourdomain.com\", @\"yourotherdomain.com\", nil] supportedDomains:[NSArray arrayWithObjects: @\"yourscheme\", nil] handler:^(BitlyResponse * response, NSString * error) {\n          // response provides a BitlyResponse object which contains the full URL information\n          // response includes a status code\n          // error provides any errors in retrieving information about the URL\n          // Your custom logic goes here...\n      }];\n      return YES;\n  }\n  ```\n\n  \u003e By default the Bitly SDK utilizes the IDFV to identify the user. If you which to use the IDFA to track the user simply provide the `deviceId` to the appropriate method when initializing the SDK.\n  \u003e You can also provide the access token for shortening with the `accessToken` provided to the initializing methods.\n\n3. Handle incoming links\n\n  **Swift**\n  ```swift    \n  func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -\u003e Void) -\u003e Bool {\n      return Bitly.handle(userActivity)\n  }\n\n  func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -\u003e Bool {\n      return Bitly.handleOpen(url)\n  }\n  ```\n\n  **Objective-C**\n  ```objective-c\n  - (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void(^)(NSArray *restorableObjects))restorationHandler {\n      return [Bitly handleUserActivity:userActivity];\n  }\n\n  - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary\u003cUIApplicationOpenURLOptionsKey, id\u003e *)options {\n      return [Bitly handleOpenUrl:url];\n  }\n  ```\n\n4. Retry on error\n\n  **Swift**\n  ```swift    \n  Bitly.retryError(error)\n  ```\n\n  **Objective-C**\n  ```objective-c\n  [Bitly retryError:error];\n  ```\n\n  \u003eIf there are any issues in handling a Universal Link the operation can be retried using the following line of code in your response handler from step 2\n\n## Configure the SDK for Shortening\n\n1. Configure an OAUTH token for your app http://bitly.com/a/oauth_apps\n2. Import the SDK in your AppDelegate\n\n  **Swift**\n  ```swift\n  import BitlySDK\n  ```\n\n  **Objective-C**\n  ```objective-c\n  #import \u003cBitlySDK/BitlySDK.h\u003e\n  ```\n\n3. Initialize the SDK on application initialization\n\n  **Swift**\n  ```swift\n  func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -\u003e Bool {\n      Bitly.initialize(\"YOUR_APP_ACCESS_TOKEN\")\n      return true\n  }\n  ```\n\n  **Objective-C**\n  ```objective-c\n  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {\n      [Bitly initialize:@\"YOUR_APP_ACCESS_TOKEN\"];\n      return YES;\n  }\n  ```    \n\n    \u003e You can combine this initialization with the App Link initialization\n\n5. You can shorten from anywhere in your application\n\n  **Swift**\n  ```swift\n    Bitly.shorten(\"http://theurlyouwishtoshorten.com\") { response, error in\n        // response provides a BitlyResponse object which contains the shortened Bitlink\n        // response includes a status code\n        // error provides any errors in retrieving information about the URL\n        // Your custom logic goes here...\n    }\n  ```\n\n  **Objective-C**\n  ```objective-c\n    [Bitly shorten:@\"http://theurlyouwishtoshorten.com\" handler:^(BitlyResponse * response, NSString * error) {\n        // response provides a BitlyResponse object which contains the shortened Bitlink\n        // response includes a status code\n        // error provides any errors in retrieving information about the URL\n        // Your custom logic goes here...\n    }];\n  ```    \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitly%2Fbitly_ios_sdk_release","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitly%2Fbitly_ios_sdk_release","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitly%2Fbitly_ios_sdk_release/lists"}