### Install ParselyAnalytics via CocoaPods Source: https://github.com/parsely/analyticssdk-ios/blob/master/README.md Instructions for installing the ParselyAnalytics SDK using CocoaPods. This involves adding the 'ParselyAnalytics' pod to your project's Podfile and running 'pod install'. ```bash sudo gem install cocoapods pod 'ParselyAnalytics' ``` -------------------------------- ### Swift Package Manager Setup Fix Source: https://github.com/parsely/analyticssdk-ios/blob/master/CHANGES.rst Fixes related to the Swift Package Manager setup for the analyticssdk-ios library. This ensures proper integration and installation via SPM. ```swift /* Fixed the Swift Package Manager setup [#76] */ ``` -------------------------------- ### Pushing to CocoaPods Trunk Source: https://github.com/parsely/analyticssdk-ios/blob/master/CONTRIBUTING.rst This command pushes the 'ParselyAnalytics.podspec' file to the CocoaPods trunk, making the SDK available as a dependency for other iOS projects. Ensure your podspec is up-to-date before pushing. ```bash pod trunk push ParselyAnalytics.podspec ``` -------------------------------- ### Track Page Views and Engagement with Parsely SDK Source: https://github.com/parsely/analyticssdk-ios/blob/master/README.md Shows how to use the Parsely SDK to track user engagement, including page views, starting engagement, and stopping engagement. These methods are called on the initialized Parsely singleton. ```swift self.parsely.trackPageView(url: "http://mysite.com/story1") self.parsely.startEngagement(url: "http://mysite.com/story2") self.parsely.stopEngagement() ``` -------------------------------- ### Pushing Git Tags and Commits Source: https://github.com/parsely/analyticssdk-ios/blob/master/CONTRIBUTING.rst This command pushes local commits and tags to the 'master' branch on the 'origin' remote repository. It's a crucial step in the release process to share changes and version information. ```git git push origin master --tags ``` -------------------------------- ### Initialize Parsely Singleton in iOS App Source: https://github.com/parsely/analyticssdk-ios/blob/master/README.md Demonstrates how to initialize the Parsely singleton and optionally configure it with a site ID in the application's launch method. This is a prerequisite for using other tracking functionalities. ```swift var parsely: Parsely? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { self.parsely = Parsely.sharedInstance // optionally call configure to set an API Key for all requests self.parsely.configure(siteId: "example.com") // other app initialization return true } ``` -------------------------------- ### Timestamp Handling Source: https://github.com/parsely/analyticssdk-ios/blob/master/CHANGES.rst Fixes for handling 0 timestamps and switching to `UInt64` for timestamps to prevent crashes on 32-bit devices. ```swift /* Fix 0 timestamps * Switched to `UInt64` for timestamps to avoid crashes on 32-bit devices */ ``` -------------------------------- ### Dependency Removal: AlamoFire Source: https://github.com/parsely/analyticssdk-ios/blob/master/CHANGES.rst The AlamoFire dependency has been removed, with HTTP requests now handled using the standard library interface. ```swift /* Remove AlamoFire dependency in favor of stdlib HTTP request interface */ ``` -------------------------------- ### Dependency Removal: Reachability Source: https://github.com/parsely/analyticssdk-ios/blob/master/CHANGES.rst The Reachability library has been removed as a dependency, simplifying the project's external dependencies. ```swift /* Remove Reachability as a dependency */ ``` -------------------------------- ### Metadata Formatting and Heartbeat Backoff Source: https://github.com/parsely/analyticssdk-ios/blob/master/CHANGES.rst Fixes an issue with metadata.pub_date formatting and adds heartbeat backoff to engagement tracking. ```swift /* Fixed metadata.pub_date formatting issue * Added heartbeat backoff to engagement tracking */ ``` -------------------------------- ### Iteration Guard for Accumulators Source: https://github.com/parsely/analyticssdk-ios/blob/master/CHANGES.rst A `guard` statement has been added to the iteration over accumulators to prevent potential issues. ```swift /* Added a `guard` to iteration over `accumulators` */ ``` -------------------------------- ### User-Agent Header Encoding Source: https://github.com/parsely/analyticssdk-ios/blob/master/CHANGES.rst Ensures the User-Agent header is force-encoded to latin1. ```swift /* Force User-Agent header to be latin1 encoded */ ``` -------------------------------- ### iOS 13 Background Event Handling Source: https://github.com/parsely/analyticssdk-ios/blob/master/CHANGES.rst Adjustments to listen for the correct background event in iOS versions 13 and above. Compatibility with versions prior to iOS 13 has been removed. ```swift /* Listen for correct background event in >= iOS 13 * Remove compatibility with < iOS 13 */ ``` -------------------------------- ### Serial Queue for Event Processing Source: https://github.com/parsely/analyticssdk-ios/blob/master/CHANGES.rst The library now utilizes a serial queue for processing events, enhancing concurrency management and preventing race conditions. This change also involved removing the SwiftyJSON dependency. ```swift /* The library now uses a serial queue to process events [#76] * Removed the dependency on SwiftyJSON [#76] */ ``` -------------------------------- ### Internal Function Marking and Unused Function Removal Source: https://github.com/parsely/analyticssdk-ios/blob/master/CHANGES.rst Marks many functions as `internal` to facilitate testing and removes an unused `reset` function. ```swift /* Marked many functions as `internal` to facilitate testing * Removed unused `reset` function */ ``` -------------------------------- ### Event Attribute Unit Correction Source: https://github.com/parsely/analyticssdk-ios/blob/master/CHANGES.rst Corrected an incorrect unit on the `sts` event attribute. ```swift /* Fixed an incorrect unit on the `sts` event attribute */ ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.