Skip to content

Commit

Permalink
feat: replace rollbar-ios with rollbar-apple (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
waltjones authored Jun 28, 2023
1 parent eac49bf commit 569f3a5
Show file tree
Hide file tree
Showing 7 changed files with 417 additions and 185 deletions.
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

7 changes: 4 additions & 3 deletions RollbarReactNative.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ Pod::Spec.new do |s|
s.license = 'MIT'
s.author = { 'Rollbar' => '[email protected]' }
s.platform = :ios, '7.0'
s.source = { :git => 'https://github.com/author/RollbarReactNative.git', :tag => 'v0.8.0' }
s.source = { :git => 'https://github.com/rollbar/rollbar-react-native.git', :tag => '1.0.0-rc.0' }
s.requires_arc = true

s.dependency 'React-Core'
s.dependency 'Rollbar', '~> 1.12.8'

s.dependency 'RollbarNotifier', '~> 3.0.3'
s.source_files = 'ios/RollbarReactNative.{h,m}'
s.public_header_files = 'ios/RollbarReactNative.h'

s.compiler_flags = '-fmodules', '-fcxx-modules'
end
199 changes: 145 additions & 54 deletions ios/RollbarReactNative.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,78 +3,169 @@
#else
#import "RCTBridgeModule.h"
#endif
#if __has_include(<Rollbar/Rollbar.h>)
#import <Rollbar/Rollbar.h>
#else
#import "Rollbar.h"
#endif

@interface RollbarReactNative : NSObject <RCTBridgeModule>

+ (void)initWithAccessToken:(NSString *)accessToken;
+ (void)initWithAccessToken:(NSString *)accessToken configuration:(RollbarConfiguration *)config;
+ (void)initWithAccessToken:(NSString *)accessToken configuration:(RollbarConfiguration*)configuration enableCrashReporter:(BOOL)enable;
+ (void)initWithConfiguration:(nonnull NSDictionary *)configuration;

+ (void)log:(nonnull NSString*)level message:(nonnull NSString*)message;
+ (void)log:(nonnull NSString*)level exception:(nonnull NSException*)exception;
+ (void)log:(nonnull NSString*)level error:(nonnull NSError*)error;

+ (void)log:(nonnull NSString*)level
message:(nonnull NSString*)message
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)log:(nonnull NSString*)level
exception:(nonnull NSException*)exception
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)log:(nonnull NSString*)level
error:(nonnull NSError*)error
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)log:(nonnull NSString*)level
message:(nonnull NSString*)message
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

+ (void)log:(nonnull NSString*)level
exception:(nonnull NSException*)exception
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

+ (void)log:(nonnull NSString*)level
error:(nonnull NSError*)error
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

+ (void)debugMessage:(nonnull NSString*)message;
+ (void)debugException:(nonnull NSException*)exception;
+ (void)debugError:(nonnull NSError*)error;

+ (void)debugMessage:(nonnull NSString*)message
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)debugException:(nonnull NSException*)exception
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)debugError:(nonnull NSError*)error
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)debugMessage:(nonnull NSString*)message
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

+ (void)debugException:(nonnull NSException*)exception
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

+ (void)debugError:(nonnull NSError*)error
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

+ (void)infoMessage:(nonnull NSString*)message;
+ (void)infoException:(nonnull NSException*)exception;
+ (void)infoError:(nonnull NSError*)error;

+ (void)infoMessage:(nonnull NSString*)message
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)infoException:(nonnull NSException*)exception
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)infoError:(nonnull NSError*)error
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)infoMessage:(nonnull NSString*)message
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

+ (void)infoException:(nonnull NSException*)exception
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

+ (void)infoError:(nonnull NSError*)error
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

+ (void)warningMessage:(nonnull NSString*)message;
+ (void)warningException:(nonnull NSException*)exception;
+ (void)warningError:(nonnull NSError*)error;

+ (void)warningMessage:(nonnull NSString*)message
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)warningException:(nonnull NSException*)exception
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)warningError:(nonnull NSError*)error
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)warningMessage:(nonnull NSString*)message
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

+ (void)warningException:(nonnull NSException*)exception
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

+ (void)warningError:(nonnull NSError*)error
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

// Old methods for backwards compatability
+ (void)errorMessage:(nonnull NSString*)message;
+ (void)errorException:(nonnull NSException*)exception;
+ (void)errorError:(nonnull NSError*)error;

