cordova-plugin-caaxa

CAAXA Cordova library plugin.


Keywords
CAAXA Cordova plugin, CA Mobile App Analytics, Broadcom, ecosystem:cordova, cordova-ios
License
Apache-2.0
Install
npm install cordova-plugin-caaxa@20.3.1

Documentation

CAMobileAppAnalytics

CAMobileAppAnalytics is an iOS SDK for App Experience Analytics that provides deep insights into the performance, user experience, crash, and log analytics of apps.

Get Started

Check out our documentation for more information about the features that the App Experience Analytics SDK collects from your app.

Requirements

Cocoapods

  1. Xcode 12+ with the XCFramework, Xcode 11+ with the static library
  2. iOS 9.0 or higher
Note: Update Cocoapods to latest version in your mac `sudo gem install cocoapods`

Swift Package Manager

  1. Xcode 12+
  2. iOS 11.0 or later

Integration

Follow these steps to integrate the CAMobileAppAnalytics SDK in your Xcode project using Cocoapods or Swift Package Manager

Cocoapods

  1. 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
  1. Drag & Drop the downloaded xxx_camdo.plist file into the Supporting files

Swift Package Manager

If you've previously used CocoaPods, run pod deintegrate to remove them from your project.

Installation

  1. Integrate CAMobileAppAnalytics package in to your project Via Xcode or Package.swift

    Via Xcode
    1. Add a CAMobileAppAnalytics package by selecting File → Add Packages… in Xcode’s menu bar
    2. Search for the CAMobileAppAnalytics SDK using the below repo's URL:
    https://github.com/CA-Application-Performance-Management/CAMobileAppAnalytics
    1. Set the Dependency Rule to be Branch and specify master and then select Add Package
    Via Package.swift
    1. To integrate CAMobileAppAnalytics to a Swift package via a Package.swift manifest, add CAMobileAppAnalytics to the dependencies array of your package.
    dependencies: [
        .package(url: "https://github.com/CA-Application-Performance-Management/CAMobileAppAnalytics.git", branch: "master")
    ]
    1. Then any target that depends on a CAMobileAppAnalytics, add it to the dependencies array of that target.
    .target(
        name: "MyTargetName",
        dependencies: ["CAMobileAppAnalytics"]
    ),
  1. Drag & Drop the downloaded xxx_camdo.plist file into the Supporting files

Initialising the SDK in your Source code

Objective C

  1. Add the import header #import "CAMDOReporter.h" to your AppDelegate.m file

  2. Initialize the CAMobileAppAnalytics sdk in didFinishLaunchingWithOptions: method

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    [CAMDOReporter initializeSDKWithOptions:SDKLogLevelVerbose  completionHandler:nil];
    return YES;
}
  1. Save and re-build your project

Swift

  1. Add a header file with the file name format as <app_name>-Bridging-header.h.
  2. Add the import header #import "CAMDOReporter.h" to your <app_name>-Bridging-header.h file.
  3. 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
  4. 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
}
  1. 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
     
 }

Using Resources from Swift Package Manager

Objective C

@import CAMobileAppAnalytics;

NSString *resourcePath = [[NSBundle CAMobileAppAnalytics_Bundle] pathForResource:@"CaMDOIntegration" ofType:@"js"];

Swift

import CAMobileAppAnalytics

let path = Bundle.CAMobileAppAnalytics_Bundle.path(forResource: "CaMDOIntegration", ofType: "js")!

Documentation

For more documentation and API references, go to our main website

License

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.