-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #241 from rollbar/release
Release 2.4.0
- Loading branch information
Showing
123 changed files
with
8,789 additions
and
2,745 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,14 +1,6 @@ | ||
// | ||
// AppDelegate.h | ||
// iosAppObjC | ||
// | ||
// Created by Andrey Kornich on 2020-11-04. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
@import UIKit; | ||
|
||
@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 |
---|---|---|
@@ -1,111 +1,44 @@ | ||
// | ||
// AppDelegate.m | ||
// iosAppObjC | ||
// | ||
// Created by Andrey Kornich on 2020-11-04. | ||
// | ||
|
||
#import "AppDelegate.h" | ||
#import "RollbarDemoSettings.h" | ||
|
||
@import RollbarNotifier; | ||
@import RollbarKSCrash; | ||
@import RollbarPLCrashReporter; | ||
|
||
@implementation AppDelegate | ||
|
||
|
||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | ||
// Override point for customization after application launch. | ||
|
||
[self initRollbar]; | ||
|
||
NSData *data = [[NSData alloc] init]; | ||
NSError *error; | ||
NSJSONReadingOptions serializationOptions = (NSJSONReadingMutableContainers | NSJSONReadingMutableLeaves); | ||
NSDictionary *payload = [NSJSONSerialization JSONObjectWithData:data | ||
options:serializationOptions | ||
error:&error]; | ||
if (!payload && error) { | ||
[Rollbar log:RollbarLevel_Error | ||
error:error | ||
data:nil | ||
context:nil | ||
]; | ||
} | ||
RollbarMutableConfig *config = [ | ||
// Rollbar post_client_item access token | ||
RollbarConfig mutableConfigWithAccessToken:@"YOUR-ROLLBAR-ACCESSTOKEN" | ||
environment:@"staging"]; | ||
|
||
@try { | ||
[self callTroublemaker]; | ||
} @catch (NSException *exception) { | ||
[Rollbar errorException:exception data:nil context:@"from @try-@catch"]; | ||
} @finally { | ||
[Rollbar infoMessage:@"Post-trouble notification!" data:nil context:@"from @try-@finally"]; | ||
} | ||
|
||
config.loggingOptions.codeVersion = @"main"; | ||
config.developerOptions.suppressSdkInfoLogging = NO; | ||
config.telemetry.memoryStatsAutocollectionInterval = 0.5; | ||
config.telemetry.enabled = YES; | ||
|
||
// now, cause a crash: | ||
// [self callTroublemaker]; | ||
//@throw NSInternalInconsistencyException; | ||
|
||
// [self performSelector:@selector(die_die)]; | ||
// [self performSelector:NSSelectorFromString(@"crashme:") withObject:nil afterDelay:10]; | ||
//id<RollbarCrashCollector> crashCollector = [[RollbarKSCrashCollector alloc] init]; | ||
id<RollbarCrashCollector> crashCollector = [[RollbarPLCrashCollector alloc] init]; | ||
|
||
[Rollbar initWithConfiguration:config | ||
crashCollector:crashCollector]; | ||
|
||
[Rollbar infoMessage:@"Rollbar is up and running! Enjoy your remote error and log monitoring..."]; | ||
|
||
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. | ||
return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" | ||
sessionRole:connectingSceneSession.role]; | ||
} | ||
|
||
- (void)initRollbar { | ||
|
||
// configure Rollbar: | ||
RollbarConfig *config = [RollbarConfig new]; | ||
|
||
config.destination.accessToken = ROLLBAR_DEMO_PAYLOADS_ACCESS_TOKEN; | ||
config.destination.environment = ROLLBAR_DEMO_ENVIRONMENT; | ||
config.developerOptions.suppressSdkInfoLogging = YES; | ||
config.telemetry.memoryStatsAutocollectionInterval = 0.5; | ||
config.telemetry.enabled = YES; | ||
|
||
// init Rollbar shared instance: | ||
//id<RollbarCrashCollector> crashCollector = [[RollbarKSCrashCollector alloc] init]; | ||
id<RollbarCrashCollector> crashCollector = [[RollbarPLCrashCollector alloc] init]; | ||
|
||
[Rollbar initWithConfiguration:config crashCollector:crashCollector]; | ||
|
||
[Rollbar infoMessage:@"Rollbar is up and running! Enjoy your remote error and log monitoring..."]; | ||
} | ||
|
||
- (void)callTroublemaker { | ||
NSArray *items = @[@"one", @"two", @"three"]; | ||
NSLog(@"Here is the trouble-item: %@", items[10]); | ||
} | ||
|
||
//- (void)demonstrateDeployApiUsage { | ||
// | ||
// RollbarDeploysDemoClient * rollbarDeploysIntro = [[RollbarDeploysDemoClient new] init]; | ||
// [rollbarDeploysIntro demoDeploymentRegistration]; | ||
// [rollbarDeploysIntro demoGetDeploymentDetailsById]; | ||
// [rollbarDeploysIntro demoGetDeploymentsPage]; | ||
//} | ||
|
||
|
||
@end |
Oops, something went wrong.