+ (void)logWithLevel:(NSString*)level message:(NSString*)message;
+ (void)logWithLevel:(NSString*)level message:(NSString*)message data:(NSDictionary*)data;
+ (void)logWithLevel:(NSString*)level data:(NSDictionary*)data;
+ (void)errorMessage:(nonnull NSString*)message
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)debugWithMessage:(NSString*)message;
+ (void)debugWithMessage:(NSString*)message data:(NSDictionary*)data;
+ (void)debugWithData:(NSDictionary*)data;
+ (void)errorException:(nonnull NSException*)exception
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)infoWithMessage:(NSString*)message;
+ (void)infoWithMessage:(NSString*)message data:(NSDictionary*)data;
+ (void)infoWithData:(NSDictionary*)data;
+ (void)errorError:(nonnull NSError*)error
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)warningWithMessage:(NSString*)message;
+ (void)warningWithMessage:(NSString*)message data:(NSDictionary*)data;
+ (void)warningWithData:(NSDictionary*)data;
+ (void)errorMessage:(nonnull NSString*)message
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

+ (void)errorWithMessage:(NSString*)message;
+ (void)errorWithMessage:(NSString*)message data:(NSDictionary*)data;
+ (void)errorWithData:(NSDictionary*)data;
+ (void)errorException:(nonnull NSException*)exception
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

+ (void)criticalWithMessage:(NSString*)message;
+ (void)criticalWithMessage:(NSString*)message data:(NSDictionary*)data;
+ (void)criticalWithData:(NSDictionary*)data;
+ (void)errorError:(nonnull NSError*)error
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

// New interface
+ (void)criticalMessage:(nonnull NSString*)message;
+ (void)criticalException:(nonnull NSException*)exception;
+ (void)criticalError:(nonnull NSError*)error;

+ (void)log:(RollbarLevel)level message:(NSString*)message;
+ (void)log:(RollbarLevel)level message:(NSString*)message exception:(NSException*)exception;
+ (void)log:(RollbarLevel)level message:(NSString*)message exception:(NSException*)exception data:(NSDictionary*)data;
+ (void)log:(RollbarLevel)level message:(NSString*)message exception:(NSException*)exception data:(NSDictionary*)data context:(NSString*)context;
+ (void)criticalMessage:(nonnull NSString*)message
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)debug:(NSString*)message;
+ (void)debug:(NSString*)message exception:(NSException*)exception;
+ (void)debug:(NSString*)message exception:(NSException*)exception data:(NSDictionary*)data;
+ (void)debug:(NSString*)message exception:(NSException*)exception data:(NSDictionary*)data context:(NSString*)context;
+ (void)criticalException:(nonnull NSException*)exception
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)info:(NSString*)message;
+ (void)info:(NSString*)message exception:(NSException*)exception;
+ (void)info:(NSString*)message exception:(NSException*)exception data:(NSDictionary*)data;
+ (void)info:(NSString*)message exception:(NSException*)exception data:(NSDictionary*)data context:(NSString*)context;
+ (void)criticalError:(nonnull NSError*)error
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)warning:(NSString*)message;
+ (void)warning:(NSString*)message exception:(NSException*)exception;
+ (void)warning:(NSString*)message exception:(NSException*)exception data:(NSDictionary*)data;
+ (void)warning:(NSString*)message exception:(NSException*)exception data:(NSDictionary*)data context:(NSString*)context;
+ (void)criticalMessage:(nonnull NSString*)message
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

+ (void)error:(NSString*)message;
+ (void)error:(NSString*)message exception:(NSException*)exception;
+ (void)error:(NSString*)message exception:(NSException*)exception data:(NSDictionary*)data;
+ (void)error:(NSString*)message exception:(NSException*)exception data:(NSDictionary*)data context:(NSString*)context;
+ (void)criticalException:(nonnull NSException*)exception
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

+ (void)critical:(NSString*)message;
+ (void)critical:(NSString*)message exception:(NSException*)exception;
+ (void)critical:(NSString*)message exception:(NSException*)exception data:(NSDictionary*)data;
+ (void)critical:(NSString*)message exception:(NSException*)exception data:(NSDictionary*)data context:(NSString*)context;
+ (void)criticalError:(nonnull NSError*)error
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

- (void)init:(NSDictionary *)options;
- (void)setPerson:(NSDictionary *)personInfo;
- (void)init:(nonnull NSDictionary *)options;
- (void)setPerson:(nonnull NSDictionary *)personInfo;
- (void)clearPerson;

@end
Loading

0 comments on commit 569f3a5

Please sign in to comment.