Latest0.4.4
Homepagehttps://github.com/cedexis/radarkit
LicenseMIT The MIT License (MIT)

Copyright (c) 2015 Cedexis Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Platformsios 8.1, requires ARC
FrameworksFoundation, SystemConfiguration
Authors

A Cedexis Radar client for iOS.

Installation with CocoaPods

RadarKit is available on CocoaPods. Add the following to your Podfile:

pod 'RadarKit'

Installation with the .framework file

  1. Download the latest framework file from the Releases section.
  2. Unzip the file by double-clicking on it.
  3. Drag the RadarKit.framework file and drop it into your project.
  4. In Xcode, select your project’s name > Build Phases > Link Binary With Libraries > Add the CoreTelephony.framework (this is a dependency).

Manual installation

The first step is to add the RadarKit project into your own project. There are two principle ways to do that:

  1. Downloading the code from Github.
  2. Using a git submodule.

Downloading from Github

You can download the code directly from Github. From your project root directory:

$ mkdir -p Vendor/RadarKit
$ curl -L https://github.com/cedexis/RadarKit/tarball/master | tar xz --strip 1 -C Vendor/RadarKit

Using a git submodule

A good alternative to directly downloading the RadarKit source code is to use a git submodule. This has the
advantage of helping you to keep abreast of changes to the library.

From within your project:

$ git submodule add https://github.com/cedexis/RadarKit.git Vendor/RadarKit

Add RadarKit to Your Project

  1. Add the RadarKit xcodeproj file to your Xcode project using Finder.

  2. Select the Build Phases tab of the project build target you’re working with.

  3. Expand the Target Dependencies section. Click the plus button and add the RadarKit project.

  4. Under the Link Binary With Libraries section, click the plus button and add libRadarKit.a.

  5. Choose the Build Settings tab. Make sure All is selected at the top.

  6. Add Vendor/RadarKit to the Header Search Path.

  7. Add -all_load and -ObjC to Other Linker Flags.

Usage: Executing Radar Sessions

A typical Radar session downloads at most a few dozen files in a span of about 10 seconds.

Choose a specific point in your application code when you would like to execute a Radar session.
At the top of the implementation file, add:

#import <RadarKit/RadarKit.h>

Then at the exact point where you’d like to schedule a Radar session, add the following code:

CDXRadar *radar = [[CDXRadar alloc] initWithZoneId:1 
                                        customerId:XXXXX // <-- Replace this with your own Cedexis customer ID.
];
[radar runInBackground];

By default, RadarKit only measures probes set up with HTTPS URLs. If you need to measure probes having HTTP URLs, there is an alternate initialization that includes a protocol argument, which should be set to "http":

CDXRadar *radar = [[CDXRadar alloc] initWithZoneId:1 
                                        customerId:XXXXX // <-- Replace this with your own Cedexis customer ID.
                                          protocol:@"http"
];

Be sure to supply your own Cedexis zone and customer IDs as arguments to the CDXRadar class
initializers.

If you don’t know these, they can be obtained from the Cedexis portal at the following URL:
https://portal.cedexis.com/ui/radar/tag. This page lists the standard Cedexis Radar
JavaScript tag. Your zone ID and customer ID are embedded in the URL found in the tag.
For example, if the tag shows the URL //radar.cedexis.com/1/12345/radar.js, then your
zone ID is 1 and your customer ID is 12345.

If you’d like to execute code when the Radar session is finished, you can use:

[radar runInBackgroundWithCompletionHandler:^(NSError *error) {
    if (error) {
        // Handle the error here
    } else {
        // Your code here
    }
}];

To make RadarKit log all activity to the console, including errors and successful messages, add the following before executing the runInBackground method:

radar.isVerbose = YES;

If you need to cancel the Radar session for whatever reason, you can do the following:

CDXRadarSession *session = [radar runInBackground];
[session cancel]; // Add this line at the exact point you'd like the session to stop

Sample Application

There is a trivial example application demonstrating this integration technique availabile
at SimpleRadarKitDemo.

Credits

We’d like to give credit to Sam Soffes. The steps above for integrating third-party libraries
come from his S.S. Toolkit site.

Latest podspec

{
    "name": "RadarKit",
    "version": "0.4.4",
    "summary": "A Cedexis Radar client for iOS.",
    "homepage": "https://github.com/cedexis/radarkit",
    "license": {
        "type": "MIT",
        "text": "The MIT License (MIT)nn        Copyright (c) 2015 Cedexis Inc.nn        Permission is hereby granted, free of charge, to any person obtaining a copyn        of this software and associated documentation files (the "Software"), to dealn        in the Software without restriction, including without limitation the rightsn        to use, copy, modify, merge, publish, distribute, sublicense, and/or selln        copies of the Software, and to permit persons to whom the Software isn        furnished to do so, subject to the following conditions:nn        The above copyright notice and this permission notice shall be included in alln        copies or substantial portions of the Software.nn        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORn        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEn        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERn        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THEn        SOFTWARE."
    },
    "authors": {
        "Jacob Wan": "[email protected]"
    },
    "source": {
        "git": "https://github.com/cedexis/RadarKit.git",
        "tag": "0.4.4"
    },
    "platforms": {
        "ios": "8.1"
    },
    "requires_arc": true,
    "frameworks": [
        "Foundation",
        "SystemConfiguration"
    ],
    "source_files": "RadarKit/*.{h,m}",
    "prefix_header_file": "RadarKit-Prefix.pch"
}

Pin It on Pinterest

Share This