Skip to content

Commit

Permalink
Objective-C test app takes default value of InstanaSetupOptions param…
Browse files Browse the repository at this point in the history
…eter
  • Loading branch information
Hongyan Jiang authored and GitHub Enterprise committed Jan 15, 2024
1 parent 9a92ce9 commit 987936f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
23 changes: 14 additions & 9 deletions Dev/ObjectiveCAppExample/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,22 @@ @implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
//note: explicitly get user permission before set enableCrashReporting to true
InstanaSetupOptions* options = [[InstanaSetupOptions alloc] initWithHttpCaptureConfig: 0
collectionEnabled: true
enableCrashReporting: true
suspendReportingOnLowBattery: true
suspendReportingOnCellular: false
slowSendInterval: 0.0
usiRefreshTimeIntervalInHrs: -1];

(void)[Instana setupWithKey: @"INSTANA_REPORTING_KEY"
reportingURL: [NSURL URLWithString: @"INSTANA_REPORTING_URL"]
options: options];
options: nil];

//note: explicitly get user permission before set enableCrashReporting to true
// InstanaSetupOptions* options = [[InstanaSetupOptions alloc] initWithHttpCaptureConfig: 0
// collectionEnabled: true
// enableCrashReporting: true
// suspendReportingOnLowBattery: true
// suspendReportingOnCellular: false
// slowSendInterval: 0.0
// usiRefreshTimeIntervalInHrs: -1];
// (void)[Instana setupWithKey: @"INSTANA_REPORTING_KEY"
// reportingURL: [NSURL URLWithString: @"INSTANA_REPORTING_URL"]
// options: options];

NSURL* url = [NSURL URLWithString: @"https://www.ibm.com/jp-ja"];
NSURLRequest* request = [NSURLRequest requestWithURL: url];
Expand Down
4 changes: 2 additions & 2 deletions Sources/InstanaAgent/Instana.swift
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ import Foundation
/// - reportingURL: Reporting URL for the Instana backend.
/// - enableCrashReporting: Subscribe to metricKit events so as to enable crash reporting.
/// App must have explicitly asked user permission to subscribe before this call.
@available(*, deprecated, message: "This method is deprecated. Use the setup() method with InstanaSetupOptions.")
@available(*, deprecated, message: "Use method setup(key: String, reportingURL: URL, options: InstanaSetupOptions?)")
@objc
public static func setup(key: String, reportingURL: URL, enableCrashReporting: Bool = false) {
let config = InstanaConfiguration.default(key: key, reportingURL: reportingURL,
Expand All @@ -153,7 +153,7 @@ import Foundation
/// - collectionEnabled: Enable or disable collection (instrumentation) on setup. Can be changed later via the property `collectionEnabled` (Default: true)
/// - enableCrashReporting: Subscribe to metricKit events so as to enable crash reporting.
/// App must have explicitly asked user permission to subscribe before this call.
@available(*, deprecated, message: "This method is deprecated. Use the setup() method with InstanaSetupOptions.")
@available(*, deprecated, message: "Use method setup(key: String, reportingURL: URL, options: InstanaSetupOptions?)")
@objc
public static func setup(key: String, reportingURL: URL,
httpCaptureConfig: HTTPCaptureConfig = .automatic,
Expand Down

0 comments on commit 987936f

Please sign in to comment.