Swiftpack.co - trackingplan/trackingplan-ios as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by trackingplan.
trackingplan/trackingplan-ios 1.0.29
Trackingplan iOS SDK
⭐️ 3
🕓 1 year ago
iOS
.package(url: "https://github.com/trackingplan/trackingplan-ios.git", from: "1.0.29")

Trackingplan iOS SDK

With Trackingplan for iOS you can make sure that your tracking is going as you planned without changing your current analytics stack or code.

Trackingplan will monitor traffic between your app and data destinations and automatically detect any changes in your analytics implementation and warn you about inconsistencies like hit drops, missing properties, rogue events, and more.

Trackingplan is currently available for Web, iOS and Android. More clients will come soon.

Please request your TrackingplanId at trackingplan.com or write us directly [email protected].

Install the SDK

The recommended way to install Trackingplan for iOS is using Swift Package Manager because it makes it simple to install and upgrade.

First, add the Trackingplan dependency using Xcode, like so:

In Xcode, go to File -> Swift Packages -> Add Package Dependency...

If you are asked to choose the project, please choose the one you want to add Trackingplan to.

In the search box please put https://github.com/trackingplan/trackingplan-ios and click next.

Choose the Version and leave the default selection for the latest version or customize if needed.

Click finish and you will see the library added to the Swift Package Dependencies section.

Then in your application delegate’s - application(_:didFinishLaunchingWithOptions:) method, set up the SDK like so:

// AppDelegate.swift
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    // Override point for customization after application launch.

    // Initialize Trackingplan SDK
    Trackingplan.initialize(tpId: "#YourTrackingplanId")

    return true
}

And of course, import the SDK:

// AppDelegate.swift
import Trackingplan

All set!

Using tags

Tags are a pair of key-value strings that will be used for tagging data sent to Trackingplan. They can be used from your Trackingplan dashboard for debuging purposes, for example, to filter warnings affecting a specific app version, contry and so on.

Example

// Initialize Trackingplan SDK
Trackingplan.initialize(
    tpId: "#YourTrackingplanId",
    tags: [
        // "app_version": "1.0.0", Omitted, this is automatically set
        "lang": "en",
        "country": "us"
    ]
)

Environment

You can set environment in runtime using the tag builder environment app.launchEnvironment.updateValue(value, forKey: TrackingplanTag.environment.rawValue)

Can I install SDK using Cocoapods?

Yes, we also sopport installation using Cocoapods.

First, add the Trackingplan dependency to your Podfile, like so:

pod 'Trackingplan', :git => 'https://github.com/trackingplan/trackingplan-ios.git'

Then in your application delegate’s - application(_:didFinishLaunchingWithOptions:) method, set up the SDK like so:

// AppDelegate.swift
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.

        // Initialize Trackingplan SDK
        TrackingplanTag.initialize(tpId: "#YourTrackingplanId")

        return true
}

And of course, import the SDK:

// AppDelegate.swift
import TrackingplanTag

All set!

Need help?

Questions? Problems? Need more info? We can help! Contact us here.

Learn more

Visit www.trackingplan.com

License

Copyright © 2021 Trackingplan Inc. All Rights Reserved.

GitHub

link
Stars: 3
Last commit: 6 weeks ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

1.0.29
1 year ago

General improvements

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics