Skip to content

Commit

Permalink
size reduction
Browse files Browse the repository at this point in the history
  • Loading branch information
Shubham Garg committed Jan 1, 2024
1 parent 3bfc702 commit d8235f4
Show file tree
Hide file tree
Showing 21 changed files with 187 additions and 207 deletions.
10 changes: 5 additions & 5 deletions PayUCrashReporter.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,30 @@
<array>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>PayUCrashReporter.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>PayUCrashReporter.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
#import <Foundation/Foundation.h>

#import "PayuCrashReporterDefines.h"
#import "PayuCrashReporterSerializable.h"
#import "PayUCRDefines.h"
#import "PayUCRSerializable.h"

NS_ASSUME_NONNULL_BEGIN

NS_SWIFT_NAME(Breadcrumb)
@interface PayuCrashReporterBreadcrumb : NSObject <PayuCrashReporterSerializable>
@interface PayUCRBreadcrumb : NSObject <PayUCRSerializable>

/**
* Level of breadcrumb
*/
@property (nonatomic) PayUCrashReporterLevel level;
@property (nonatomic) PayUCRLevel level;

/**
* Category of bookmark, can be any string
Expand Down Expand Up @@ -40,21 +39,21 @@ NS_SWIFT_NAME(Breadcrumb)
@property (nonatomic, strong) NSDictionary<NSString *, id> *_Nullable data;

/**
* Initializer for PayuCrashReporterBreadcrumb
* Initializer for PayUCRBreadcrumb
*
* @param level PayUCrashReporterLevel
* @param level PayUCRLevel
* @param category String
* @return PayuCrashReporterBreadcrumb
* @return PayUCRBreadcrumb
*/
- (instancetype)initWithLevel:(PayUCrashReporterLevel)level category:(NSString *)category;
- (instancetype)initWithLevel:(PayUCRLevel)level category:(NSString *)category;
- (instancetype)init;
+ (instancetype)new NS_UNAVAILABLE;

- (NSDictionary<NSString *, id> *)serialize;

- (BOOL)isEqual:(id _Nullable)other;

- (BOOL)isEqualToBreadcrumb:(PayuCrashReporterBreadcrumb *)breadcrumb;
- (BOOL)isEqualToBreadcrumb:(PayUCRBreadcrumb *)breadcrumb;

- (NSUInteger)hash;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,36 +22,36 @@
-(instancetype)init NS_UNAVAILABLE; \
+(instancetype) new NS_UNAVAILABLE;

@class PayuCrashReporterEvent, PayuCrashReporterBreadcrumb;
@class PayUCREvent, PayUCRBreadcrumb;

/**
* Block used for returning after a request finished
*/
typedef void (^PayUCrashReporterRequestFinished)(NSError *_Nullable error);
typedef void (^PayUCRRequestFinished)(NSError *_Nullable error);

