{"id":19900100,"url":"https://github.com/m-lab/ndt7-client-ios","last_synced_at":"2025-05-02T23:30:29.347Z","repository":{"id":34410870,"uuid":"177632605","full_name":"m-lab/ndt7-client-ios","owner":"m-lab","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-06T09:36:24.000Z","size":1995,"stargazers_count":21,"open_issues_count":6,"forks_count":14,"subscribers_count":13,"default_branch":"main","last_synced_at":"2024-10-29T14:46:18.737Z","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/m-lab.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":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-25T17:24:12.000Z","updated_at":"2023-12-26T12:30:05.000Z","dependencies_parsed_at":"2024-04-15T06:01:01.395Z","dependency_job_id":"7cac2158-45fa-4b32-9d98-953556e2a04f","html_url":"https://github.com/m-lab/ndt7-client-ios","commit_stats":{"total_commits":88,"total_committers":4,"mean_commits":22.0,"dds":0.5454545454545454,"last_synced_commit":"06fe3e4a47100bf90bd853f5db8c10d38678e040"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-lab%2Fndt7-client-ios","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-lab%2Fndt7-client-ios/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-lab%2Fndt7-client-ios/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-lab%2Fndt7-client-ios/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m-lab","download_url":"https://codeload.github.com/m-lab/ndt7-client-ios/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224002433,"owners_count":17239293,"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-12T20:11:10.172Z","updated_at":"2024-11-12T20:11:10.697Z","avatar_url":"https://github.com/m-lab.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NDT7 iOS\n\n| branch | travis-ci | codacy | sonarcloud | codecov |\n|--------|-----------|--------|------------|---------|\n| develop | [![Build Status](https://travis-ci.org/m-lab/ndt7-client-ios.svg?branch=develop)](https://travis-ci.org/m-lab/ndt7-client-ios) | | | [![Coverage Status](https://codecov.io/gh/m-lab/ndt7-client-ios/branch/develop/graphs/badge.svg)](https://codecov.io/gh/m-lab/ndt7-client-ios/branch/develop) |\n| master | [![Build Status](https://travis-ci.org/m-lab/ndt7-client-ios.svg?branch=master)](https://travis-ci.org/m-lab/ndt7-client-ios) | [![Codacy Badge](https://api.codacy.com/project/badge/Grade/979506f489c944348dc7d6c51586eb08)](https://www.codacy.com/app/miguelangelnet/ndt7-client-ios?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=m-lab/ndt7-client-ios\u0026amp;utm_campaign=Badge_Grade) | [![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=m-lab_ndt7-client-ios\u0026metric=alert_status)](https://sonarcloud.io/dashboard/index/m-lab_ndt7-client-ios) | [![Coverage Status](https://codecov.io/gh/m-lab/ndt7-client-ios/branch/master/graphs/badge.svg)](https://codecov.io/gh/m-lab/ndt7-client-ios/branch/master) |\n\n[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=m-lab_ndt7-client-ios\u0026metric=bugs)](https://sonarcloud.io/component_measures?id=m-lab_ndt7-client-ios\u0026metric=Reliability)\n[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=m-lab_ndt7-client-ios\u0026metric=vulnerabilities)](https://sonarcloud.io/component_measures?id=m-lab_ndt7-client-ios\u0026metric=Security)\n[![Maintainability](https://sonarcloud.io/api/project_badges/measure?project=m-lab_ndt7-client-ios\u0026metric=sqale_rating)](https://sonarcloud.io/component_measures?id=m-lab_ndt7-client-ios\u0026metric=Maintainability)\n[![Reliability](https://sonarcloud.io/api/project_badges/measure?project=m-lab_ndt7-client-ios\u0026metric=reliability_rating)](https://sonarcloud.io/component_measures?id=m-lab_ndt7-client-ios\u0026metric=Reliability)\n[![Security](https://sonarcloud.io/api/project_badges/measure?project=m-lab_ndt7-client-ios\u0026metric=security_rating)](https://sonarcloud.io/component_measures?id=m-lab_ndt7-client-ios\u0026metric=Security)\n\n[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/m-lab/ndt7-client-ios.svg)](http://isitmaintained.com/project/m-lab/ndt7-client-ios \"Average time to resolve an issue\")\n[![Percentage of issues still open](http://isitmaintained.com/badge/open/m-lab/ndt7-client-ios.svg)](http://isitmaintained.com/project/m-lab/ndt7-client-ios \"Percentage of issues still open\")\n[![Measurement Lab](https://img.shields.io/badge/Measurement%20Lab-purple.svg)](https://www.measurementlab.net/)\n[![Apache License](https://img.shields.io/github/license/m-lab/ndt7-client-ios.svg)](http://www.apache.org/licenses/LICENSE-2.0)\n[![Platform](https://img.shields.io/cocoapods/p/NDT7.svg?style=flat)](http://htmlpreview.github.io/?https://github.com/m-lab/ndt7-client-ios/blob/master/docs/index.html)\n[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![CocoaPods Compatible](http://img.shields.io/cocoapods/v/NDT7.svg)](https://cocoapods.org/pods/NDT7)\n\n# Table of Contents\n\n\u003c!-- MarkdownTOC --\u003e\n\n- [Introduction](#introduction)\n    - [Current supported features](#current-supported-features)\n- [Requirements](#requirements)\n- [Documentation](#documentation)\n- [Installation](#installation)\n    - [CocoaPods](#cocoapods)\n    - [Carthage](#carthage)\n    - [Manual Installation](#manual-installation)\n- [Setup and Usage](#setup-and-usage)\n    - [Setup](#setup)\n    - [Start speed test](#start-speed-test)\n- [License](#license)\n\n\u003c!-- /MarkdownTOC --\u003e\n\n\u003ca name=\"introduction\"\u003e\u003c/a\u003e\n# Introduction\n\n\"Measure the Internet, save the data, and make it universally accessible and useful.\"\n\nNDT7 provides a framework to measure the download and upload speed.\n\n\u003ca name=\"current-supported-features\"\u003e\u003c/a\u003e\n## Current supported features\n\n- [X] Download Speed Test\n- [X] Upload Speed Test\n\n\u003ca name=\"requirements\"\u003e\u003c/a\u003e\n# Requirements\n\n- iOS 10.0+ / macOS 10.14.0+ / appleTV 10.0+ / watchOS 3.0+\n- Xcode 10.2+\n- Swift 5.0+\n\n\u003ca name=\"documentation\"\u003e\u003c/a\u003e\n# Documentation\n\nVisit the `NDT7` [documentation](http://htmlpreview.github.io/?https://github.com/m-lab/ndt7-client-ios/blob/master/docs/index.html) for instructions and browsing api references.\n\n\u003ca name=\"installation\"\u003e\u003c/a\u003e\n# Installation\n\n\u003ca name=\"cocoapods\"\u003e\u003c/a\u003e\n## CocoaPods\n\n[CocoaPods](https://cocoapods.org) is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website.\n\n```ruby\nplatform :ios, '10.0'\nuse_frameworks!\n\ntarget 'NDT7 example' do\n  pod 'NDT7', '0.0.4'\nend\n```\n\nThen, run the following command:\n\n```bash\n$ pod install\n```\n\n\u003ca name=\"carthage\"\u003e\u003c/a\u003e\n## Carthage\n\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.\n\nCreate a `Cartfile` and add the following line:\n\n```\ngithub \"m-lab/ndt7-client-ios\" ~\u003e 0.0.4\n```\n\nNext, run the following command:\n\n```bash\n$ carthage update\n```\n\nCheck out the **[Carthage docs »](https://github.com/Carthage/Carthage#if-youre-building-for-ios-tvos-or-watchos)** for more info.\n\n\u003ca name=\"manual-installation\"\u003e\u003c/a\u003e\n## Manual Installation\n\n### Adding all swift files\n\nAdd all `*.swift` files from `Sources` directory into your project.\n\n### Embedded Framework\n\n#### Step 1. Add as a git Submodule\n\nAdd NDT7 as a submodule to your local git repo with the following command:\n\n```bash\n$ git submodule add git@github.com:m-lab/ndt7-client-ios\n```\n\n#### Step 2. Drag NDT7.xcodeproj to your project\n\nDrag the `NDT7.xcodeproj` into the Project Navigator of you application's Xcode project.\n\n#### Step 3. Embed the framework\n\nUnder \"General\" tab from your project, add the NDT7 framework as an embedded binary. You'll see different frameworks depending if you need it for iOS, macOS or appleTV.\n\n\u003ca name=\"setup-and-usage\"\u003e\u003c/a\u003e\n# Setup and usage\n\n\u003ca name=\"setup\"\u003e\u003c/a\u003e\n## Setup\n\nIf you experiment issues been blocked for App Transport Security during the M-Lab server discovery, that means that requires data to be transmitted securely and you need to tell iOS to make exceptions for you.\n\nRemember, if you add this exception you'll be required to explain it to the app review team when you submit your app to the App Store.\n\nThe exception will be defined for the individual site locate.measurementlab.net inside your application's info.plist file. You can edit the plist as source code, right-click on your info.plist and choose Open As \u003e Source Code.\n\nYour plist should end like this:\n```swift\n\u003c/dict\u003e\n\u003c/plist\u003e\n```\n\nPlease, copy paste this before that:\n```swift\n\u003ckey\u003eNSAppTransportSecurity\u003c/key\u003e\n\u003cdict\u003e\n    \u003ckey\u003eNSExceptionDomains\u003c/key\u003e\n    \u003cdict\u003e\n        \u003ckey\u003elocate.measurementlab.net\u003c/key\u003e\n        \u003cdict\u003e\n            \u003ckey\u003eNSIncludesSubdomains\u003c/key\u003e\n            \u003ctrue/\u003e\n            \u003ckey\u003eNSThirdPartyExceptionAllowsInsecureHTTPLoads\u003c/key\u003e\n            \u003ctrue/\u003e\n        \u003c/dict\u003e\n    \u003c/dict\u003e\n\u003c/dict\u003e\n```\n\nThat requests add an exception for site locate.measurementlab.net.\n\nThe only setup needed for debugging purpose is to enable logging if needed.\n```swift\nNDT7.loggingEnabled = true\n```\n\nIf specific settings are needed for the testing configuration, you can define an NDT7Settings object, otherwise, use the default one with NDT7Settings().\n\nIn the next section, \"Start speed test\", we'll show all the steps needed to start a test.\n\n\u003ca name=\"start-speed-test\"\u003e\u003c/a\u003e\n## Start speed test\n\nThe next example show the whole process for a download and upload speed test.\n1. Setup all the functions needed for NDT7Test delegate.\n2. Create the settings for testing. NDT7Settings.\n3. Create a NDT7Test object with NDT7Settings already created.\n4. Setup a delegation for NDT7Test to get the test information.\n5. Start speed test for download and/or upload.\n\n```swift\nimport UIKit\nimport NDT7\n\nclass ViewController: UIViewController {\n\n    var ndt7Test: NDT7Test?\n\n    override func viewDidLoad() {\n        super.viewDidLoad()\n        // For debugging purpose you can enable logs for NDT7 framework.\n        NDT7.loggingEnabled = true\n        startTest()\n    }\n\n    func startTest() {\n        // 2. Create the settings for testing. NDT7Settings.\n        let settings = NDT7Settings()\n        // 3. Create a NDT7Test object with NDT7Settings already created.\n        ndt7Test = NDT7Test(settings: settings)\n        // 4. Setup a delegation for NDT7Test to get the test information.\n        ndt7Test?.delegate = self\n        // 5. Start speed test for download and/or upload.\n        ndt7Test?.startTest(download: true, upload: true) { [weak self] (error) in\n            guard self != nil else { return }\n            if let error = error {\n                print(\"NDT7 iOS Example app - Error during test: \\(error.localizedDescription)\")\n            } else {\n                print(\"NDT7 iOS Example app - Test finished.\")\n            }\n        }\n    }\n\n    func cancelTest() {\n        ndt7Test?.cancel()\n    }\n}\n\n// 1. Setup all the functions needed for NDT7Test delegate.\nextension ViewController: NDT7TestInteraction {\n\n    func test(kind: NDT7TestConstants.Kind, running: Bool) {\n    }\n\n    func measurement(origin: NDT7TestConstants.Origin, kind: NDT7TestConstants.Kind, measurement: NDT7Measurement) {\n    }\n\n    func error(kind: NDT7TestConstants.Kind, error: NSError) {\n    }\n}\n```\n\n# License\n\n`NDT7` iOS client is released under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0). See LICENSE for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm-lab%2Fndt7-client-ios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm-lab%2Fndt7-client-ios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm-lab%2Fndt7-client-ios/lists"}