Skip to content

tom-win87/diagnose-sdk

 
 

Repository files navigation

diagnose-sdk

Getting Started

SPDiagnoseConfig.plist

Make sure to add a property list file called SPDiagnoseConfig.plist to your project. With the content:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>appName</key>
    <string>myApp</string>
    <key>propertyId</key>
    <integer>123</integer>
    <key>accountId</key>
    <integer>22</integer>
    <key>key</key>
    <string>YOUR KEY GOES HERE</string>
</dict>
</plist>

Adding it as a dependency

At this point, the Diagnose SDK can be declared as a dependency using Swift Package Manager (SPM).

Setting up the SDK

Apps built using SwiftUI

Declare an @UIApplicationDelegateAdaptor on your app:

@main
struct iOSExampleApp: App {
    @UIApplicationDelegateAdaptor(SPDiagnoseAppDelegate.self) var appDelegate
}

Apps built using Storyboard

On your app delegate, add a reference to SPDiagnose and instantiate it during app launch:

public class SPDiagnoseAppDelegate: NSObject, UIApplicationDelegate {
    var diagnose: SPDiagnose?

    public func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {

        diagnose = SPDiagnose()
        return true
    }
}

FAQ

How does the SDK work?

The Diagnose SDK leverages the iOS native URLProtocol interface in order to intercept network calls made by your app and 3rd party libraries.

There are certain limitations, namely the fact that it can only intercept requests that use the URLSessionConfiguration.default.

The SDK sends the request domain to Diagnose APIs. Our backend, based on a proprietary dictionary, maps the domain collected to a particular vendor name.

What if I use a third party library like Alamofire?

We're currently investigating whether we're able to intercept requests made by network libraries without interfering with Apple's App Store policies.

What data is collected?

  • Request domain (and domain only, no path, no query params, etc)
  • The TCF consent string (stored by CMPs in the UserDefaults according to the TCF spec)
  • Request timestamp
  • IP address. IP is not collected in the client side, but is registered when our backend receives a request from the SDK.

Does the SDK access the payload of request / response?

No. The Diagnose SDK does not access the payload of the request and it is blind to the response as well. No access to cookie or any other data with the exception of the ones listed in the section above.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 75.4%
  • Objective-C 23.4%
  • C 1.2%