/**
* Block used for request operation finished, shouldDiscardEvent is YES if event
* should be deleted regardless if an error ocured or not
*/
typedef void (^PayUCrashReporterRequestOperationFinished)(
typedef void (^PayUCRRequestOperationFinished)(
NSHTTPURLResponse *_Nullable response, NSError *_Nullable error);
/**
* Block can be used to mutate a breadcrumb before it's added to the scope.
* To avoid adding the breadcrumb altogether, return nil instead.
*/
typedef PayuCrashReporterBreadcrumb *_Nullable (^PayUCrashReporterBeforeBreadcrumbCallback)(
PayuCrashReporterBreadcrumb *_Nonnull breadcrumb);
typedef PayUCRBreadcrumb *_Nullable (^PayUCRBeforeBreadcrumbCallback)(
PayUCRBreadcrumb *_Nonnull breadcrumb);

/**
* Block can be used to mutate event before its send.
* To avoid sending the event altogether, return nil instead.
*/
typedef PayuCrashReporterEvent *_Nullable (^PayCrashReporterBeforeSendEventCallback)(PayuCrashReporterEvent *_Nonnull event);
typedef PayUCREvent *_Nullable (^PayCrashReporterBeforeSendEventCallback)(PayUCREvent *_Nonnull event);

/**
* A callback to be notified when the last program execution terminated with a crash.
*/
typedef void (^PayCrashReporterOnCrashedLastRunCallback)(PayuCrashReporterEvent *_Nonnull event);
typedef void (^PayCrashReporterOnCrashedLastRunCallback)(PayUCREvent *_Nonnull event);

/**
* Block can be used to determine if an event should be queued and stored
Expand All @@ -61,34 +61,25 @@ typedef void (^PayCrashReporterOnCrashedLastRunCallback)(PayuCrashReporterEvent
*/
typedef BOOL (^PayCrashReporterShouldQueueEvent)(
NSHTTPURLResponse *_Nullable response, NSError *_Nullable error);
/**
* Loglevel
*/
typedef NS_ENUM(NSInteger, PayUCrashReporterLogLevel) {
kPayUCrashReporterLogLevelNone = 1,
kPayCrashReporterLogLevelError,
kPayUCrashReporterLogLevelDebug,
kPayUCrashReporterLogLevelVerbose
};

/**
* CrashReporter level
*/
typedef NS_ENUM(NSUInteger, PayUCrashReporterLevel) {
typedef NS_ENUM(NSUInteger, PayUCRLevel) {
// Defaults to None which doesn't get serialized
kPayUCrashReporterLevelNone = 0,
kPayUCRLevelNone = 0,
// Goes from Debug to Fatal so possible to: (level > Info) { .. }
kPayUCrashReporterLevelDebug = 1,
kPayUCrashReporterLevelInfo = 2,
kPayUCrashReporterLevelWarning = 3,
kPayUCrashReporterLevelError = 4,
kPayUCrashReporterLevelFatal = 5,
kPayUCRLevelDebug = 1,
kPayUCRLevelInfo = 2,
kPayUCRLevelWarning = 3,
kPayUCRLevelError = 4,
kPayUCRLevelFatal = 5,
};

/**
* Static internal helper to convert enum to string
*/
static NSString *_Nonnull const PayUCrashReporterLevelNames[] = {
static NSString *_Nonnull const PayUCRLevelNames[] = {
@"none",
@"debug",
@"info",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,37 @@ NS_ASSUME_NONNULL_BEGIN
* "12c2d058-d584-4270-9aa2-eca08bf20986". It is recommended to omit dashes and use UUID v4 in all
* cases.
*/
@interface PayuCrashReporterId : NSObject
@interface PayUCRId : NSObject

/**
* Creates a PayuCrashReporterId with a random PayuCrashReporterId.
* Creates a PayUCRId with a random PayUCRId.
*/
- (instancetype)init;

/**
* Creates a PayuCrashReporterId with the given UUID.
* Creates a PayUCRId with the given UUID.
*/
- (instancetype)initWithUUID:(NSUUID *)uuid;

/**
* Creates a PayuCrashReporterId from a 32 character hexadecimal string without dashes such as
* Creates a PayUCRId from a 32 character hexadecimal string without dashes such as
* "12c2d058d58442709aa2eca08bf20986" or a 36 character hexadecimal string such as such as
* "12c2d058-d584-4270-9aa2-eca08bf20986".
*
* @return PayuCrashReporterId.empty for invalid strings.
* @return PayUCRId.empty for invalid strings.
*/
- (instancetype)initWithUUIDString:(NSString *)string;

/**
* Returns a 32 lowercase character hexadecimal string description of the PayuCrashReporterId, such as
* Returns a 32 lowercase character hexadecimal string description of the PayUCRId, such as
* "12c2d058d58442709aa2eca08bf20986".
*/
@property (readonly, copy) NSString *CrashReporterIdString;

/**
* A PayuCrashReporterId with an empty UUID "00000000000000000000000000000000".
* A PayUCRId with an empty UUID "00000000000000000000000000000000".
*/
@property (class, nonatomic, readonly, strong) PayuCrashReporterId *empty;
@property (class, nonatomic, readonly, strong) PayUCRId *empty;

@end

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#import <Foundation/Foundation.h>

#import "PayUCRDefines.h"

NS_ASSUME_NONNULL_BEGIN

@protocol PayUCRSerializable <NSObject>
PAYU_CrashReporter_NO_INIT

/**
* Serialize the contents of the object into an NSDictionary. Make to copy all properties of the
* original object so modifications to it don't have an impact on the serialized NSDictionary.
*/
- (NSDictionary<NSString *, id> *)serialize;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ FOUNDATION_EXPORT double CrashReporterVersionNumber;
//! Project version string for CrashReporter.
FOUNDATION_EXPORT const unsigned char CrashReporterVersionString[];

#import "PayuCrashReporterSDK.h"
#import "PayuCrashReporterId.h"
#import "PayUCrashReporterSDK.h"
#import "PayUCRId.h"
Original file line number Diff line number Diff line change
@@ -1,64 +1,35 @@
#import <Foundation/Foundation.h>


#import "PayuCrashReporterDefines.h"
@class PayuCrashReporterHub, PayuCrashReporterBreadcrumb, PayuCrashReporterId;
#import "PayUCRDefines.h"
@class PayUCRHub, PayUCRBreadcrumb, PayUCRId;

NS_ASSUME_NONNULL_BEGIN

// NS_SWIFT_NAME(SDK)
/**
"static api" for easy access to most common CrashReporter sdk features
try `PayuCrashReporterHub` for advanced features
try `PayUCRHub` for advanced features
*/
@interface PayuCrashReporterSDK : NSObject
@interface PayUCrashReporterSDK : NSObject
PAYU_CrashReporter_NO_INIT

/**
* Returns current hub
*/
+ (PayuCrashReporterHub *)currentHub;
+ (PayUCRHub *)currentHub;




/**
* Inits and configures CrashReporter (PayuCrashReporterHub, PayuCrashReporterClient) and sets up all integrations. Make sure to
* Inits and configures CrashReporter (PayUCRHub, PayUCRClient) and sets up all integrations. Make sure to
* set a valid DSN otherwise.
*/

+ (void)startWithExecutableName:(NSString *)name NS_SWIFT_NAME(start(executableName:));

+ (void)startWithExecutableName:(NSString *)name withDsn:(NSString *)dsn NS_SWIFT_NAME(start(executableName:dsn:));

/**
* Captures a message event and sends it to CrashReporter.
*
* @param message The message to send to CrashReporter.
*
* @return The PayuCrashReporterId of the event or PayuCrashReporterId.empty if the event is not sent.
*/
+ (PayuCrashReporterId *)captureMessage:(NSString *)message NS_SWIFT_NAME(capture(message:));


/**
* Adds a PayuCrashReporterBreadcrumb to the current Scope on the `currentHub`.
* If the total number of breadcrumbs exceeds the `max_breadcrumbs` setting, the
* oldest breadcrumb is removed.
*/
+ (void)addBreadcrumb:(PayuCrashReporterBreadcrumb *)crumb NS_SWIFT_NAME(addBreadcrumb(crumb:));


/**
* Set logLevel for the current client default kPayCrashReporterLogLevelError
*/
@property (nonatomic, class) PayUCrashReporterLogLevel logLevel;

/**
* Checks if the last program execution terminated with a crash.
*/
@property (nonatomic, class, readonly) BOOL crashedLastRun;



Expand Down
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit d8235f4

Please sign in to comment.