{"id":20119626,"url":"https://github.com/box/box-ios-preview-sdk","last_synced_at":"2025-08-23T14:11:38.241Z","repository":{"id":38290912,"uuid":"39280601","full_name":"box/box-ios-preview-sdk","owner":"box","description":"Box iOS Preview SDK","archived":false,"fork":false,"pushed_at":"2024-06-22T21:22:36.000Z","size":661859,"stargazers_count":18,"open_issues_count":5,"forks_count":13,"subscribers_count":60,"default_branch":"main","last_synced_at":"2024-12-16T16:06:16.626Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/box.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2015-07-18T00:10:58.000Z","updated_at":"2024-10-10T17:17:55.000Z","dependencies_parsed_at":"2024-11-13T19:16:25.658Z","dependency_job_id":"e94a6fc9-8ad6-49d8-aeec-9057af286327","html_url":"https://github.com/box/box-ios-preview-sdk","commit_stats":{"total_commits":158,"total_committers":19,"mean_commits":8.31578947368421,"dds":0.759493670886076,"last_synced_commit":"6de88e0aedd9bd09f804d9193cd1a89179b4c3fa"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/box%2Fbox-ios-preview-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/box%2Fbox-ios-preview-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/box%2Fbox-ios-preview-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/box%2Fbox-ios-preview-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/box","download_url":"https://codeload.github.com/box/box-ios-preview-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230561014,"owners_count":18245324,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-11-13T19:16:21.800Z","updated_at":"2024-12-20T09:07:19.406Z","avatar_url":"https://github.com/box.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Box Preview SDK\n\n[![Platforms](https://img.shields.io/cocoapods/p/BoxPreviewSDK.svg)](https://cocoapods.org/pods/BoxPreviewSDK)\n[![License](https://img.shields.io/cocoapods/l/BoxPreviewSDK.svg)](https://raw.githubusercontent.com/box/box-ios-preview-sdk/main/LICENSE)\n\n[![Swift Package Manager](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![CocoaPods compatible](https://img.shields.io/cocoapods/v/BoxPreviewSDK.svg)](https://cocoapods.org/pods/BoxPreviewSDK)\n\n[![Build Status](https://travis-ci.com/box/box-swift-preview-sdk.svg?token=4tREKKzQDqwgYX8vMDUk\u0026branch=main)](https://travis-ci.com/box/box-swift-preview-sdk)\n\nThis SDK makes it easy to present Box files in your iOS application.\n\n\u003e **_NOTE:_**  The Box iOS Preview SDK in **Objective-C** (prior to v3.0.0) has been moved from the main branch to the [objective-c-maintenance branch](https://github.com/box/box-ios-preview-sdk/tree/objective-c-maintenance).\nGoing forward, the main branch will contain the iOS Preview SDK in **Swift**, starting with v3.0.0.\n\n\n\n\n## Table of Contents\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n\n- [Requirements](#requirements)\n- [Installing the SDK](#installing-the-sdk)\n  - [Carthage](#carthage)\n  - [CocoaPods](#cocoapods)\n  - [Swift Package Manager](#swift-package-manager)\n- [Getting Started](#getting-started)\n- [Sample Apps](#sample-apps)\n  - [OAuth2 Sample App](#oauth2-sample-app)\n  - [CCG Auth Sample App](#ccg-auth-sample-app)\n- [Open a PDF File](#open-a-pdf-file)\n- [Open an Image File](#open-an-image-file)\n- [Future Enhancements](#future-enhancements)\n- [Versions](#versions)\n  - [Supported Version](#supported-version)\n  - [Version schedule](#version-schedule)\n- [Copyright and License](#copyright-and-license)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\nRequirements\n------------------\n\n- iOS 11.0+\n- Xcode 10.0+\n\nInstalling the SDK\n------------------\n\n### Carthage\n\n__Step 1__: Add to your `Cartfile`\n\n```ogdl\ngit \"https://github.com/box/box-ios-sdk.git\" ~\u003e 5.0\ngit \"https://github.com/box/box-ios-preview-sdk.git\" ~\u003e 3.0\n```\n\n__Step 2__: Update dependencies\n```shell\n$ carthage update --use-xcframeworks --platform iOS\n```\n\n__Step 3__: The xcframework in the Carthage/Build folder is already referenced in the BoxPreviewSDKSampleApp Xcode project.\n\nFor more detailed instructions, please see the [official documentation for Carthage](https://github.com/Carthage/Carthage#if-youre-building-for-ios-tvos-or-watchos).\n\n### CocoaPods\n\n__Step 1__: Add to your `Podfile`\n\n```\npod 'BoxPreviewSDK', '~\u003e 3.0'\n```\n\n__Step 2__: Install pod by running the following command in the directory with the `Podfile`\n\n```\n$ pod install\n```\n\nFor more detailed instructions, please see the [official documentation for Cocoapods](https://guides.cocoapods.org/using/using-cocoapods.html).\n\n### Swift Package Manager\n\n#### Importing BoxPreviewSDK into Project\n\n__Step 1__: Click on Xcode project file\n\n__Step 2__: Click on Swift Packages and click on the plus to add a package\n\n__Step 3__: Enter the following repository url `https://github.com/box/box-ios-preview-sdk.git` and click next\n\n__Step 4__: Leave the default settings to get the most recent release and click next to finish importing\n\nThe process should look like below:\n\n![Import Package](docs/usage/import-sdk-spm.gif)\n\n\n\n#### Adding BoxPreviewSDK as a Dependency\n\nFor detailed instructions, please see the [official documentation for SPM](https://swift.org/package-manager/). \n\nGetting Started\n---------------\n\nTo get started with the SDK, you'll need the Client ID and Client Secret of your app in the [Box Developer Console][dev-console].\nIf you're familar with [Getting Started with the OAuth2 Sample App in the Box Content SDK](https://github.com/box/box-ios-sdk/docs/usage/getting-started.md#oauth2-sample-app)\nyou'll find the process very similar.\n\n[dev-console]: https://app.box.com/developers/console\n\nSample Apps\n-----------\n### OAuth2 Sample App\n\nA sample app using OAuth2 Authentication can be found in the repository [here][oauth2-sample-app].  This app demonstrates how to use the\nBox Preview SDK to make calls with OAuth2 Authentication, and can be run directly by entering your own credentials to\nlog in.\n\n[oauth2-sample-app]: https://github.com/box/box-ios-preview-sdk/tree/main/SampleApps/OAuth2SampleApp\n\nTo execute the sample app:\n\n__Step 1__: Run carthage\n```shell\n$ cd SampleApps/OAuth2SampleApp\n$ carthage update --use-xcframeworks --platform iOS\n```\n\n__Step 2__: Open Xcode Project File\n```shell\n$ open OAuth2SampleApp.xcodeproj\n```\n\n__Step 3__: Insert your client ID and client secret\n\nFirst, find your OAuth2 app's client ID and secret from the [Box Developer Console][dev-console].  Then, add these\nvalues to the sample app in `Constants.swift` file:\n```swift\nstatic let clientId = \"YOUR CLIENT ID GOES HERE\"\nstatic let clientSecret = \"YOUR CLIENT SECRET GOES HERE\"\n```\n\n__Step 4__: Set redirect URL\n\nUsing the same client ID from the previous step, set the redirect URL for your application in the [Box Developer Console][dev-console] to\n`boxsdk-\u003c\u003cYOUR CLIENT ID\u003e\u003e://boxsdkoauth2redirect`, where `\u003c\u003cYOUR CLIENT ID\u003e\u003e` is replaced with your client ID.  For example, if your client\nID were `vvxff7v61xi7gqveejo8jh9d2z9xhox5` the redirect URL should be\n`boxsdk-vvxff7v61xi7gqveejo8jh9d2z9xhox5://boxsdkoauth2redirect`\n\n__Step 5__: Insert your client ID to receive the redirect in the app\n\nOpen the `Info.plist` file in the sample app and find the key here:\nURL Types --\u003e Item 0 --\u003e URL Schemes --\u003e Item 0\nUsing the same client ID from the previous step, set the value for Item 0 to\n`boxsdk-\u003c\u003cYOUR CLIENT ID\u003e\u003e`, where `\u003c\u003cYOUR CLIENT ID\u003e\u003e` is replaced with your client ID.  For example, if your client\nID were `vvxff7v61xi7gqveejo8jh9d2z9xhox5` the redirect URL should be\n`boxsdk-vvxff7v61xi7gqveejo8jh9d2z9xhox5`\n\n![Info.plist setting](docs/usage/redirect-url-scheme.png)\n\n__Step 6__: Run the sample app\n\nThe app opens with a prompt to begin OAuth2.0 Authentication. Tap \"OAuth2.0 Authentication\" to proceed.\n\nOn the next screen, tap \"Login\".\n\nAn iOS System Dialog pops up asking if you agree to open a URL to authenticate. Tap \"Continue\" to proceed.\n\nA Box login page loads. Enter your credentials and tap \"Authorize\" to proceed.\n\nA confirmation screen displays the name of your application, as defined in the Box Developer Console, along with the scopes it is configured with. Tap \"Grant access to Box\" to grant your application access to the Box account.\n\nThe next screen displays all the files in the root folder for the account. If you don't see any files on the screen, check that you have files saved in the root folder of the Box account. Note that for simplicity, folders are not displayed in this sample app. From this screen you can tap the back arrow to log out, or tap a file name in the list to download it and display it. PDF and all iOS-supported image files are currently supported in the app.\n\n### CCG Auth Sample App\n\nA sample app using CCG Authentication can be found in the repository [here][ccg-sample-app]. This app demonstrates how to use the\nBox Preview SDK to make calls with CCG Authentication.\n\n[ccg-sample-app]: https://github.com/box/box-ios-preview-sdk/tree/main/SampleApps/CCGSampleApp\n\nTo execute the sample app:\n\n__Step 1__: Run carthage\n```shell\n$ cd SampleApps/CCGSampleApp\n$ carthage update --use-xcframeworks --platform iOS\n```\n\n__Step 2__: Open Xcode Project File\n```shell\n$ open CCGSampleApp.xcodeproj\n```\n\n__Step 3__: Insert your client ID and client secret\n\nFirst, find your CCG app's client ID and secret from the [Box Developer Console][dev-console].  Then, add these\nvalues to the sample app in `Constants.swift` file:\n```swift\nstatic let clientId = \"YOUR CLIENT ID GOES HERE\"\nstatic let clientSecret = \"YOUR CLIENT SECRET GOES HERE\"\n```\n\n__Step 4__: Insert your userId if you to use CCG for user connection or enterpriseId for account service connection\n\nYou can find these values in your app at [Box Developer Console][dev-console].  Then, add these\nvalues to the sample app in `Constants.swift` file:\n```swift\nstatic let userId = \"YOUR USER ID GOES HERE\"\nstatic let enterpriseId = \"YOUR ENTERPRISE ID GOES HERE\"\n```\n\n__Step 5__: Uncomment the appropriate section in `authorizeWithCCGClient()` method in ViewController class.\n\nAs this sample app is prepared to CCG authentication as user and account service, you should uncomment \n`Section 1` for CCG connection for account service or `Section 2` for CCG connection for user account.\n\n__Step 6__: Run the sample app\n\nThe next screen displays all the files in the root folder for the account. If you don't see any files on the screen, check that you have files saved in the root folder of the Box account. Note that for simplicity, folders are not displayed in this sample app. From this screen you can tap the back arrow to log out, or tap a file name in the list to download it and display it. PDF and all iOS-supported image files are currently supported in the app.\n\nOpen a PDF File\n---------------\n\nTap a PDF file in the file list.  A progress bar indicates the download progress as the file is retrieved from Box.  When the progress reaches 100%, the document is displayed.\n\nThe toolbar at the top contains an arrow to go back to the file list, the file name, the current page number, an outline view button (if the document contains an outline) and a gallery view button.  The toolbar can be toggled by tapping the document.\n\nThe outline view allows you to view the hierarchical structure of the document and offers quick navigation to a particular page.\n\nThe gallery view shows large thumbnails of each page and offers quick navigation to a particular page.\n\nThe document supports left and right swiping gestures to navigate one page at a time, pinch-to-zoom gestures and panning.\n\nFor PDF files containing multiple pages, the thumbnail navigation bar at the bottom of the screen allows for quick navigation through the entire document.\n\n\nOpen an Image File\n------------------\nTap an image file (JPG, JPEG, PNG files are currently supported) in the file list.  A progress bar indicates the download progress as the file is retrieved from Box.  When the progress reaches 100%, the image is displayed.\n\nThe toolbar at the top contains an arrow to go back to the file list and the file name.  The toolbar can be toggled by tapping the image.\n\nThe image supports pinch-to-zoom gestures and panning.\n\nThe Preview SDK supports opening multiple images at once, but this is currently not exposed in the sample app.  Feel free to play around with this functionality on your own, by calling `BoxPreviewSDK.openImageFiles(fileIds:selectedId:delegate:allowedAction:displayThumbnails)`\n  - Loads all images in thumbnail navigation bar at the bottom of the screen\n  - Supports left and right swiping gestures to navigate from one image to the next\n  - Gallery view\n\n\nFuture Enhancements\n-------------------\n\nYou can expect to see the following enhancements in future updates of the Box Preview SDK:\n- Support for more file types\n- Local file caching\n- Start app on last-viewed file\n- And more!\n\n\n\n## Versions\n\nWe use a modified version of [Semantic Versioning](https://semver.org/) for all changes. See [version strategy](VERSIONS.md) for details which is effective from 30 July 2022.\n\n### Supported Version\n\nOnly the current MAJOR version of SDK is supported. New features, functionality, bug fixes, and security updates will only be added to the current MAJOR version.\n\nA current release is on the leading edge of our SDK development, and is intended for customers who are in active development and want the latest and greatest features.  Instead of stating a release date for a new feature, we set a fixed minor or patch release cadence of maximum 2-3 months (while we may release more often). At the same time, there is no schedule for major or breaking release. Instead, we will communicate one quarter in advance the upcoming breaking change to allow customers to plan for the upgrade. We always recommend that all users run the latest available minor release for whatever major version is in use. We highly recommend upgrading to the latest SDK major release at the earliest convenient time and before the EOL date.\n\n### Version schedule\n\n| Version | Supported Environments                                  | State     | First Release | EOL/Terminated |\n|---------|---------------------------------------------------------|-----------|---------------|----------------|\n| 3       | iOS 11.0+ / Mac OS X 10.13+ / tvOS 11.0+ / watchOS 4.0+ | Supported | 20 Nov 2019   | TBD            |\n| 2       |                                                         | EOL       | 30 Jun 2018   | 20 Nov 2019    |\n| 1       |                                                         | EOL       | 12 Aug 2015   | 30 Jun 2018    |\n\n\nCopyright and License\n-------\n\nCopyright 2019 Box, Inc. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbox%2Fbox-ios-preview-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbox%2Fbox-ios-preview-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbox%2Fbox-ios-preview-sdk/lists"}