CAMobileAppAnalytics is an iOS SDK for App Experience Analytics that provides deep insights into the performance, user experience, crash, and log analytics of apps.
Check out our documentation for more information about the features that the App Experience Analytics SDK collects from your app.
- Xcode 12+ with the XCFramework, Xcode 11+ with the static library
- iOS 9.0 or higher
Note: Update Cocoapods to latest version in your mac `sudo gem install cocoapods`
- Xcode 12+
- iOS 11.0 or later
Follow these steps to integrate the CAMobileAppAnalytics SDK in your Xcode project using Cocoapods or Swift Package Manager
- Specify
pod CAMobileAppAnalytics
on a single line inside your target block in a Podfile to use CAMobileAppAnalytics static library
target 'YourApp' do
pod 'CAMobileAppAnalytics'
end
If you want to use the CAMobileAppAnalytics XCFramework, specify pod CAMobileAppAnalytics/xcframework
in your Podfile
target 'YourApp' do
pod 'CAMobileAppAnalytics/xcframework'
end
Then, run the following command using the command prompt from the folder of your project
$ pod install
- Drag & Drop the downloaded
xxx_camdo.plist
file into the Supporting files
If you've previously used CocoaPods, run
pod deintegrate
to remove them from your project.
-
Integrate
CAMobileAppAnalytics
package in to your project Via Xcode or Package.swiftVia Xcode
- Add a
CAMobileAppAnalytics
package by selectingFile
→Add Packages…
in Xcode’s menu bar - Search for the CAMobileAppAnalytics SDK using the below repo's URL:
https://github.com/CA-Application-Performance-Management/CAMobileAppAnalytics
- Set the Dependency Rule to be
Branch
and specifymaster
and then select Add Package
Via Package.swift
- To integrate
CAMobileAppAnalytics
to a Swift package via a Package.swift manifest, addCAMobileAppAnalytics
to the dependencies array of your package.
dependencies: [ .package(url: "https://github.com/CA-Application-Performance-Management/CAMobileAppAnalytics.git", branch: "master") ]
- Then any target that depends on a
CAMobileAppAnalytics
, add it to the dependencies array of that target.
.target( name: "MyTargetName", dependencies: ["CAMobileAppAnalytics"] ),
- Add a
- Drag & Drop the downloaded
xxx_camdo.plist
file into the Supporting files
-
Add the import header
#import "CAMDOReporter.h"
to your AppDelegate.m file -
Initialize the CAMobileAppAnalytics sdk in
didFinishLaunchingWithOptions:
method
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[CAMDOReporter initializeSDKWithOptions:SDKLogLevelVerbose completionHandler:nil];
return YES;
}
- Save and re-build your project
- Add a header file with the file name format as
<app_name>-Bridging-header.h
. - Add the import header
#import "CAMDOReporter.h"
to your<app_name>-Bridging-header.h
file. - Add the
<app_name>-Bridging-header.h
file to Swift Compiler - Code Generation section in the Build Settings.<name of the project>/<app_name>-Bridging-header.h
- Initialize the CAMobileAppAnalytics sdk in
didFinishLaunchingWithOptions
method
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
//Initialize CA App Experience Analytics SDK
CAMDOReporter.initializeSDK(options: SDKOptions.SDKLogLevelVerbose) { (completed, error) in
}
return true
}
- Save and re-build your project
Note: Single Option - Usage Example
CAMDOReporter.initializeSDK(options: SDKOptions.SDKLogLevelVerbose) { (completed, error) in }Multiple Options - Usage Example
CAMDOReporter.initializeSDK(options: SDKOptions.SDKLogLevelVerbose.union(SDKOptions.SDKUIWebViewDelegate)) { (completed, error) in }
@import CAMobileAppAnalytics;
NSString *resourcePath = [[NSBundle CAMobileAppAnalytics_Bundle] pathForResource:@"CaMDOIntegration" ofType:@"js"];
import CAMobileAppAnalytics
let path = Bundle.CAMobileAppAnalytics_Bundle.path(forResource: "CaMDOIntegration", ofType: "js")!
For more documentation and API references, go to our main website
Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
This software may be modified and distributed under the terms of the MIT license. See the LICENSE file for details.