-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add target ObjectiveCAppExample to InstanaAgentExample to demonstrate…
… how to integrate iOSAgent with Objective-C app
- Loading branch information
Hongyan Jiang
authored and
GitHub Enterprise
committed
Jan 3, 2024
1 parent
13f68fb
commit 9a92ce9
Showing
15 changed files
with
491 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// AppDelegate.h | ||
// ObjectiveCAppExample | ||
// | ||
// Created by Helen Jiang on 1/2/24. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@interface AppDelegate : UIResponder <UIApplicationDelegate> | ||
|
||
|
||
@end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// | ||
// AppDelegate.m | ||
// ObjectiveCAppExample | ||
// | ||
// Created by Helen Jiang on 1/2/24. | ||
// | ||
|
||
#import "AppDelegate.h" | ||
@import InstanaAgent; | ||
|
||
@interface AppDelegate () | ||
|
||
@end | ||
|
||
@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]; | ||
|
||
NSURL* url = [NSURL URLWithString: @"https://www.ibm.com/jp-ja"]; | ||
NSURLRequest* request = [NSURLRequest requestWithURL: url]; | ||
[[[NSURLSession sharedSession] dataTaskWithRequest: request] resume]; | ||
|
||
return YES; | ||
} | ||
|
||
|
||
#pragma mark - UISceneSession lifecycle | ||
|
||
|
||
- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options { | ||
// Called when a new scene session is being created. | ||
// Use this method to select a configuration to create the new scene with. | ||
return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role]; | ||
} | ||
|
||
|
||
- (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet<UISceneSession *> *)sceneSessions { | ||
// Called when the user discards a scene session. | ||
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. | ||
// Use this method to release any resources that were specific to the discarded scenes, as they will not return. | ||
} | ||
|
||
|
||
@end |
11 changes: 11 additions & 0 deletions
11
Dev/ObjectiveCAppExample/Assets.xcassets/AccentColor.colorset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"colors" : [ | ||
{ | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Oops, something went wrong.