app center;增加發送ping的秒

This commit is contained in:
Caiyanpeng committed 2021-11-12 16:21:13 +08:00
1 parent 1bd1ffdb5a
commit d754ff3b15
719 files changed
+34172 -2875

No files matched your search

@@ -0,0 +1,28 @@
fileFormatVersion: 2
guid: 080dbfb0806f34da8b23bb5d484e22b2
folderAsset: yes
timeCreated: 1512387208
licenseType: Pro
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
Any:
second:
enabled: 1
settings: {}
data:
first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: aa6854b26ab6c9047a2452ef7f21f337
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1f4094ef4bd487243b518ee2f9fc7ace
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,26 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#import <Foundation/Foundation.h>
#if __has_include(<AppCenterCrashes/MSACCrashes.h>)
#import <AppCenterCrashes/MSACCrashHandlerSetupDelegate.h>
#import <AppCenterCrashes/MSACCrashes.h>
#import <AppCenterCrashes/MSACCrashesDelegate.h>
#import <AppCenterCrashes/MSACErrorAttachmentLog+Utility.h>
#import <AppCenterCrashes/MSACErrorAttachmentLog.h>
#import <AppCenterCrashes/MSACExceptionModel.h>
#import <AppCenterCrashes/MSACStackFrame.h>
#import <AppCenterCrashes/MSACWrapperCrashesHelper.h>
#import <AppCenterCrashes/MSACWrapperExceptionModel.h>
#else
#import "MSACCrashHandlerSetupDelegate.h"
#import "MSACCrashes.h"
#import "MSACCrashesDelegate.h"
#import "MSACErrorAttachmentLog+Utility.h"
#import "MSACErrorAttachmentLog.h"
#import "MSACExceptionModel.h"
#import "MSACStackFrame.h"
#import "MSACWrapperCrashesHelper.h"
#import "MSACWrapperExceptionModel.h"
#endif
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 7de92b23b6ef32946be1aea945be9df9
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,34 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#import <Foundation/Foundation.h>
/**
* This is required for Wrapper SDKs that need to provide custom behavior surrounding the setup of crash handlers.
*/
NS_SWIFT_NAME(CrashHandlerSetupDelegate)
@protocol MSACCrashHandlerSetupDelegate <NSObject>
@optional
/**
* Callback method that will be called immediately before crash handlers are set up.
*/
- (void)willSetUpCrashHandlers;
/**
* Callback method that will be called immediately after crash handlers are set up.
*/
- (void)didSetUpCrashHandlers;
/**
* Callback method that gets a value indicating whether the SDK should enable an uncaught exception handler.
*
* @return YES if SDK should enable uncaught exception handler, otherwise NO.
*
* @discussion Do not register an UncaughtExceptionHandler for Xamarin as we rely on the Xamarin runtime to report NSExceptions. Registering
* our own UncaughtExceptionHandler will cause the Xamarin debugger to not work properly (it will not stop for NSExceptions).
*/
- (BOOL)shouldEnableUncaughtExceptionHandler;
@end
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 219da441a20f7534d9173f028a255329
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,207 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#if __has_include(<AppCenter/MSACServiceAbstract.h>)
#import <AppCenter/MSACServiceAbstract.h>
#else
#import "MSACServiceAbstract.h"
#endif
#if __has_include(<AppCenterCrashes/MSACErrorReport.h>)
#import <AppCenterCrashes/MSACErrorReport.h>
#else
#import "MSACErrorReport.h"
#endif
@class MSACCrashesDelegate;
@class MSACExceptionModel;
@class MSACErrorAttachmentLog;
/**
* Custom block that handles the alert that prompts the user whether crash reports need to be processed or not.
*
* @return Returns YES to discard crash reports, otherwise NO.
*/
typedef BOOL (^MSACUserConfirmationHandler)(NSArray<MSACErrorReport *> *_Nonnull errorReports) NS_SWIFT_NAME(UserConfirmationHandler);
/**
* Error Logging status.
*/
typedef NS_ENUM(NSUInteger, MSACErrorLogSetting) {
/**
* Crash reporting is disabled.
*/
MSACErrorLogSettingDisabled = 0,
/**
* User is asked each time before sending error logs.
*/
MSACErrorLogSettingAlwaysAsk = 1,
/**
* Each error log is send automatically.
*/
MSACErrorLogSettingAutoSend = 2
} NS_SWIFT_NAME(ErrorLogSetting);
/**
* Crash Manager alert user input.
*/
typedef NS_ENUM(NSUInteger, MSACUserConfirmation) {
/**
* User chose not to send the crash report.
*/
MSACUserConfirmationDontSend = 0,
/**
* User wants the crash report to be sent.
*/
MSACUserConfirmationSend = 1,
/**
* User wants to send all error logs.
*/
MSACUserConfirmationAlways = 2
} NS_SWIFT_NAME(UserConfirmation);
@protocol MSACCrashesDelegate;
NS_SWIFT_NAME(Crashes)
@interface MSACCrashes : MSACServiceAbstract
/**
* Track handled error.
*
* @param error error.
* @param properties dictionary of properties.
* @param attachments a list of attachments.
*
* @return handled error ID.
*/
+ (NSString *_Nonnull)trackError:(NSError *_Nonnull)error
withProperties:(nullable NSDictionary<NSString *, NSString *> *)properties
attachments:(nullable NSArray<MSACErrorAttachmentLog *> *)attachments NS_SWIFT_NAME(trackError(_:properties:attachments:));
/**
* Track handled exception from custom exception model.
*
* @param exception custom model exception.
* @param properties dictionary of properties.
* @param attachments a list of attachments.
*
* @return handled error ID.
*/
+ (NSString *_Nonnull)trackException:(MSACExceptionModel *_Nonnull)exception
withProperties:(nullable NSDictionary<NSString *, NSString *> *)properties
attachments:(nullable NSArray<MSACErrorAttachmentLog *> *)attachments NS_SWIFT_NAME(trackException(_:properties:attachments:));
///-----------------------------------------------------------------------------
/// @name Testing Crashes Feature
///-----------------------------------------------------------------------------
/**
* Lets the app crash for easy testing of the SDK.
*
* The best way to use this is to trigger the crash with a button action.
*
* Make sure not to let the app crash in `applicationDidFinishLaunching` or any other startup method! Since otherwise the app would crash
* before the SDK could process it.
*
* Note that our SDK provides support for handling crashes that happen early on startup. Check the documentation for more information on how
* to use this.
*
* If the SDK detects an App Store environment, it will _NOT_ cause the app to crash!
*/
+ (void)generateTestCrash;
///-----------------------------------------------------------------------------
/// @name Helpers
///-----------------------------------------------------------------------------
/**
* Check if the app has crashed in the last session.
*
* @return Returns YES is the app has crashed in the last session.
*/
@property(class, readonly, nonatomic) BOOL hasCrashedInLastSession;
/**
* Check if the app received memory warning in the last session.
*
* @return Returns YES is the app received memory warning in the last session.
*/
@property(class, readonly, nonatomic) BOOL hasReceivedMemoryWarningInLastSession;
/**
* Provides details about the crash that occurred in the last app session
*/
@property(class, nullable, readonly, nonatomic) MSACErrorReport *lastSessionCrashReport;
#if TARGET_OS_OSX || TARGET_OS_MACCATALYST
/**
* Callback for report exception.
*
* NOTE: This method should be called only if you explicitly disabled swizzling for it.
*
* On OS X runtime, not all uncaught exceptions end in a custom `NSUncaughtExceptionHandler`.
* Forward exception from overrided `[NSApplication reportException:]` to catch additional exceptions.
*/
+ (void)applicationDidReportException:(NSException *_Nonnull)exception;
#endif
///-----------------------------------------------------------------------------
/// @name Configuration
///-----------------------------------------------------------------------------
#if !TARGET_OS_TV
/**
* Disable the Mach exception server.
*
* By default, the SDK uses the Mach exception handler to catch fatal signals, e.g. stack overflows, via a Mach exception server. If you
* want to disable the Mach exception handler, you should call this method _BEFORE_ starting the SDK. Your typical setup code would look
* like this:
*
* `[MSACCrashes disableMachExceptionHandler]`;
* `[MSACAppCenter start:@"YOUR_APP_ID" withServices:@[[MSACCrashes class]]];`
*
* or if you are using Swift:
*
* `MSACCrashes.disableMachExceptionHandler()`
* `MSACAppCenter.start("YOUR_APP_ID", withServices: [MSACAnalytics.self, MSACCrashes.self])`
*
* tvOS does not support the Mach exception handler, thus crashes that are caused by stack overflows cannot be detected. As a result,
* disabling the Mach exception server is not available in the tvOS SDK.
*
* @discussion It can be useful to disable the Mach exception handler when you are debugging the Crashes service while developing,
* especially when you attach the debugger to your application after launch.
*/
+ (void)disableMachExceptionHandler;
#endif
/**
* Set the delegate
* Defines the class that implements the optional protocol `MSACCrashesDelegate`.
*
* @see MSACCrashesDelegate
*/
@property(class, nonatomic, weak) id<MSACCrashesDelegate> _Nullable delegate;
/**
* Set a user confirmation handler that is invoked right before processing crash reports to determine whether sending crash reports or not.
*
* @see MSACUserConfirmationHandler
*/
@property(class, nonatomic) MSACUserConfirmationHandler _Nullable userConfirmationHandler;
/**
* Notify SDK with a confirmation to handle the crash report.
*
* @param userConfirmation A user confirmation.
*
* @see MSACUserConfirmation.
*/
+ (void)notifyWithUserConfirmation:(MSACUserConfirmation)userConfirmation;
@end
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 065567eaa08c24543b46c9358b0c69ca
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,70 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#import <Foundation/Foundation.h>
@class MSACCrashes;
@class MSACErrorReport;
@class MSACErrorAttachmentLog;
NS_ASSUME_NONNULL_BEGIN
NS_SWIFT_NAME(CrashesDelegate)
@protocol MSACCrashesDelegate <NSObject>
@optional
/**
* Callback method that will be called before processing errors.
*
* @param crashes The instance of MSACCrashes.
* @param errorReport The errorReport that will be sent.
*
* @discussion Crashes will send logs to the server or discard/delete logs based on this method's return value.
*/
- (BOOL)crashes:(MSACCrashes *)crashes shouldProcessErrorReport:(MSACErrorReport *)errorReport NS_SWIFT_NAME(crashes(_:shouldProcess:));
/**
* Callback method that will be called before each error will be send to the server.
*
* @param crashes The instance of MSACCrashes.
* @param errorReport The errorReport that will be sent.
*
* @discussion Use this callback to display custom UI while crashes are sent to the server.
*/
- (void)crashes:(MSACCrashes *)crashes willSendErrorReport:(MSACErrorReport *)errorReport;
/**
* Callback method that will be called after the SDK successfully sent an error report to the server.
*
* @param crashes The instance of MSACCrashes.
* @param errorReport The errorReport that App Center sent.
*
* @discussion Use this method to hide your custom UI.
*/
- (void)crashes:(MSACCrashes *)crashes didSucceedSendingErrorReport:(MSACErrorReport *)errorReport;
/**
* Callback method that will be called in case the SDK was unable to send an error report to the server.
*
* @param crashes The instance of MSACCrashes.
* @param errorReport The errorReport that App Center tried to send.
* @param error The error that occurred.
*/
- (void)crashes:(MSACCrashes *)crashes didFailSendingErrorReport:(MSACErrorReport *)errorReport withError:(nullable NSError *)error;
/**
* Method to get the attachments associated to an error report.
*
* @param crashes The instance of MSACCrashes.
* @param errorReport The errorReport associated with the returned attachments.
*
* @return The attachments associated with the given error report or nil if the error report doesn't have any attachments.
*
* @discussion Implement this method if you want attachments to the given error report.
*/
- (nullable NSArray<MSACErrorAttachmentLog *> *)attachmentsWithCrashes:(MSACCrashes *)crashes forErrorReport:(MSACErrorReport *)errorReport;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 9cd0c2bc87f1e744dae772529e743a04
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,36 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#if __has_include(<AppCenterCrashes/MSACErrorAttachmentLog.h>)
#import <AppCenterCrashes/MSACErrorAttachmentLog.h>
#else
#import "MSACErrorAttachmentLog.h"
#endif
// Exporting symbols for category.
extern NSString *MSACMSACErrorLogAttachmentLogUtilityCategory;
@interface MSACErrorAttachmentLog (Utility)
/**
* Create an attachment with a given filename and text.
*
* @param filename The filename the attachment should get. If nil will get an automatically generated filename.
* @param text The attachment text.
*
* @return An instance of `MSACErrorAttachmentLog`.
*/
+ (MSACErrorAttachmentLog *)attachmentWithText:(NSString *)text filename:(NSString *)filename;
/**
* Create an attachment with a given filename and `NSData` object.
*
* @param filename The filename the attachment should get. If nil will get an automatically generated filename.
* @param data The attachment data as NSData.
* @param contentType The content type of your data as MIME type.
*
* @return An instance of `MSACErrorAttachmentLog`.
*/
+ (MSACErrorAttachmentLog *)attachmentWithBinary:(NSData *)data filename:(NSString *)filename contentType:(NSString *)contentType;
@end
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: fec6b70a513841e4aa15451aed829acb
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,54 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#import <Foundation/Foundation.h>
#if __has_include(<AppCenter/MSACAbstractLog.h>)
#import <AppCenter/MSACAbstractLog.h>
#else
#import "MSACAbstractLog.h"
#endif
/**
* Error attachment log.
*/
NS_SWIFT_NAME(ErrorAttachmentLog)
@interface MSACErrorAttachmentLog : MSACAbstractLog
/**
* Content type (text/plain for text).
*/
@property(nonatomic, copy) NSString *contentType;
/**
* File name.
*/
@property(nonatomic, copy) NSString *filename;
/**
* The attachment data.
*/
@property(nonatomic, copy) NSData *data;
/**
* Initialize an attachment with a given filename and `NSData` object.
*
* @param filename The filename the attachment should get. If nil will get an automatically generated filename.
* @param data The attachment data as `NSData`.
* @param contentType The content type of your data as MIME type.
*
* @return An instance of `MSACErrorAttachmentLog`.
*/
- (instancetype)initWithFilename:(NSString *)filename attachmentBinary:(NSData *)data contentType:(NSString *)contentType;
/**
* Initialize an attachment with a given filename and text.
*
* @param filename The filename the attachment should get. If nil will get an automatically generated filename.
* @param text The attachment text.
*
* @return An instance of `MSACErrorAttachmentLog`.
*/
- (instancetype)initWithFilename:(NSString *)filename attachmentText:(NSString *)text;
@end
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 51f53336930cdcc48982a6da2e1d9ece
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,67 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#import <Foundation/Foundation.h>
@class MSACDevice;
NS_SWIFT_NAME(ErrorReport)
@interface MSACErrorReport : NSObject
/**
* UUID for the crash report.
*/
@property(nonatomic, copy, readonly) NSString *incidentIdentifier;
/**
* UUID for the app installation on the device.
*/
@property(nonatomic, copy, readonly) NSString *reporterKey;
/**
* Signal that caused the crash.
*/
@property(nonatomic, copy, readonly) NSString *signal;
/**
* Exception name that triggered the crash, nil if the crash was not caused by an exception.
*/
@property(nonatomic, copy, readonly) NSString *exceptionName;
/**
* Exception reason, nil if the crash was not caused by an exception.
*/
@property(nonatomic, copy, readonly) NSString *exceptionReason;
/**
* Date and time the app started, nil if unknown.
*/
@property(nonatomic, readonly, strong) NSDate *appStartTime;
/**
* Date and time the error occurred, nil if unknown
*/
@property(nonatomic, readonly, strong) NSDate *appErrorTime;
/**
* Device information of the app when it crashed.
*/
@property(nonatomic, readonly, strong) MSACDevice *device;
/**
* Identifier of the app process that crashed.
*/
@property(nonatomic, readonly, assign) NSUInteger appProcessIdentifier;
/**
* Indicates if the app was killed while being in foreground from the iOS.
*
* This can happen if it consumed too much memory or the watchdog killed the app because it took too long to startup or blocks the main
* thread for too long, or other reasons. See Apple documentation:
* https://developer.apple.com/library/ios/qa/qa1693/_index.html.
*
* @see `[MSACCrashes didReceiveMemoryWarningInLastSession]`
*/
@property(nonatomic, readonly) BOOL isAppKill;
@end
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 49cd6b4ccd1dc894990174d804206e9c
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,81 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#import <Foundation/Foundation.h>
#ifndef MSAC_EXCEPTION_MODEL_H
#define MSAC_EXCEPTION_MODEL_H
#if __has_include(<AppCenter/MSACSerializableObject.h>)
#import <AppCenter/MSACSerializableObject.h>
#else
#import "MSACSerializableObject.h"
#endif
@class MSACStackFrame;
NS_SWIFT_NAME(ExceptionModel)
@interface MSACExceptionModel : NSObject <MSACSerializableObject>
/**
* Creates an instance of exception model.
*
* @param error error.
*
* @return A new instance of exception.
*/
- (instancetype)initWithError:(NSError *)error NS_SWIFT_NAME(init(withError:));
/**
* Creates an instance of exception model.
*
* @param exceptionType exception type.
* @param exceptionMessage exception message.
* @param stackTrace stack trace.
*
* @return A new instance of exception.
*/
- (instancetype)initWithType:(NSString *)exceptionType
exceptionMessage:(NSString *)exceptionMessage
stackTrace:(NSArray<NSString *> *)stackTrace
NS_SWIFT_NAME(init(withType:exceptionMessage:stackTrace:));
/**
* Creates an instance of exception model.
*
* @exception exception.
*
* @return A new instance of exception.
*/
- (instancetype)initWithException:(NSException *)exception NS_SWIFT_NAME(init(withException:));
/**
* Exception type.
*/
@property(nonatomic, copy) NSString *type;
/**
* Exception reason.
*/
@property(nonatomic, copy) NSString *message;
/**
* Raw stack trace. Sent when the frames property is either missing or unreliable.
*/
@property(nonatomic, copy) NSString *stackTrace;
/**
* Stack frames [optional].
*/
@property(nonatomic, strong) NSArray<MSACStackFrame *> *frames;
/**
* Checks if the object's values are valid.
*
* @return YES, if the object is valid.
*/
- (BOOL)isValid;
@end
#endif
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 215f50f9db30ad146aa10940c8f4dcdc
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,44 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#import <Foundation/Foundation.h>
#if __has_include(<AppCenter/MSACSerializableObject.h>)
#import <AppCenter/MSACSerializableObject.h>
#else
#import "MSACSerializableObject.h"
#endif
@interface MSACStackFrame : NSObject <MSACSerializableObject>
/*
* Frame address [optional].
*/
@property(nonatomic, copy) NSString *address;
/*
* Symbolized code line [optional].
*/
@property(nonatomic, copy) NSString *code;
/*
* The fully qualified name of the Class containing the execution point represented by this stack trace element [optional].
*/
@property(nonatomic, copy) NSString *className;
/*
* The name of the method containing the execution point represented by this stack trace element [optional].
*/
@property(nonatomic, copy) NSString *methodName;
/*
* The line number of the source line containing the execution point represented by this stack trace element [optional].
*/
@property(nonatomic, copy) NSNumber *lineNumber;
/*
* The name of the file containing the execution point represented by this stack trace element [optional].
*/
@property(nonatomic, copy) NSString *fileName;
@end
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: e225394719144bf4abd810eeb3eb864c
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,79 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#import <Foundation/Foundation.h>
#if __has_include(<AppCenterCrashes/MSACCrashHandlerSetupDelegate.h>)
#import <AppCenterCrashes/MSACCrashHandlerSetupDelegate.h>
#else
#import "MSACCrashHandlerSetupDelegate.h"
#endif
NS_ASSUME_NONNULL_BEGIN
@class MSACErrorReport;
@class MSACErrorAttachmentLog;
/**
* This general class allows wrappers to supplement the Crashes SDK with their own behavior.
*/
NS_SWIFT_NAME(WrapperCrashesHelper)
@interface MSACWrapperCrashesHelper : NSObject
/**
* The crash handler setup delegate.
*
*/
@property(class, nonatomic, weak) _Nullable id<MSACCrashHandlerSetupDelegate> crashHandlerSetupDelegate;
/**
* Gets the crash handler setup delegate.
*
* @deprecated
*
* @return The delegate being used by Crashes.
*/
+ (id<MSACCrashHandlerSetupDelegate>)getCrashHandlerSetupDelegate DEPRECATED_MSG_ATTRIBUTE("Use crashHandlerSetupDelegate instead");
/**
* Enables or disables automatic crash processing. Passing NO causes SDK not to send reports immediately, even if "Always Send" is true.
*/
@property(class, nonatomic) BOOL automaticProcessing;
/**
* Gets a list of unprocessed crash reports. Will block until the service starts.
*
* @return An array of unprocessed error reports.
*/
@property(class, readonly, nonatomic) NSArray<MSACErrorReport *> *unprocessedCrashReports;
/**
* Resumes processing for a given subset of the unprocessed reports.
*
* @param filteredIds An array containing the errorId/incidentIdentifier of each report that should be sent.
*
* @return YES if should "Always Send" is true.
*/
+ (BOOL)sendCrashReportsOrAwaitUserConfirmationForFilteredIds:(NSArray<NSString *> *)filteredIds;
/**
* Sends error attachments for a particular error report.
*
* @param errorAttachments An array of error attachments that should be sent.
* @param incidentIdentifier The identifier of the error report that the attachments will be associated with.
*/
+ (void)sendErrorAttachments:(NSArray<MSACErrorAttachmentLog *> *)errorAttachments withIncidentIdentifier:(NSString *)incidentIdentifier;
/**
* Get a generic error report representation for an handled exception.
* This API is used by wrapper SDKs.
*
* @param errorID handled error ID.
*
* @return an error report.
*/
+ (MSACErrorReport *)buildHandledErrorReportWithErrorID:(NSString *)errorID;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 836ece8c2e5270540b4abb9f322d79c6
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,38 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#import <Foundation/Foundation.h>
#ifndef MSAC_WRAPPER_EXCEPTION_MODEL_H
#define MSAC_WRAPPER_EXCEPTION_MODEL_H
#if __has_include(<AppCenterCrashes/MSACExceptionModel.h>)
#import <AppCenterCrashes/MSACExceptionModel.h>
#import <AppCenterCrashes/MSACWrapperExceptionModel.h>
#else
#import "MSACExceptionModel.h"
#import "MSACWrapperExceptionModel.h"
#endif
#if __has_include(<AppCenter/MSACSerializableObject.h>)
#import <AppCenter/MSACSerializableObject.h>
#else
#import "MSACSerializableObject.h"
#endif
@interface MSACWrapperExceptionModel : MSACExceptionModel
/*
* Inner exceptions of this exception [optional].
*/
@property(nonatomic, strong) NSArray<MSACWrapperExceptionModel *> *innerExceptions;
/*
* Name of the wrapper SDK that emitted this exception.
* Consists of the name of the SDK and the wrapper platform, e.g. "appcenter.xamarin", "appcenter.react-native" [optional].
*/
@property(nonatomic, copy) NSString *wrapperSdkName;
@end
#endif
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: c6b1399128237c3418a43818c440f036
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 13dc30a1adbf7ef4cb5cb8288b7403bf
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 94d46a1f780bb2444b074eef91732480
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,10 @@
framework module AppCenterCrashes {
umbrella header "AppCenterCrashes.h"
export *
module * { export * }
link framework "Foundation"
link "c++"
link "z"
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 28c04102b37191941b45b2e44c18a247
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,28 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#import <AppCenterCrashes/AppCenterCrashes.h>
#import <Foundation/Foundation.h>
#if __cplusplus
extern "C" {
#endif
void app_center_unity_crashes_set_delegate();
void app_center_unity_crashes_delegate_set_should_process_error_report_delegate(bool(*handler)(MSACErrorReport *));
void app_center_unity_crashes_delegate_set_get_error_attachments_delegate(NSArray<MSACErrorAttachmentLog *> *(*handler)(MSACErrorReport *));
void app_center_unity_crashes_delegate_set_sending_error_report_delegate(void(*handler)(MSACErrorReport *));
void app_center_unity_crashes_delegate_set_sent_error_report_delegate(void(*handler)(MSACErrorReport *));
void app_center_unity_crashes_delegate_set_failed_to_send_error_report_delegate(void(*handler)(MSACErrorReport *, NSError *));
#if __cplusplus
}
#endif
@interface UnityCrashesDelegate : NSObject<MSACCrashesDelegate>
-(BOOL)crashes:(MSACCrashes *)crashes shouldProcessErrorReport:(MSACErrorReport *)errorReport;
- (NSArray<MSACErrorAttachmentLog *> *)attachmentsWithCrashes:(MSACCrashes *)crashes forErrorReport:(MSACErrorReport *)errorReport;
- (void)crashes:(MSACCrashes *)crashes willSendErrorReport:(MSACErrorReport *)errorReport;
- (void)crashes:(MSACCrashes *)crashes didSucceedSendingErrorReport:(MSACErrorReport *)errorReport;
- (void)crashes:(MSACCrashes *)crashes didFailSendingErrorReport:(MSACErrorReport *)errorReport withError:(NSError *)error;
@end
@@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: 3d2d6964c557947c080946d2e04a23d8
timeCreated: 1497898485
licenseType: Pro
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
Any:
second:
enabled: 0
settings: {}
data:
first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
data:
first:
iPhone: iOS
second:
enabled: 1
settings: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,98 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#import "CrashesDelegate.h"
#import <AppCenterCrashes/AppCenterCrashes.h>
#import <Foundation/Foundation.h>
static bool (*shouldProcessErrorReport)(MSACErrorReport *);
static NSArray<MSACErrorAttachmentLog *>* (*getErrorAttachments)(MSACErrorReport *);
static void (*sendingErrorReport)(MSACErrorReport *);
static void (*sentErrorReport)(MSACErrorReport *);
static void (*failedToSendErrorReport)(MSACErrorReport *, NSError *);
// we need static instance var because we have weak reaf in native part
static UnityCrashesDelegate *unityCrashesDelegate = NULL;
void app_center_unity_crashes_set_delegate()
{
unityCrashesDelegate = [[UnityCrashesDelegate alloc] init];
[MSACCrashes setDelegate:unityCrashesDelegate];
}
void app_center_unity_crashes_delegate_set_should_process_error_report_delegate(bool(*handler)(MSACErrorReport *))
{
shouldProcessErrorReport = handler;
}
void app_center_unity_crashes_delegate_set_get_error_attachments_delegate(NSArray<MSACErrorAttachmentLog *> *(*handler)(MSACErrorReport *))
{
getErrorAttachments = handler;
}
void app_center_unity_crashes_delegate_set_sending_error_report_delegate(void(*handler)(MSACErrorReport *))
{
sendingErrorReport = handler;
}
void app_center_unity_crashes_delegate_set_sent_error_report_delegate(void(*handler)(MSACErrorReport *))
{
sentErrorReport = handler;
}
void app_center_unity_crashes_delegate_set_failed_to_send_error_report_delegate(void(*handler)(MSACErrorReport *, NSError *))
{
failedToSendErrorReport = handler;
}
@implementation UnityCrashesDelegate
-(BOOL)crashes:(MSACCrashes *)crashes shouldProcessErrorReport:(MSACErrorReport *)errorReport
{
if (shouldProcessErrorReport)
{
return (*shouldProcessErrorReport)(errorReport);
}
else
{
return true;
}
}
- (NSArray<MSACErrorAttachmentLog *> *)attachmentsWithCrashes:(MSACCrashes *)crashes forErrorReport:(MSACErrorReport *)errorReport
{
if (getErrorAttachments)
{
return (*getErrorAttachments)(errorReport);
}
else
{
return nil;
}
}
- (void)crashes:(MSACCrashes *)crashes willSendErrorReport:(MSACErrorReport *)errorReport
{
if (sendingErrorReport)
{
(*sendingErrorReport)(errorReport);
}
}
- (void)crashes:(MSACCrashes *)crashes didSucceedSendingErrorReport:(MSACErrorReport *)errorReport
{
if (sentErrorReport)
{
(*sentErrorReport)(errorReport);
}
}
- (void)crashes:(MSACCrashes *)crashes didFailSendingErrorReport:(MSACErrorReport *)errorReport withError:(NSError *)error
{
if (failedToSendErrorReport)
{
(*failedToSendErrorReport)(errorReport, error);
}
}
@end
@@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: a9c869882f9a649adb9261c6df148d95
timeCreated: 1497898475
licenseType: Pro
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
Any:
second:
enabled: 0
settings: {}
data:
first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
data:
first:
iPhone: iOS
second:
enabled: 1
settings: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,32 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#ifndef CRASHES_UNITY_H
#define CRASHES_UNITY_H
#import <Foundation/Foundation.h>
#import <AppCenterCrashes/AppCenterCrashes.h>
@class MSACExceptionModel;
extern "C" void* appcenter_unity_crashes_get_type();
extern "C" void* appcenter_unity_crashes_track_exception_with_properties_with_attachments(MSACExceptionModel* exception, char** propertyKeys, char** propertyValues, int propertyCount, NSArray<MSACErrorAttachmentLog*>* attachments);
extern "C" void appcenter_unity_crashes_set_enabled(bool isEnabled);
extern "C" bool appcenter_unity_crashes_has_received_memory_warning_in_last_session();
extern "C" bool appcenter_unity_crashes_is_enabled();
extern "C" void appcenter_unity_crashes_generate_test_crash();
extern "C" bool appcenter_unity_crashes_has_crashed_in_last_session();
extern "C" void appcenter_unity_crashes_disable_mach_exception_handler();
extern "C" void app_center_unity_crashes_set_user_confirmation_handler(void* userConfirmationHandler);
extern "C" void* appcenter_unity_crashes_last_session_crash_report();
extern "C" void appcenter_unity_crashes_set_user_confirmation_handler(bool(* userConfirmationHandler)());
extern "C" void appcenter_unity_crashes_notify_with_user_confirmation(int userConfirmation);
extern "C" void appcenter_unity_start_crashes();
extern "C" void* app_center_unity_crashes_create_error_attachments_array(int capacity);
extern "C" void* app_center_unity_crashes_create_error_attachment_log_text(char* text, char* fileName);
extern "C" void* app_center_unity_crashes_create_error_attachment_log_binary(const void* data, int size, char* fileName, char* contentType);
extern "C" void appcenter_unity_crashes_add_error_attachment(NSMutableArray<MSACErrorAttachmentLog*>* attachments, MSACErrorAttachmentLog* attachment);
extern "C" void appcenter_unity_crashes_send_error_attachments(char* errorReportId, NSMutableArray<MSACErrorAttachmentLog*>* attachments);
extern "C" void* appcenter_unity_crashes_build_handled_error_report(char* errorReportId);
#endif
@@ -0,0 +1,133 @@
fileFormatVersion: 2
guid: ab25d73a3ee1841b785a0d341fc692a1
timeCreated: 1497555275
licenseType: Pro
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
'': Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 1
Exclude Linux: 1
Exclude Linux64: 1
Exclude LinuxUniversal: 1
Exclude OSXIntel: 1
Exclude OSXIntel64: 1
Exclude OSXUniversal: 1
Exclude Tizen: 1
Exclude Win: 1
Exclude Win64: 1
Exclude iOS: 0
Exclude tvOS: 1
data:
first:
'': Editor
second:
enabled: 0
settings:
CPU: AnyCPU
OS: AnyOS
data:
first:
Android: Android
second:
enabled: 0
settings:
CPU: ARMv7
data:
first:
Any:
second:
enabled: 0
settings: {}
data:
first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
data:
first:
Facebook: Win
second:
enabled: 0
settings:
CPU: AnyCPU
data:
first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
data:
first:
Standalone: Linux
second:
enabled: 0
settings:
CPU: x86
data:
first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: x86_64
data:
first:
Standalone: OSXIntel
second:
enabled: 0
settings:
CPU: AnyCPU
data:
first:
Standalone: OSXIntel64
second:
enabled: 0
settings:
CPU: AnyCPU
data:
first:
Standalone: Win
second:
enabled: 0
settings:
CPU: AnyCPU
data:
first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
data:
first:
iPhone: iOS
second:
enabled: 1
settings:
CompileFlags:
FrameworkDependencies:
data:
first:
tvOS: tvOS
second:
enabled: 0
settings:
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,112 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#import <Foundation/Foundation.h>
#import <AppCenter/MSACAppCenter.h>
#import <AppCenterCrashes/MSACErrorAttachmentLog.h>
#import <AppCenterCrashes/MSACWrapperCrashesHelper.h>
#import "../Core/Utility/NSStringDictionaryHelper.h"
#import "../Core/Utility/NSStringHelper.h"
#import "CrashesUnity.h"
#import "CrashesDelegate.h"
#import "NSStringHelper.h"
void* appcenter_unity_crashes_get_type()
{
return (void *)CFBridgingRetain([MSACCrashes class]);
}
void* appcenter_unity_crashes_track_exception_with_properties_with_attachments(MSACExceptionModel* exception, char** propertyKeys, char** propertyValues, int propertyCount, NSArray<MSACErrorAttachmentLog*>* attachments)
{
NSDictionary<NSString*, NSString*> *properties = appcenter_unity_create_ns_string_dictionary(propertyKeys, propertyValues, propertyCount);
NSString *errorId = [MSACCrashes trackException:exception withProperties:properties attachments:attachments];
return (void *)appcenter_unity_ns_string_to_cstr(errorId);
}
void appcenter_unity_crashes_set_enabled(bool isEnabled)
{
[MSACCrashes setEnabled:isEnabled];
}
bool appcenter_unity_crashes_is_enabled()
{
return [MSACCrashes isEnabled];
}
bool appcenter_unity_crashes_has_received_memory_warning_in_last_session()
{
return [MSACCrashes hasReceivedMemoryWarningInLastSession];
}
void appcenter_unity_crashes_generate_test_crash()
{
[MSACCrashes generateTestCrash];
}
bool appcenter_unity_crashes_has_crashed_in_last_session()
{
return [MSACCrashes hasCrashedInLastSession];
}
void appcenter_unity_crashes_disable_mach_exception_handler()
{
[MSACCrashes disableMachExceptionHandler];
}
void appcenter_unity_crashes_set_user_confirmation_handler(bool(* userConfirmationHandler)())
{
[MSACCrashes setUserConfirmationHandler:^BOOL(NSArray<MSACErrorReport *> *_Nonnull errorReports){
return userConfirmationHandler();
}];
}
void appcenter_unity_crashes_notify_with_user_confirmation(int userConfirmation)
{
[MSACCrashes notifyWithUserConfirmation:(MSACUserConfirmation)userConfirmation];
}
void* appcenter_unity_crashes_last_session_crash_report()
{
return (void *)CFBridgingRetain([MSACCrashes lastSessionCrashReport]);
}
void appcenter_unity_start_crashes()
{
[MSACAppCenter startService:MSACCrashes.class];
}
void* app_center_unity_crashes_create_error_attachments_array(int capacity)
{
NSMutableArray<MSACErrorAttachmentLog *>* errorAttachments = [[NSMutableArray alloc] initWithCapacity:capacity];
return (void *)CFBridgingRetain(errorAttachments);
}
void* app_center_unity_crashes_create_error_attachment_log_text(char* text, char* fileName)
{
return (void *)CFBridgingRetain(
[[MSACErrorAttachmentLog alloc] initWithFilename:appcenter_unity_cstr_to_ns_string(fileName) attachmentText:appcenter_unity_cstr_to_ns_string(text)]);
}
void* app_center_unity_crashes_create_error_attachment_log_binary(const void* data, int size, char* fileName, char* contentType)
{
return (void *)CFBridgingRetain(
[[MSACErrorAttachmentLog alloc] initWithFilename:appcenter_unity_cstr_to_ns_string(fileName) attachmentBinary:[[NSData alloc] initWithBytes:data length:size] contentType:appcenter_unity_cstr_to_ns_string(contentType)]);
}
void appcenter_unity_crashes_add_error_attachment(NSMutableArray<MSACErrorAttachmentLog*>* attachments, MSACErrorAttachmentLog* attachment)
{
[attachments addObject:attachment];
}
void appcenter_unity_crashes_send_error_attachments(char* errorReportId, NSMutableArray<MSACErrorAttachmentLog*>* attachments)
{
NSString *errorReportIdConverted = appcenter_unity_cstr_to_ns_string(errorReportId);
[MSACWrapperCrashesHelper sendErrorAttachments:attachments withIncidentIdentifier:errorReportIdConverted];
}
void* appcenter_unity_crashes_build_handled_error_report(char* errorReportId)
{
NSString *errorReportIdConverted = appcenter_unity_cstr_to_ns_string(errorReportId);
MSACErrorReport *report = [MSACWrapperCrashesHelper buildHandledErrorReportWithErrorID:errorReportIdConverted];
return (void *)CFBridgingRetain(report);
}
@@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: 287d3bc4c5500456f822c8199c15d39d
timeCreated: 1497555258
licenseType: Pro
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
Any:
second:
enabled: 0
settings: {}
data:
first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
data:
first:
iPhone: iOS
second:
enabled: 1
settings: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,22 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
extern "C" const char* app_center_unity_crashes_error_report_incident_identifier(void* errorReport);
extern "C" const char* app_center_unity_crashes_error_report_reporter_key(void* errorReport);
extern "C" const char* app_center_unity_crashes_error_report_signal(void* errorReport);
extern "C" const char* app_center_unity_crashes_error_report_exception_name(void* errorReport);
extern "C" const char* app_center_unity_crashes_error_report_exception_reason(void* errorReport);
extern "C" const char* app_center_unity_crashes_error_report_app_start_time(void* errorReport);
extern "C" const char* app_center_unity_crashes_error_report_app_error_time(void* errorReport);
extern "C" void* app_center_unity_crashes_error_report_device(void* errorReport);
extern "C" unsigned int app_center_unity_crashes_error_report_app_process_identifier(void* errorReport);
extern "C" bool app_center_unity_crashes_error_report_is_app_kill(void* errorReport);
@@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: 4351c5b4fea0a4230885b9616c8f65d6
timeCreated: 1497897006
licenseType: Pro
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
Any:
second:
enabled: 0
settings: {}
data:
first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
data:
first:
iPhone: iOS
second:
enabled: 1
settings: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,72 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#import "../Core/Utility/NSStringHelper.h"
#import "ErrorReport.h"
#import <AppCenterCrashes/AppCenterCrashes.h>
const char* app_center_unity_crashes_error_report_incident_identifier(void* errorReport)
{
MSACErrorReport *report = (__bridge MSACErrorReport*)errorReport;
return appcenter_unity_ns_string_to_cstr([report incidentIdentifier]);
}
const char* app_center_unity_crashes_error_report_reporter_key(void* errorReport)
{
MSACErrorReport *report = (__bridge MSACErrorReport*)errorReport;
return appcenter_unity_ns_string_to_cstr([report reporterKey]);
}
const char* app_center_unity_crashes_error_report_signal(void* errorReport)
{
MSACErrorReport *report = (__bridge MSACErrorReport*)errorReport;
return appcenter_unity_ns_string_to_cstr([report signal]);
}
const char* app_center_unity_crashes_error_report_exception_name(void* errorReport)
{
MSACErrorReport *report = (__bridge MSACErrorReport*)errorReport;
return appcenter_unity_ns_string_to_cstr([report exceptionName]);
}
const char* app_center_unity_crashes_error_report_exception_reason(void* errorReport)
{
MSACErrorReport *report = (__bridge MSACErrorReport*)errorReport;
return appcenter_unity_ns_string_to_cstr([report exceptionReason]);
}
const char* app_center_unity_crashes_error_report_app_start_time(void* errorReport)
{
MSACErrorReport *report = (__bridge MSACErrorReport*)errorReport;
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss ZZZZZ"];
NSString *dateStr = [dateFormatter stringFromDate:report.appStartTime];
return appcenter_unity_ns_string_to_cstr(dateStr);
}
const char* app_center_unity_crashes_error_report_app_error_time(void* errorReport)
{
MSACErrorReport *report = (__bridge MSACErrorReport*)errorReport;
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss ZZZZZ"];
NSString *dateStr = [dateFormatter stringFromDate:report.appErrorTime];
return appcenter_unity_ns_string_to_cstr(dateStr);
}
extern "C" void* app_center_unity_crashes_error_report_device(void* errorReport)
{
MSACErrorReport *report = (__bridge MSACErrorReport*)errorReport;
return (__bridge void*)[report device];
}
extern "C" unsigned int app_center_unity_crashes_error_report_app_process_identifier(void* errorReport)
{
MSACErrorReport *report = (__bridge MSACErrorReport*)errorReport;
return [report appProcessIdentifier];
}
extern "C" bool app_center_unity_crashes_error_report_is_app_kill(void* errorReport)
{
MSACErrorReport *report = (__bridge MSACErrorReport*)errorReport;
return [report isAppKill];
}
@@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: 373d6e1aa99b14b85a73ca4cca134265
timeCreated: 1497897298
licenseType: Pro
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
Any:
second:
enabled: 0
settings: {}
data:
first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
data:
first:
iPhone: iOS
second:
enabled: 1
settings: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,9 @@
#import <Foundation/Foundation.h>
@interface MSACExceptionModel : NSObject
@property(nonatomic, copy) NSString *type;
@property(nonatomic, copy) NSString *message;
@property(nonatomic, copy) NSString *stackTrace;
@end
@@ -0,0 +1,27 @@
fileFormatVersion: 2
guid: a753e0df757854ab8a71dafb0331b58a
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,9 @@
#import <Foundation/Foundation.h>
#import "MSACExceptionModel.h"
@interface MSACWrapperExceptionModel : MSACExceptionModel
@property(nonatomic) NSArray<MSACWrapperExceptionModel *> *innerExceptions;
@property(nonatomic, copy) NSString *wrapperSdkName;
@end
@@ -0,0 +1,27 @@
fileFormatVersion: 2
guid: 47ae337184a0642259853aaf18b811be
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8edb5ff2554af495cb88a77ea5676751
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,25 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#if UNITY_IOS && !UNITY_EDITOR
using System;
using Exception = Microsoft.AppCenter.Unity.Crashes.Models.Exception;
namespace Microsoft.AppCenter.Unity.Internal.Utility
{
public static partial class NSErrorHelper
{
public static Exception Convert(IntPtr nsErrorPtr)
{
if (nsErrorPtr == IntPtr.Zero)
{
return null;
}
var domain = app_center_unity_nserror_domain(nsErrorPtr);
var errorCode = app_center_unity_nserror_code(nsErrorPtr);
var description = app_center_unity_nserror_description(nsErrorPtr);
return new Exception(string.Format("Domain: {0}, error code: {1}, description: {2}", domain, errorCode, description), string.Empty);
}
}
}
#endif
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9b2bb9c8db1e04201b0924f3bc174aa3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,13 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#import "MSACWrapperExceptionModel.h"
#import <Foundation/Foundation.h>
// Don't need to return value because reference is kept by wrapper
extern "C" MSACWrapperExceptionModel* appcenter_unity_exception_create();
extern "C" void appcenter_unity_exception_set_type(MSACWrapperExceptionModel* exception, char* type);
extern "C" void appcenter_unity_exception_set_message(MSACWrapperExceptionModel* exception, char* message);
extern "C" void appcenter_unity_exception_set_stacktrace(MSACWrapperExceptionModel* exception, char* stacktrace);
extern "C" void appcenter_unity_exception_set_inner_exception(MSACWrapperExceptionModel* exception, MSACWrapperExceptionModel* innerException);
extern "C" void appcenter_unity_exception_set_wrapper_sdk_name(MSACWrapperExceptionModel* exception, char* sdkName);
@@ -0,0 +1,26 @@
fileFormatVersion: 2
guid: dee271c84d16944c191f2cf03eb3e78b
timeCreated: 1512583535
licenseType: Free
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,38 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#import "NSStringHelper.h"
#import "WrapperException.h"
#import <Foundation/Foundation.h>
MSACWrapperExceptionModel* appcenter_unity_exception_create()
{
return [[MSACWrapperExceptionModel alloc] init];
}
void appcenter_unity_exception_set_type(MSACWrapperExceptionModel* exception, char* type)
{
[exception setType:[NSString stringWithUTF8String:type]];
}
void appcenter_unity_exception_set_message(MSACWrapperExceptionModel* exception, char* message)
{
[exception setMessage:[NSString stringWithUTF8String:message]];
}
void appcenter_unity_exception_set_stacktrace(MSACWrapperExceptionModel* exception, char* stacktrace)
{
[exception setStackTrace:appcenter_unity_cstr_to_ns_string(stacktrace)];
}
void appcenter_unity_exception_set_inner_exception(MSACWrapperExceptionModel* exception, MSACWrapperExceptionModel* innerException)
{
NSArray* innerExceptions = @[innerException];
[exception setInnerExceptions:innerExceptions];
}
void appcenter_unity_exception_set_wrapper_sdk_name(MSACWrapperExceptionModel* exception, char* sdkName)
{
[exception setWrapperSdkName:[NSString stringWithUTF8String:sdkName]];
}
@@ -0,0 +1,36 @@
fileFormatVersion: 2
guid: 41cdfabf1bde54e3e8c50ce2fabc6e2e
timeCreated: 1512583535
licenseType: Free
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
iPhone: iOS
second:
enabled: 1
settings: {}
- first:
tvOS: tvOS
second:
enabled: 1
settings: {}
userData:
assetBundleName:
assetBundleVariant: