app center;增加發送ping的秒
This commit is contained in:
1 parent
1bd1ffdb5a
commit
d754ff3b15
719 files changed
+34172
-2875
No files matched your search
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e1cd2eab2eada4ba5a8c61e7936efb75
|
||||
folderAsset: yes
|
||||
timeCreated: 1498060206
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,14 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
@class MSACAnalyticsTransmissionTarget;
|
||||
@class MSACEventProperties;
|
||||
|
||||
extern "C" void* appcenter_unity_analytics_get_type();
|
||||
extern "C" void appcenter_unity_analytics_track_event(char* eventName, int flags);
|
||||
extern "C" void appcenter_unity_analytics_track_event_with_properties(char* eventName, char** keys, char** values, int count, int flags);
|
||||
extern "C" void appcenter_unity_analytics_track_event_with_typed_properties(char* eventName, MSACEventProperties* properties, int flags);
|
||||
extern "C" void appcenter_unity_analytics_set_enabled(bool isEnabled);
|
||||
extern "C" bool appcenter_unity_analytics_is_enabled();
|
||||
extern "C" MSACAnalyticsTransmissionTarget *appcenter_unity_analytics_transmission_target_for_token(char* transmissionTargetToken);
|
||||
extern "C" void appcenter_unity_analytics_pause();
|
||||
extern "C" void appcenter_unity_analytics_resume();
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 823b802179bf34e73a8c4af069492a51
|
||||
timeCreated: 1497463489
|
||||
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,53 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#import "AnalyticsUnity.h"
|
||||
#import "../Core/Utility/NSStringDictionaryHelper.h"
|
||||
#import "AppCenterAnalytics/MSACAnalyticsTransmissionTarget.h"
|
||||
#import <AppCenterAnalytics/AppCenterAnalytics.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
void* appcenter_unity_analytics_get_type()
|
||||
{
|
||||
return (void *)CFBridgingRetain([MSACAnalytics class]);
|
||||
}
|
||||
|
||||
void appcenter_unity_analytics_track_event(char* eventName, int flags)
|
||||
{
|
||||
[MSACAnalytics trackEvent:[NSString stringWithUTF8String:eventName] withProperties:NULL flags:flags];
|
||||
}
|
||||
|
||||
void appcenter_unity_analytics_track_event_with_properties(char* eventName, char** keys, char** values, int count, int flags)
|
||||
{
|
||||
NSDictionary<NSString*, NSString*> *properties = appcenter_unity_create_ns_string_dictionary(keys, values, count);
|
||||
[MSACAnalytics trackEvent:[NSString stringWithUTF8String:eventName] withProperties:properties flags:flags];
|
||||
}
|
||||
|
||||
void appcenter_unity_analytics_track_event_with_typed_properties(char* eventName, MSACEventProperties* properties, int flags)
|
||||
{
|
||||
[MSACAnalytics trackEvent:[NSString stringWithUTF8String:eventName] withTypedProperties:properties flags:flags];
|
||||
}
|
||||
|
||||
void appcenter_unity_analytics_set_enabled(bool isEnabled)
|
||||
{
|
||||
[MSACAnalytics setEnabled:isEnabled];
|
||||
}
|
||||
|
||||
bool appcenter_unity_analytics_is_enabled()
|
||||
{
|
||||
return [MSACAnalytics isEnabled];
|
||||
}
|
||||
|
||||
MSACAnalyticsTransmissionTarget *appcenter_unity_analytics_transmission_target_for_token(char* transmissionTargetToken) {
|
||||
return [MSACAnalytics transmissionTargetForToken: [NSString stringWithUTF8String:transmissionTargetToken]];
|
||||
}
|
||||
|
||||
void appcenter_unity_analytics_pause()
|
||||
{
|
||||
[MSACAnalytics pause];
|
||||
}
|
||||
|
||||
void appcenter_unity_analytics_resume()
|
||||
{
|
||||
[MSACAnalytics resume];
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ec5e4839aa90b4ec58bd780f4df4ba79
|
||||
timeCreated: 1497463463
|
||||
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,141 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 01273e5b6815941469a14a851d1a086f
|
||||
folderAsset: yes
|
||||
timeCreated: 1504718816
|
||||
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 Win: 1
|
||||
Exclude Win64: 1
|
||||
Exclude iOS: 0
|
||||
Exclude tvOS: 1
|
||||
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:
|
||||
CPU: AnyCPU
|
||||
DefaultValueInitialized: true
|
||||
OS: AnyOS
|
||||
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: LinuxUniversal
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
data:
|
||||
first:
|
||||
Standalone: OSXIntel
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Standalone: OSXIntel64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Standalone: OSXUniversal
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
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:
|
||||
BIN
Binary file not shown.
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d8d92c39ed6d2874bbaa8bcbb6228fc8
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7cade50e60d30634e9137e0531f5497f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#if __has_include(<AppCenterAnalytics/MSACAnalytics.h>)
|
||||
#import <AppCenterAnalytics/MSACAnalytics.h>
|
||||
#import <AppCenterAnalytics/MSACAnalyticsAuthenticationProvider.h>
|
||||
#import <AppCenterAnalytics/MSACAnalyticsAuthenticationProviderDelegate.h>
|
||||
#import <AppCenterAnalytics/MSACAnalyticsTransmissionTarget.h>
|
||||
#import <AppCenterAnalytics/MSACEventLog.h>
|
||||
#import <AppCenterAnalytics/MSACEventProperties.h>
|
||||
#else
|
||||
#import "MSACAnalytics.h"
|
||||
#import "MSACAnalyticsAuthenticationProvider.h"
|
||||
#import "MSACAnalyticsAuthenticationProviderDelegate.h"
|
||||
#import "MSACAnalyticsTransmissionTarget.h"
|
||||
#import "MSACEventLog.h"
|
||||
#import "MSACEventProperties.h"
|
||||
#endif
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5671683276579b640b2e8a10135f3e07
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+226
@@ -0,0 +1,226 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#ifndef MSAC_ANALYTICS_H
|
||||
#define MSAC_ANALYTICS_H
|
||||
|
||||
#if __has_include(<AppCenter/MSACServiceAbstract.h>)
|
||||
#import <AppCenter/MSACServiceAbstract.h>
|
||||
#else
|
||||
#import "MSACServiceAbstract.h"
|
||||
#endif
|
||||
|
||||
#if __has_include(<AppCenterAnalytics/MSACAnalyticsTransmissionTarget.h>)
|
||||
#import <AppCenterAnalytics/MSACAnalyticsTransmissionTarget.h>
|
||||
#else
|
||||
#import "MSACAnalyticsTransmissionTarget.h"
|
||||
#endif
|
||||
|
||||
@class MSACEventProperties;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* App Center analytics service.
|
||||
*/
|
||||
NS_SWIFT_NAME(Analytics)
|
||||
@interface MSACAnalytics : MSACServiceAbstract
|
||||
|
||||
/**
|
||||
* Track an event.
|
||||
*
|
||||
* @param eventName Event name. Cannot be `nil` or empty.
|
||||
*
|
||||
* @discussion Validation rules apply depending on the configured secret.
|
||||
*
|
||||
* For App Center, the name cannot be longer than 256 and is truncated otherwise.
|
||||
*
|
||||
* For One Collector, the name needs to match the `[a-zA-Z0-9]((\.(?!(\.|$)))|[_a-zA-Z0-9]){3,99}` regular expression.
|
||||
*/
|
||||
+ (void)trackEvent:(NSString *)eventName;
|
||||
|
||||
/**
|
||||
* Track a custom event with optional string properties.
|
||||
*
|
||||
* @param eventName Event name. Cannot be `nil` or empty.
|
||||
* @param properties Dictionary of properties. Keys and values must not be `nil`.
|
||||
*
|
||||
* @discussion Additional validation rules apply depending on the configured secret.
|
||||
*
|
||||
* For App Center:
|
||||
*
|
||||
* - The event name cannot be longer than 256 and is truncated otherwise.
|
||||
*
|
||||
* - The property names cannot be empty.
|
||||
*
|
||||
* - The property names and values are limited to 125 characters each (truncated).
|
||||
*
|
||||
* - The number of properties per event is limited to 20 (truncated).
|
||||
*
|
||||
*
|
||||
* For One Collector:
|
||||
*
|
||||
* - The event name needs to match the `[a-zA-Z0-9]((\.(?!(\.|$)))|[_a-zA-Z0-9]){3,99}` regular expression.
|
||||
*
|
||||
* - The `baseData` and `baseDataType` properties are reserved and thus discarded.
|
||||
*
|
||||
* - The full event size when encoded as a JSON string cannot be larger than 1.9MB.
|
||||
*/
|
||||
+ (void)trackEvent:(NSString *)eventName withProperties:(nullable NSDictionary<NSString *, NSString *> *)properties;
|
||||
|
||||
/**
|
||||
* Track a custom event with optional string properties.
|
||||
*
|
||||
* @param eventName Event name. Cannot be `nil` or empty.
|
||||
* @param properties Dictionary of properties. Keys and values must not be `nil`.
|
||||
* @param flags Optional flags. Events tracked with the MSACFlagsCritical flag will take precedence over all other events in
|
||||
* storage. An event tracked with this option will only be dropped if storage must make room for a newer event that is also marked with the
|
||||
* MSACFlagsCritical flag.
|
||||
*
|
||||
* @discussion Additional validation rules apply depending on the configured secret.
|
||||
*
|
||||
* For App Center:
|
||||
*
|
||||
* - The event name cannot be longer than 256 and is truncated otherwise.
|
||||
*
|
||||
* - The property names cannot be empty.
|
||||
*
|
||||
* - The property names and values are limited to 125 characters each (truncated).
|
||||
*
|
||||
* - The number of properties per event is limited to 20 (truncated).
|
||||
*
|
||||
*
|
||||
* For One Collector:
|
||||
*
|
||||
* - The event name needs to match the `[a-zA-Z0-9]((\.(?!(\.|$)))|[_a-zA-Z0-9]){3,99}` regular expression.
|
||||
*
|
||||
* - The `baseData` and `baseDataType` properties are reserved and thus discarded.
|
||||
*
|
||||
* - The full event size when encoded as a JSON string cannot be larger than 1.9MB.
|
||||
*/
|
||||
+ (void)trackEvent:(NSString *)eventName withProperties:(nullable NSDictionary<NSString *, NSString *> *)properties flags:(MSACFlags)flags;
|
||||
|
||||
/**
|
||||
* Track a custom event with name and optional typed properties.
|
||||
*
|
||||
* @param eventName Event name.
|
||||
* @param properties Typed properties.
|
||||
*
|
||||
* @discussion The following validation rules are applied:
|
||||
*
|
||||
* The name cannot be null or empty.
|
||||
*
|
||||
* The property names or values cannot be null.
|
||||
*
|
||||
* Double values must be finite (NaN or Infinite values are discarded).
|
||||
*
|
||||
* Additional validation rules apply depending on the configured secret.
|
||||
*
|
||||
*
|
||||
* For App Center:
|
||||
*
|
||||
* - The event name cannot be longer than 256 and is truncated otherwise.
|
||||
*
|
||||
* - The property names cannot be empty.
|
||||
*
|
||||
* - The property names and values are limited to 125 characters each (truncated).
|
||||
*
|
||||
* - The number of properties per event is limited to 20 (truncated).
|
||||
*
|
||||
*
|
||||
* For One Collector:
|
||||
*
|
||||
* - The event name needs to match the `[a-zA-Z0-9]((\.(?!(\.|$)))|[_a-zA-Z0-9]){3,99}` regular expression.
|
||||
*
|
||||
* - The `baseData` and `baseDataType` properties are reserved and thus discarded.
|
||||
*
|
||||
* - The full event size when encoded as a JSON string cannot be larger than 1.9MB.
|
||||
*/
|
||||
+ (void)trackEvent:(NSString *)eventName
|
||||
withTypedProperties:(nullable MSACEventProperties *)properties NS_SWIFT_NAME(trackEvent(_:withProperties:));
|
||||
|
||||
/**
|
||||
* Track a custom event with name and optional typed properties.
|
||||
*
|
||||
* @param eventName Event name.
|
||||
* @param properties Typed properties.
|
||||
* @param flags Optional flags. Events tracked with the MSACFlagsCritical flag will take precedence over all other events in
|
||||
* storage. An event tracked with this option will only be dropped if storage must make room for a newer event that is also marked with the
|
||||
* MSACFlagsCritical flag.
|
||||
*
|
||||
* @discussion The following validation rules are applied:
|
||||
*
|
||||
* The name cannot be null or empty.
|
||||
*
|
||||
* The property names or values cannot be null.
|
||||
*
|
||||
* Double values must be finite (NaN or Infinite values are discarded).
|
||||
*
|
||||
* Additional validation rules apply depending on the configured secret.
|
||||
*
|
||||
*
|
||||
* For App Center:
|
||||
*
|
||||
* - The event name cannot be longer than 256 and is truncated otherwise.
|
||||
*
|
||||
* - The property names cannot be empty.
|
||||
*
|
||||
* - The property names and values are limited to 125 characters each (truncated).
|
||||
*
|
||||
* - The number of properties per event is limited to 20 (truncated).
|
||||
*
|
||||
*
|
||||
* For One Collector:
|
||||
*
|
||||
* - The event name needs to match the `[a-zA-Z0-9]((\.(?!(\.|$)))|[_a-zA-Z0-9]){3,99}` regular expression.
|
||||
*
|
||||
* - The `baseData` and `baseDataType` properties are reserved and thus discarded.
|
||||
*
|
||||
* - The full event size when encoded as a JSON string cannot be larger than 1.9MB.
|
||||
*/
|
||||
+ (void)trackEvent:(NSString *)eventName
|
||||
withTypedProperties:(nullable MSACEventProperties *)properties
|
||||
flags:(MSACFlags)flags NS_SWIFT_NAME(trackEvent(_:withProperties:flags:));
|
||||
|
||||
/**
|
||||
* Pause transmission of Analytics logs. While paused, Analytics logs are saved to disk.
|
||||
*
|
||||
* @see resume
|
||||
*/
|
||||
+ (void)pause;
|
||||
|
||||
/**
|
||||
* Resume transmission of Analytics logs. Any Analytics logs that accumulated on disk while paused are sent to the
|
||||
* server.
|
||||
*
|
||||
* @see pause
|
||||
*/
|
||||
+ (void)resume;
|
||||
|
||||
/**
|
||||
* Get a transmission target.
|
||||
*
|
||||
* @param token The token of the transmission target to retrieve.
|
||||
*
|
||||
* @returns The transmission target object.
|
||||
*
|
||||
* @discussion This method does not need to be annotated with
|
||||
* NS_SWIFT_NAME(transmissionTarget(forToken:)) as this is a static method that
|
||||
* doesn't get translated like a setter in Swift.
|
||||
*
|
||||
* @see MSACAnalyticsTransmissionTarget for comparison.
|
||||
*/
|
||||
+ (MSACAnalyticsTransmissionTarget *)transmissionTargetForToken:(NSString *)token NS_SWIFT_NAME(transmissionTarget(forToken:));
|
||||
|
||||
/**
|
||||
* Send time interval for non-critical logs.
|
||||
* Must be between 3 seconds and 86400 seconds (1 day).
|
||||
* Must be called before Analytics service start.
|
||||
*/
|
||||
@property(class, atomic) NSUInteger transmissionInterval;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
#endif
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3473372458d99dd4380fb6fcf94bba02
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#if __has_include(<AppCenterAnalytics/MSACAnalyticsAuthenticationProviderDelegate.h>)
|
||||
#import <AppCenterAnalytics/MSACAnalyticsAuthenticationProviderDelegate.h>
|
||||
#else
|
||||
#import "MSACAnalyticsAuthenticationProviderDelegate.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Different authentication types, e.g. MSA Compact, MSA Delegate, AAD,... .
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, MSACAnalyticsAuthenticationType) {
|
||||
|
||||
/**
|
||||
* AuthenticationType MSA Compact.
|
||||
*/
|
||||
MSACAnalyticsAuthenticationTypeMsaCompact,
|
||||
|
||||
/**
|
||||
* AuthenticationType MSA Delegate.
|
||||
*/
|
||||
MSACAnalyticsAuthenticationTypeMsaDelegate
|
||||
} NS_SWIFT_NAME(AnalyticsAuthenticationType);
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
NS_SWIFT_NAME(AnalyticsAuthenticationProvider)
|
||||
@interface MSACAnalyticsAuthenticationProvider : NSObject
|
||||
|
||||
/**
|
||||
* The type.
|
||||
*/
|
||||
@property(nonatomic, readonly, assign) MSACAnalyticsAuthenticationType type;
|
||||
|
||||
/**
|
||||
* The ticket key for this authentication provider.
|
||||
*/
|
||||
@property(nonatomic, readonly, copy) NSString *ticketKey;
|
||||
|
||||
/**
|
||||
* The ticket key as hash.
|
||||
*/
|
||||
@property(nonatomic, readonly, copy) NSString *ticketKeyHash;
|
||||
|
||||
@property(nonatomic, readonly, weak) id<MSACAnalyticsAuthenticationProviderDelegate> delegate;
|
||||
|
||||
/**
|
||||
* Create a new authentication provider.
|
||||
*
|
||||
* @param type The type for the provider, e.g. MSA.
|
||||
* @param ticketKey The ticket key for the provider.
|
||||
* @param delegate The delegate.
|
||||
*
|
||||
* @return A new authentication provider.
|
||||
*/
|
||||
- (instancetype)initWithAuthenticationType:(MSACAnalyticsAuthenticationType)type
|
||||
ticketKey:(NSString *)ticketKey
|
||||
delegate:(id<MSACAnalyticsAuthenticationProviderDelegate>)delegate;
|
||||
|
||||
/**
|
||||
* Check expiration.
|
||||
*/
|
||||
- (void)checkTokenExpiry;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4fa38c820b4f8344987390d4fdbc460e
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class MSACAnalyticsAuthenticationProvider;
|
||||
|
||||
/**
|
||||
* Completion handler that returns the authentication token and the expiry date.
|
||||
*/
|
||||
typedef void (^MSACAnalyticsAuthenticationProviderCompletionBlock)(NSString *token, NSDate *expiryDate)
|
||||
NS_SWIFT_NAME(AnalyticsAuthenticationProviderCompletionBlock);
|
||||
|
||||
NS_SWIFT_NAME(AnalyticsAuthenticationProviderDelegate)
|
||||
@protocol MSACAnalyticsAuthenticationProviderDelegate <NSObject>
|
||||
|
||||
/**
|
||||
* Required method that needs to be called from within your authentication flow to provide the authentication token and expiry date.
|
||||
*
|
||||
* @param authenticationProvider The authentication provider.
|
||||
* @param completionHandler The completion handler.
|
||||
*/
|
||||
- (void)authenticationProvider:(MSACAnalyticsAuthenticationProvider *)authenticationProvider
|
||||
acquireTokenWithCompletionHandler:(MSACAnalyticsAuthenticationProviderCompletionBlock)completionHandler;
|
||||
|
||||
@end
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d008ae0697fc93244809b8e7db9306a1
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+151
@@ -0,0 +1,151 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#ifndef ANALYTICS_TRANSMISSION_TARGET
|
||||
#define ANALYTICS_TRANSMISSION_TARGET
|
||||
|
||||
#if __has_include(<AppCenter/MSACConstants+Flags.h>)
|
||||
#import <AppCenter/MSACConstants+Flags.h>
|
||||
#else
|
||||
#import "MSACConstants+Flags.h"
|
||||
#endif
|
||||
|
||||
#if __has_include(<AppCenterAnalytics/MSACAnalyticsAuthenticationProvider.h>)
|
||||
#import <AppCenterAnalytics/MSACAnalyticsAuthenticationProvider.h>
|
||||
#import <AppCenterAnalytics/MSACPropertyConfigurator.h>
|
||||
#else
|
||||
#import "MSACAnalyticsAuthenticationProvider.h"
|
||||
#import "MSACPropertyConfigurator.h"
|
||||
#endif
|
||||
|
||||
@class MSACEventProperties;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
NS_SWIFT_NAME(AnalyticsTransmissionTarget)
|
||||
@interface MSACAnalyticsTransmissionTarget : NSObject
|
||||
|
||||
/**
|
||||
* Property configurator.
|
||||
*/
|
||||
@property(nonatomic, readonly, strong) MSACPropertyConfigurator *propertyConfigurator;
|
||||
|
||||
+ (void)addAuthenticationProvider:(MSACAnalyticsAuthenticationProvider *)authenticationProvider
|
||||
NS_SWIFT_NAME(addAuthenticationProvider(authenticationProvider:));
|
||||
|
||||
/**
|
||||
* Track an event.
|
||||
*
|
||||
* @param eventName event name.
|
||||
*/
|
||||
- (void)trackEvent:(NSString *)eventName;
|
||||
|
||||
/**
|
||||
* Track an event.
|
||||
*
|
||||
* @param eventName event name.
|
||||
* @param properties dictionary of properties.
|
||||
*/
|
||||
- (void)trackEvent:(NSString *)eventName withProperties:(nullable NSDictionary<NSString *, NSString *> *)properties;
|
||||
|
||||
/**
|
||||
* Track an event.
|
||||
*
|
||||
* @param eventName event name.
|
||||
* @param properties dictionary of properties.
|
||||
* @param flags Optional flags. Events tracked with the MSACFlagsCritical flag will take precedence over all other events in
|
||||
* storage. An event tracked with this option will only be dropped if storage must make room for a newer event that is also marked with the
|
||||
* MSACFlagsCritical flag.
|
||||
*/
|
||||
- (void)trackEvent:(NSString *)eventName withProperties:(nullable NSDictionary<NSString *, NSString *> *)properties flags:(MSACFlags)flags;
|
||||
|
||||
/**
|
||||
* Track a custom event with name and optional typed properties.
|
||||
*
|
||||
* @param eventName Event name.
|
||||
* @param properties Typed properties.
|
||||
*
|
||||
* @discussion The following validation rules are applied:
|
||||
*
|
||||
* The name cannot be null or empty.
|
||||
*
|
||||
* The property names or values cannot be null.
|
||||
*
|
||||
* Double values must be finite (NaN or Infinite values are discarded).
|
||||
*
|
||||
* Additional validation rules apply depending on the configured secret.
|
||||
*
|
||||
* - The event name needs to match the `[a-zA-Z0-9]((\.(?!(\.|$)))|[_a-zA-Z0-9]){3,99}` regular expression.
|
||||
*
|
||||
* - The `baseData` and `baseDataType` properties are reserved and thus discarded.
|
||||
*
|
||||
* - The full event size when encoded as a JSON string cannot be larger than 1.9MB.
|
||||
*/
|
||||
- (void)trackEvent:(NSString *)eventName
|
||||
withTypedProperties:(nullable MSACEventProperties *)properties NS_SWIFT_NAME(trackEvent(_:withProperties:));
|
||||
|
||||
/**
|
||||
* Track a custom event with name and optional typed properties.
|
||||
*
|
||||
* @param eventName Event name.
|
||||
* @param properties Typed properties.
|
||||
* @param flags Optional flags. Events tracked with the MSACFlagsCritical flag will take precedence over all other events in
|
||||
* storage. An event tracked with this option will only be dropped if storage must make room for a newer event that is also marked with the
|
||||
* MSACFlagsCritical flag.
|
||||
*
|
||||
* @discussion The following validation rules are applied:
|
||||
*
|
||||
* The name cannot be null or empty.
|
||||
*
|
||||
* The property names or values cannot be null.
|
||||
*
|
||||
* Double values must be finite (NaN or Infinite values are discarded).
|
||||
*
|
||||
* Additional validation rules apply depending on the configured secret.
|
||||
*
|
||||
* - The event name needs to match the `[a-zA-Z0-9]((\.(?!(\.|$)))|[_a-zA-Z0-9]){3,99}` regular expression.
|
||||
*
|
||||
* - The `baseData` and `baseDataType` properties are reserved and thus discarded.
|
||||
*
|
||||
* - The full event size when encoded as a JSON string cannot be larger than 1.9MB.
|
||||
*/
|
||||
- (void)trackEvent:(NSString *)eventName
|
||||
withTypedProperties:(nullable MSACEventProperties *)properties
|
||||
flags:(MSACFlags)flags NS_SWIFT_NAME(trackEvent(_:withProperties:flags:));
|
||||
|
||||
/**
|
||||
* Get a nested transmission target.
|
||||
*
|
||||
* @param token The token of the transmission target to retrieve.
|
||||
*
|
||||
* @returns A transmission target object nested to this parent transmission target.
|
||||
*/
|
||||
- (MSACAnalyticsTransmissionTarget *)transmissionTargetForToken:(NSString *)token NS_SWIFT_NAME(transmissionTarget(forToken:));
|
||||
|
||||
/**
|
||||
* The flag indicates whether or not this transmission target is enabled. Changing its state will also change states of nested transmission
|
||||
* targets.
|
||||
*/
|
||||
@property(nonatomic, getter=isEnabled, setter=setEnabled:) BOOL enabled NS_SWIFT_NAME(enabled);
|
||||
|
||||
/**
|
||||
* Pause sending logs for the transmission target. It doesn't pause any of its decendants.
|
||||
*
|
||||
* @see resume
|
||||
*/
|
||||
- (void)pause;
|
||||
|
||||
/**
|
||||
* Resume sending logs for the transmission target.
|
||||
*
|
||||
* @see pause
|
||||
*/
|
||||
- (void)resume;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
#endif
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e679e838621c788498b6a6921a2d1891
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#ifndef MSAC_EVENT_LOG_H
|
||||
#define MSAC_EVENT_LOG_H
|
||||
|
||||
#if __has_include(<AppCenterAnalytics/MSACLogWithNameAndProperties.h>)
|
||||
#import <AppCenterAnalytics/MSACLogWithNameAndProperties.h>
|
||||
#else
|
||||
#import "MSACLogWithNameAndProperties.h"
|
||||
#endif
|
||||
|
||||
@class MSACEventProperties;
|
||||
@class MSACMetadataExtension;
|
||||
|
||||
NS_SWIFT_NAME(EventLog)
|
||||
@interface MSACEventLog : MSACLogWithNameAndProperties
|
||||
|
||||
/**
|
||||
* Unique identifier for this event.
|
||||
*/
|
||||
@property(nonatomic, copy) NSString *eventId;
|
||||
|
||||
/**
|
||||
* Event properties.
|
||||
*/
|
||||
@property(nonatomic, strong) MSACEventProperties *typedProperties;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0902c9e162e77da4d95ce9e7abb68d6b
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#ifndef EVENT_PROPERTIES
|
||||
#define EVENT_PROPERTIES
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* Contains typed event properties.
|
||||
*/
|
||||
NS_SWIFT_NAME(EventProperties)
|
||||
@interface MSACEventProperties : NSObject
|
||||
|
||||
/**
|
||||
* Set a string property.
|
||||
*
|
||||
* @param value Property value.
|
||||
* @param key Property key.
|
||||
*/
|
||||
- (instancetype)setString:(NSString *)value forKey:(NSString *)key NS_SWIFT_NAME(setEventProperty(_:forKey:));
|
||||
|
||||
/**
|
||||
* Set a double property.
|
||||
*
|
||||
* @param value Property value. Must be finite (`NAN` and `INFINITY` not allowed).
|
||||
* @param key Property key.
|
||||
*/
|
||||
- (instancetype)setDouble:(double)value forKey:(NSString *)key NS_SWIFT_NAME(setEventProperty(_:forKey:));
|
||||
|
||||
/**
|
||||
* Set a 64-bit integer property.
|
||||
*
|
||||
* @param value Property value.
|
||||
* @param key Property key.
|
||||
*/
|
||||
- (instancetype)setInt64:(int64_t)value forKey:(NSString *)key NS_SWIFT_NAME(setEventProperty(_:forKey:));
|
||||
|
||||
/**
|
||||
* Set a boolean property.
|
||||
*
|
||||
* @param value Property value.
|
||||
* @param key Property key.
|
||||
*/
|
||||
- (instancetype)setBool:(BOOL)value forKey:(NSString *)key NS_SWIFT_NAME(setEventProperty(_:forKey:));
|
||||
|
||||
/**
|
||||
* Set a date property.
|
||||
*
|
||||
* @param value Property value.
|
||||
* @param key Property key.
|
||||
*/
|
||||
- (instancetype)setDate:(NSDate *)value forKey:(NSString *)key NS_SWIFT_NAME(setEventProperty(_:forKey:));
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
#endif
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1d97250c889532742a1dc59f6bb144fe
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#ifndef MSAC_LOG_WITH_NAME_PROPERTIES_H
|
||||
#define MSAC_LOG_WITH_NAME_PROPERTIES_H
|
||||
|
||||
#if __has_include(<AppCenter/MSACLogWithProperties.h>)
|
||||
#import <AppCenter/MSACLogWithProperties.h>
|
||||
#else
|
||||
#import "MSACLogWithProperties.h"
|
||||
#endif
|
||||
|
||||
NS_SWIFT_NAME(LogWithNameAndProperties)
|
||||
@interface MSACLogWithNameAndProperties : MSACLogWithProperties
|
||||
|
||||
/**
|
||||
* Name of the event.
|
||||
*/
|
||||
@property(nonatomic, copy) NSString *name;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bb716b435deaa234bb4eb6cd025b33f8
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
NS_SWIFT_NAME(PropertyConfigurator)
|
||||
@interface MSACPropertyConfigurator : NSObject
|
||||
|
||||
/**
|
||||
* Override the application version.
|
||||
*
|
||||
*/
|
||||
@property(nonatomic, copy) NSString *_Nullable appVersion;
|
||||
|
||||
/**
|
||||
* Override the application name.
|
||||
*
|
||||
*/
|
||||
@property(nonatomic, copy) NSString *_Nullable appName;
|
||||
|
||||
/**
|
||||
* Override the application locale.
|
||||
*
|
||||
*/
|
||||
@property(nonatomic, copy) NSString *_Nullable appLocale;
|
||||
|
||||
/**
|
||||
* User identifier.
|
||||
* The identifier needs to start with c: or i: or d: or w: prefixes.
|
||||
*
|
||||
*/
|
||||
@property(nonatomic, copy) NSString *_Nullable userId;
|
||||
|
||||
/**
|
||||
* Set a string event property to be attached to events tracked by this transmission target and its child transmission targets.
|
||||
*
|
||||
* @param propertyValue Property value.
|
||||
* @param propertyKey Property key.
|
||||
*
|
||||
* @discussion A property set in a child transmission target overrides a property with the same key inherited from its parents. Also, the
|
||||
* properties passed to the `trackEvent:withProperties:` or `trackEvent:withTypedProperties:` override any property with the same key from
|
||||
* the transmission target itself or its parents.
|
||||
*/
|
||||
- (void)setEventPropertyString:(NSString *)propertyValue forKey:(NSString *)propertyKey NS_SWIFT_NAME(setEventProperty(_:forKey:));
|
||||
|
||||
/**
|
||||
* Set a double event property to be attached to events tracked by this transmission target and its child transmission targets.
|
||||
*
|
||||
* @param propertyValue Property value. Must be finite (`NAN` and `INFINITY` not allowed).
|
||||
* @param propertyKey Property key.
|
||||
*
|
||||
* @discussion A property set in a child transmission target overrides a property with the same key inherited from its parents. Also, the
|
||||
* properties passed to the `trackEvent:withProperties:` or `trackEvent:withTypedProperties:` override any property with the same key from
|
||||
* the transmission target itself or its parents.
|
||||
*/
|
||||
- (void)setEventPropertyDouble:(double)propertyValue forKey:(NSString *)propertyKey NS_SWIFT_NAME(setEventProperty(_:forKey:));
|
||||
|
||||
/**
|
||||
* Set a 64-bit integer event property to be attached to events tracked by this transmission target and its child transmission targets.
|
||||
*
|
||||
* @param propertyValue Property value.
|
||||
* @param propertyKey Property key.
|
||||
*
|
||||
* @discussion A property set in a child transmission target overrides a property with the same key inherited from its parents. Also, the
|
||||
* properties passed to the `trackEvent:withProperties:` or `trackEvent:withTypedProperties:` override any property with the same key from
|
||||
* the transmission target itself or its parents.
|
||||
*/
|
||||
- (void)setEventPropertyInt64:(int64_t)propertyValue forKey:(NSString *)propertyKey NS_SWIFT_NAME(setEventProperty(_:forKey:));
|
||||
|
||||
/**
|
||||
* Set a boolean event property to be attached to events tracked by this transmission target and its child transmission targets.
|
||||
*
|
||||
* @param propertyValue Property value.
|
||||
* @param propertyKey Property key.
|
||||
*
|
||||
* @discussion A property set in a child transmission target overrides a property with the same key inherited from its parents. Also, the
|
||||
* properties passed to the `trackEvent:withProperties:` or `trackEvent:withTypedProperties:` override any property with the same key from
|
||||
* the transmission target itself or its parents.
|
||||
*/
|
||||
- (void)setEventPropertyBool:(BOOL)propertyValue forKey:(NSString *)propertyKey NS_SWIFT_NAME(setEventProperty(_:forKey:));
|
||||
|
||||
/**
|
||||
* Set a date event property to be attached to events tracked by this transmission target and its child transmission targets.
|
||||
*
|
||||
* @param propertyValue Property value.
|
||||
* @param propertyKey Property key.
|
||||
*
|
||||
* @discussion A property set in a child transmission target overrides a property with the same key inherited from its parents. Also, the
|
||||
* properties passed to the `trackEvent:withProperties:` or `trackEvent:withTypedProperties:` override any property with the same key from
|
||||
* the transmission target itself or its parents.
|
||||
*/
|
||||
- (void)setEventPropertyDate:(NSDate *)propertyValue forKey:(NSString *)propertyKey NS_SWIFT_NAME(setEventProperty(_:forKey:));
|
||||
|
||||
/**
|
||||
* Remove an event property from this transmission target.
|
||||
*
|
||||
* @param propertyKey Property key.
|
||||
*
|
||||
* @discussion This won't remove properties with the same name declared in other nested transmission targets.
|
||||
*/
|
||||
- (void)removeEventPropertyForKey:(NSString *)propertyKey NS_SWIFT_NAME(removeEventProperty(forKey:));
|
||||
|
||||
/**
|
||||
* Once called, the App Center SDK will automatically add UIDevice.identifierForVendor to common schema logs.
|
||||
*
|
||||
* @discussion Call this before starting the SDK. This setting is not persisted, so you need to call this when setting up the SDK every
|
||||
* time. If you want to provide a way for users to opt-in or opt-out of this setting, it is on you to persist their choice and configure the
|
||||
* App Center SDK accordingly.
|
||||
*/
|
||||
- (void)collectDeviceId;
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@end
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 581ad62ec224e1d46aaadab82594a86d
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6c8f51f1638667e4692b42add0000832
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4f47cef2ad03b5e41a058289bbd14d0f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
framework module AppCenterAnalytics {
|
||||
umbrella header "AppCenterAnalytics.h"
|
||||
|
||||
export *
|
||||
module * { export * }
|
||||
|
||||
link framework "Foundation"
|
||||
link framework "UIKit"
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4e2e82330586b4248abbc582f821018a
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,11 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
@class MSACEventProperties;
|
||||
|
||||
extern "C" void* appcenter_unity_analytics_create_event_properties();
|
||||
extern "C" void appcenter_unity_analytics_event_properties_set_string(MSACEventProperties *properties, char* key, char* value);
|
||||
extern "C" void appcenter_unity_analytics_event_properties_set_long(MSACEventProperties *properties, char* key, long value);
|
||||
extern "C" void appcenter_unity_analytics_event_properties_set_double(MSACEventProperties *properties, char* key, double value);
|
||||
extern "C" void appcenter_unity_analytics_event_properties_set_bool(MSACEventProperties *properties, char* key, BOOL value);
|
||||
extern "C" void appcenter_unity_analytics_event_properties_set_date(MSACEventProperties *properties, char* key, NSDate* value);
|
||||
@@ -0,0 +1,24 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f0b3627d2041e4d7cbcce23973265495
|
||||
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,30 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#import "EventProperties.h"
|
||||
#import "AppCenterAnalytics/MSACEventProperties.h"
|
||||
#import "../Core/Utility/NSDateHelper.h"
|
||||
|
||||
void* appcenter_unity_analytics_create_event_properties() {
|
||||
return (void *)CFBridgingRetain([[MSACEventProperties alloc] init]);
|
||||
}
|
||||
|
||||
void appcenter_unity_analytics_event_properties_set_string(MSACEventProperties *properties, char* key, char* val) {
|
||||
[properties setString:[NSString stringWithUTF8String:val] forKey:[NSString stringWithUTF8String:key]];
|
||||
}
|
||||
|
||||
void appcenter_unity_analytics_event_properties_set_long(MSACEventProperties *properties, char* key, long val) {
|
||||
[properties setInt64:val forKey:[NSString stringWithUTF8String:key]];
|
||||
}
|
||||
|
||||
void appcenter_unity_analytics_event_properties_set_double(MSACEventProperties *properties, char* key, double val) {
|
||||
[properties setDouble:val forKey:[NSString stringWithUTF8String:key]];
|
||||
}
|
||||
|
||||
void appcenter_unity_analytics_event_properties_set_bool(MSACEventProperties *properties, char* key, BOOL val) {
|
||||
[properties setBool:val forKey:[NSString stringWithUTF8String:key]];
|
||||
}
|
||||
|
||||
void appcenter_unity_analytics_event_properties_set_date(MSACEventProperties *properties, char* key, NSDate* val) {
|
||||
[properties setDate:val forKey:[NSString stringWithUTF8String:key]];
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8fd6bd9f1854544168e917be8b9b629d
|
||||
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:
|
||||
@@ -0,0 +1,16 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
@class MSACPropertyConfigurator;
|
||||
|
||||
extern "C" void appcenter_unity_property_configurator_set_app_name(MSACPropertyConfigurator *configurator, char* appName);
|
||||
extern "C" void appcenter_unity_property_configurator_set_user_id(MSACPropertyConfigurator *configurator, char* userId);
|
||||
extern "C" void appcenter_unity_property_configurator_set_app_version(MSACPropertyConfigurator *configurator, char* appVersion);
|
||||
extern "C" void appcenter_unity_property_configurator_set_app_locale(MSACPropertyConfigurator *configurator, char* appLocale);
|
||||
extern "C" void appcenter_unity_property_configurator_collect_device_id(MSACPropertyConfigurator *configurator);
|
||||
extern "C" void appcenter_unity_property_configurator_set_event_property(MSACPropertyConfigurator *configurator, char* key, char* value);
|
||||
extern "C" void appcenter_unity_property_configurator_set_event_datetime_property(MSACPropertyConfigurator *configurator, char* key, NSDate* value);
|
||||
extern "C" void appcenter_unity_property_configurator_set_event_long_property(MSACPropertyConfigurator *configurator, char* key, long value);
|
||||
extern "C" void appcenter_unity_property_configurator_set_event_double_property(MSACPropertyConfigurator *configurator, char* key, double value);
|
||||
extern "C" void appcenter_unity_property_configurator_set_event_bool_property(MSACPropertyConfigurator *configurator, char* key, bool value);
|
||||
extern "C" void appcenter_unity_property_configurator_remove_event_property(MSACPropertyConfigurator *configurator, char* key);
|
||||
@@ -0,0 +1,24 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ff4aa16e3073345a89fc2bfb9b9209c8
|
||||
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,51 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#import "PropertyConfigurator.h"
|
||||
#import "AppCenterAnalytics/MSACPropertyConfigurator.h"
|
||||
#import "../Core/Utility/NSStringHelper.h"
|
||||
#import "../Core/Utility/NSStringDictionaryHelper.h"
|
||||
|
||||
void appcenter_unity_property_configurator_set_app_name(MSACPropertyConfigurator *configurator, char* appName) {
|
||||
[configurator setAppName: appcenter_unity_cstr_to_ns_string(appName)];
|
||||
}
|
||||
|
||||
void appcenter_unity_property_configurator_set_user_id(MSACPropertyConfigurator *configurator, char* userId) {
|
||||
[configurator setUserId: appcenter_unity_cstr_to_ns_string(userId)];
|
||||
}
|
||||
|
||||
void appcenter_unity_property_configurator_set_app_version(MSACPropertyConfigurator *configurator, char* appVersion) {
|
||||
[configurator setAppVersion: appcenter_unity_cstr_to_ns_string(appVersion)];
|
||||
}
|
||||
|
||||
void appcenter_unity_property_configurator_set_app_locale(MSACPropertyConfigurator *configurator, char* appLocale) {
|
||||
[configurator setAppLocale: appcenter_unity_cstr_to_ns_string(appLocale)];
|
||||
}
|
||||
|
||||
void appcenter_unity_property_configurator_collect_device_id(MSACPropertyConfigurator *configurator) {
|
||||
[configurator collectDeviceId];
|
||||
}
|
||||
|
||||
void appcenter_unity_property_configurator_set_event_property(MSACPropertyConfigurator *configurator, char* key, char* value) {
|
||||
[configurator setEventPropertyString: [NSString stringWithUTF8String:value] forKey: [NSString stringWithUTF8String:key]];
|
||||
}
|
||||
|
||||
void appcenter_unity_property_configurator_set_event_long_property(MSACPropertyConfigurator *configurator, char* key, long value) {
|
||||
[configurator setEventPropertyInt64:value forKey: [NSString stringWithUTF8String:key]];
|
||||
}
|
||||
|
||||
void appcenter_unity_property_configurator_set_event_double_property(MSACPropertyConfigurator *configurator, char* key, double value) {
|
||||
[configurator setEventPropertyDouble:value forKey: [NSString stringWithUTF8String:key]];
|
||||
}
|
||||
|
||||
void appcenter_unity_property_configurator_set_event_bool_property(MSACPropertyConfigurator *configurator, char* key, bool value) {
|
||||
[configurator setEventPropertyBool:value forKey: [NSString stringWithUTF8String:key]];
|
||||
}
|
||||
|
||||
void appcenter_unity_property_configurator_set_event_datetime_property(MSACPropertyConfigurator *configurator, char* key, NSDate* value) {
|
||||
[configurator setEventPropertyDate:value forKey: [NSString stringWithUTF8String:key]];
|
||||
}
|
||||
|
||||
void appcenter_unity_property_configurator_remove_event_property(MSACPropertyConfigurator *configurator, char* key) {
|
||||
[configurator removeEventPropertyForKey: [NSString stringWithUTF8String:key]];
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0d4638790df50445699ec091b3b3dc19
|
||||
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:
|
||||
@@ -0,0 +1,20 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class MSACAnalyticsTransmissionTarget;
|
||||
@class MSACPropertyConfigurator;
|
||||
@class MSACEventProperties;
|
||||
|
||||
extern "C" void appcenter_unity_transmission_target_track_event(MSACAnalyticsTransmissionTarget *transmission, char* eventName, int flags);
|
||||
extern "C" void appcenter_unity_transmission_target_set_enabled(MSACAnalyticsTransmissionTarget *transmission, BOOL enabled);
|
||||
extern "C" BOOL appcenter_unity_transmission_target_is_enabled(MSACAnalyticsTransmissionTarget *transmission);
|
||||
extern "C" void appcenter_unity_transmission_target_track_event_with_props(MSACAnalyticsTransmissionTarget *transmission, char* eventName, char** keys, char** values, int count, int flags);
|
||||
extern "C" void appcenter_unity_transmission_target_track_event_with_typed_props(MSACAnalyticsTransmissionTarget *transmission, char* eventName, MSACEventProperties* properties, int flags);
|
||||
extern "C" MSACAnalyticsTransmissionTarget *appcenter_unity_transmission_transmission_target_for_token(MSACAnalyticsTransmissionTarget *transmissionParent, char* transmissionTargetToken);
|
||||
extern "C" MSACPropertyConfigurator *appcenter_unity_transmission_get_property_configurator(MSACAnalyticsTransmissionTarget *transmission);
|
||||
extern "C" void appcenter_unity_transmission_pause(MSACAnalyticsTransmissionTarget *transmission);
|
||||
extern "C" void appcenter_unity_transmission_resume(MSACAnalyticsTransmissionTarget *transmission);
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 49b44566d6998432b8c7b76272ae2f85
|
||||
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,46 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#import "TransmissionTarget.h"
|
||||
#import "AppCenterAnalytics/MSACAnalyticsTransmissionTarget.h"
|
||||
#import "AppCenterAnalytics/MSACPropertyConfigurator.h"
|
||||
#import "../Core/Utility/NSStringDictionaryHelper.h"
|
||||
|
||||
void appcenter_unity_transmission_target_track_event(MSACAnalyticsTransmissionTarget *transmission, char* eventName, int flags) {
|
||||
[transmission trackEvent:[NSString stringWithUTF8String:eventName] withProperties:NULL flags:flags];
|
||||
}
|
||||
|
||||
void appcenter_unity_transmission_target_track_event_with_props(MSACAnalyticsTransmissionTarget *transmission, char* eventName, char** keys, char** values, int count, int flags) {
|
||||
NSDictionary<NSString*, NSString*> *properties = appcenter_unity_create_ns_string_dictionary(keys, values, count);
|
||||
[transmission trackEvent:[NSString stringWithUTF8String:eventName] withProperties: properties flags:flags];
|
||||
}
|
||||
|
||||
void appcenter_unity_transmission_target_track_event_with_typed_props(MSACAnalyticsTransmissionTarget *transmission, char* eventName, MSACEventProperties* properties, int flags) {
|
||||
[transmission trackEvent: [NSString stringWithUTF8String:eventName] withTypedProperties:properties flags:flags];
|
||||
}
|
||||
|
||||
void appcenter_unity_transmission_target_set_enabled(MSACAnalyticsTransmissionTarget *transmission, BOOL enabled) {
|
||||
[transmission setEnabled: enabled];
|
||||
}
|
||||
|
||||
BOOL appcenter_unity_transmission_target_is_enabled(MSACAnalyticsTransmissionTarget *transmission) {
|
||||
return [transmission isEnabled];
|
||||
}
|
||||
|
||||
MSACAnalyticsTransmissionTarget *appcenter_unity_transmission_transmission_target_for_token(MSACAnalyticsTransmissionTarget *transmissionParent, char* transmissionTargetToken) {
|
||||
return [transmissionParent transmissionTargetForToken: [NSString stringWithUTF8String:transmissionTargetToken]];
|
||||
}
|
||||
|
||||
MSACPropertyConfigurator *appcenter_unity_transmission_get_property_configurator(MSACAnalyticsTransmissionTarget *transmission) {
|
||||
return [transmission propertyConfigurator];
|
||||
}
|
||||
|
||||
void appcenter_unity_transmission_pause(MSACAnalyticsTransmissionTarget *transmission)
|
||||
{
|
||||
[transmission pause];
|
||||
}
|
||||
|
||||
void appcenter_unity_transmission_resume(MSACAnalyticsTransmissionTarget *transmission)
|
||||
{
|
||||
[transmission resume];
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5d1d93c1fa55346b5a911a45646c9795
|
||||
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:
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: caf6d21aeae2a415fa74bef339878f2e
|
||||
folderAsset: yes
|
||||
timeCreated: 1498060186
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,140 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4d7f499ac3ac1457ab2825691b1e86ff
|
||||
folderAsset: yes
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- 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 WebGL: 1
|
||||
Exclude Win: 1
|
||||
Exclude Win64: 1
|
||||
Exclude WindowsStoreApps: 1
|
||||
Exclude iOS: 0
|
||||
Exclude tvOS: 1
|
||||
- first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: ARMv7
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
DefaultValueInitialized: true
|
||||
OS: AnyOS
|
||||
- first:
|
||||
Facebook: Win
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
- first:
|
||||
Facebook: Win64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
- first:
|
||||
Standalone: Linux
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: x86
|
||||
- first:
|
||||
Standalone: Linux64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: x86_64
|
||||
- first:
|
||||
Standalone: LinuxUniversal
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
- first:
|
||||
Standalone: OSXIntel
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
- first:
|
||||
Standalone: OSXIntel64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
- first:
|
||||
Standalone: OSXUniversal
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
- first:
|
||||
Standalone: Win
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
- first:
|
||||
Standalone: Win64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
- first:
|
||||
Windows Store Apps: WindowsStoreApps
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
DontProcess: false
|
||||
PlaceholderPath:
|
||||
SDK: AnySDK
|
||||
ScriptingBackend: AnyScriptingBackend
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
CompileFlags:
|
||||
FrameworkDependencies: CoreTelephony;
|
||||
- first:
|
||||
tvOS: tvOS
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CompileFlags:
|
||||
FrameworkDependencies:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 63aaab9aaf628e244ae90893c4033933
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e873f826ffc8503449715ca3c1678105
|
||||
folderAsset: yes
|
||||
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/MSACAppCenter.h>)
|
||||
#import <AppCenter/MSACAbstractLog.h>
|
||||
#import <AppCenter/MSACAppCenter.h>
|
||||
#import <AppCenter/MSACAppCenterErrors.h>
|
||||
#import <AppCenter/MSACChannelGroupProtocol.h>
|
||||
#import <AppCenter/MSACChannelProtocol.h>
|
||||
#import <AppCenter/MSACConstants+Flags.h>
|
||||
#import <AppCenter/MSACConstants.h>
|
||||
#import <AppCenter/MSACCustomProperties.h>
|
||||
#import <AppCenter/MSACDevice.h>
|
||||
#import <AppCenter/MSACEnable.h>
|
||||
#import <AppCenter/MSACLog.h>
|
||||
#import <AppCenter/MSACLogWithProperties.h>
|
||||
#import <AppCenter/MSACLogger.h>
|
||||
#import <AppCenter/MSACSerializableObject.h>
|
||||
#import <AppCenter/MSACService.h>
|
||||
#import <AppCenter/MSACServiceAbstract.h>
|
||||
#import <AppCenter/MSACWrapperLogger.h>
|
||||
#import <AppCenter/MSACWrapperSdk.h>
|
||||
#else
|
||||
#import "MSACAbstractLog.h"
|
||||
#import "MSACAppCenter.h"
|
||||
#import "MSACAppCenterErrors.h"
|
||||
#import "MSACChannelGroupProtocol.h"
|
||||
#import "MSACChannelProtocol.h"
|
||||
#import "MSACConstants+Flags.h"
|
||||
#import "MSACConstants.h"
|
||||
#import "MSACCustomProperties.h"
|
||||
#import "MSACDevice.h"
|
||||
#import "MSACEnable.h"
|
||||
#import "MSACLog.h"
|
||||
#import "MSACLogWithProperties.h"
|
||||
#import "MSACLogger.h"
|
||||
#import "MSACSerializableObject.h"
|
||||
#import "MSACService.h"
|
||||
#import "MSACServiceAbstract.h"
|
||||
#import "MSACWrapperLogger.h"
|
||||
#import "MSACWrapperSdk.h"
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5afde213a96bedc408ef9ca393f75c40
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,14 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#ifndef MSAC_ABSTRACT_LOG_H
|
||||
#define MSAC_ABSTRACT_LOG_H
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_SWIFT_NAME(AbstractLog)
|
||||
@interface MSACAbstractLog : NSObject
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d269040c8d236c94493aa6c0fa69c34b
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,203 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#ifndef MSAC_APP_CENTER
|
||||
#define MSAC_APP_CENTER
|
||||
|
||||
#if __has_include(<AppCenter/MSACConstants.h>)
|
||||
#import <AppCenter/MSACConstants.h>
|
||||
#else
|
||||
#import "MSACConstants.h"
|
||||
#endif
|
||||
|
||||
@class MSACWrapperSdk;
|
||||
|
||||
#if !TARGET_OS_TV
|
||||
@class MSACCustomProperties;
|
||||
#endif
|
||||
|
||||
NS_SWIFT_NAME(AppCenter)
|
||||
@interface MSACAppCenter : NSObject
|
||||
|
||||
/**
|
||||
* Returns the singleton instance of MSACAppCenter.
|
||||
*/
|
||||
+ (instancetype)sharedInstance;
|
||||
|
||||
/**
|
||||
* Configure the SDK with an application secret.
|
||||
*
|
||||
* @param appSecret A unique and secret key used to identify the application.
|
||||
*
|
||||
* @discussion This may be called only once per application process lifetime.
|
||||
*/
|
||||
+ (void)configureWithAppSecret:(NSString *)appSecret NS_SWIFT_NAME(configure(withAppSecret:));
|
||||
|
||||
/**
|
||||
* Configure the SDK.
|
||||
*
|
||||
* @discussion This may be called only once per application process lifetime.
|
||||
*/
|
||||
+ (void)configure;
|
||||
|
||||
/**
|
||||
* Configure the SDK with an application secret and an array of services to start.
|
||||
*
|
||||
* @param appSecret A unique and secret key used to identify the application.
|
||||
* @param services Array of services to start.
|
||||
*
|
||||
* @discussion This may be called only once per application process lifetime.
|
||||
*/
|
||||
+ (void)start:(NSString *)appSecret withServices:(NSArray<Class> *)services NS_SWIFT_NAME(start(withAppSecret:services:));
|
||||
|
||||
/**
|
||||
* Start the SDK with an array of services.
|
||||
*
|
||||
* @param services Array of services to start.
|
||||
*
|
||||
* @discussion This may be called only once per application process lifetime.
|
||||
*/
|
||||
+ (void)startWithServices:(NSArray<Class> *)services NS_SWIFT_NAME(start(services:));
|
||||
|
||||
/**
|
||||
* Start a service.
|
||||
*
|
||||
* @param service A service to start.
|
||||
*
|
||||
* @discussion This may be called only once per service per application process lifetime.
|
||||
*/
|
||||
+ (void)startService:(Class)service;
|
||||
|
||||
/**
|
||||
* Configure the SDK with an array of services to start from a library. This will not start the service at application level, it will enable
|
||||
* the service only for the library.
|
||||
*
|
||||
* @param services Array of services to start.
|
||||
*/
|
||||
+ (void)startFromLibraryWithServices:(NSArray<Class> *)services NS_SWIFT_NAME(startFromLibrary(services:));
|
||||
|
||||
/**
|
||||
* The flag indicates whether the SDK has already been configured or not.
|
||||
*/
|
||||
@property(class, atomic, readonly, getter=isConfigured) BOOL configured;
|
||||
|
||||
/**
|
||||
* The flag indicates whether app is running in App Center Test Cloud.
|
||||
*/
|
||||
@property(class, atomic, readonly, getter=isRunningInAppCenterTestCloud) BOOL runningInAppCenterTestCloud;
|
||||
|
||||
/**
|
||||
* The flag indicates whether or not the SDK was enabled as a whole
|
||||
*
|
||||
* The state is persisted in the device's storage across application launches.
|
||||
*/
|
||||
@property(class, nonatomic, getter=isEnabled, setter=setEnabled:) BOOL enabled NS_SWIFT_NAME(enabled);
|
||||
|
||||
/**
|
||||
* Flag indicating whether SDK can send network requests.
|
||||
*
|
||||
* The state is persisted in the device's storage across application launches.
|
||||
*/
|
||||
@property(class, nonatomic, getter=isNetworkRequestsAllowed, setter=setNetworkRequestsAllowed:)
|
||||
BOOL networkRequestsAllowed NS_SWIFT_NAME(networkRequestsAllowed);
|
||||
|
||||
/**
|
||||
* The SDK's log level.
|
||||
*/
|
||||
@property(class, nonatomic) MSACLogLevel logLevel;
|
||||
|
||||
/**
|
||||
* Base URL to use for backend communication.
|
||||
*/
|
||||
@property(class, nonatomic, strong) NSString *logUrl;
|
||||
|
||||
/**
|
||||
* Set log handler.
|
||||
*/
|
||||
@property(class, nonatomic) MSACLogHandler logHandler;
|
||||
|
||||
/**
|
||||
* Set wrapper SDK information to use when building device properties. This is intended in case you are building a SDK that uses the App
|
||||
* Center SDK under the hood, e.g. our Xamarin SDK or ReactNative SDk.
|
||||
*/
|
||||
@property(class, nonatomic, strong) MSACWrapperSdk *wrapperSdk;
|
||||
|
||||
#if !TARGET_OS_TV
|
||||
/**
|
||||
* Set the custom properties.
|
||||
*
|
||||
* @param customProperties Custom properties object.
|
||||
*/
|
||||
+ (void)setCustomProperties:(MSACCustomProperties *)customProperties;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Check whether the application delegate forwarder is enabled or not.
|
||||
*
|
||||
* @discussion The application delegate forwarder forwards messages that target your application delegate methods via swizzling to the SDK.
|
||||
* It simplifies the SDK integration but may not be suitable to any situations. For
|
||||
* instance it should be disabled if you or one of your third party SDK is doing message forwarding on the application delegate. Message
|
||||
* forwarding usually implies the implementation of @see NSObject#forwardingTargetForSelector: or @see NSObject#forwardInvocation: methods.
|
||||
* To disable the application delegate forwarder just add the `AppCenterAppDelegateForwarderEnabled` tag to your Info .plist file and set it
|
||||
* to `0`. Then you will have to forward any application delegate needed by the SDK manually.
|
||||
*/
|
||||
@property(class, readonly, nonatomic, getter=isAppDelegateForwarderEnabled) BOOL appDelegateForwarderEnabled;
|
||||
|
||||
/**
|
||||
* Unique installation identifier.
|
||||
*
|
||||
*/
|
||||
@property(class, readonly, nonatomic) NSUUID *installId;
|
||||
|
||||
/**
|
||||
* Detect if a debugger is attached to the app process. This is only invoked once on app startup and can not detect
|
||||
* if the debugger is being attached during runtime!
|
||||
*
|
||||
*/
|
||||
@property(class, readonly, nonatomic, getter=isDebuggerAttached) BOOL debuggerAttached;
|
||||
|
||||
/**
|
||||
* Current version of AppCenter SDK.
|
||||
*
|
||||
*/
|
||||
@property(class, readonly, nonatomic) NSString *sdkVersion;
|
||||
|
||||
/**
|
||||
* Set the maximum size of the internal storage. This method must be called before App Center is started. This method is only intended for
|
||||
* applications.
|
||||
*
|
||||
* @param sizeInBytes Maximum size of the internal storage in bytes. This will be rounded up to the nearest multiple of a SQLite page size
|
||||
* (default is 4096 bytes). Values below 20,480 bytes (20 KiB) will be ignored.
|
||||
*
|
||||
* @param completionHandler Callback that is invoked when the database size has been set. The `BOOL` parameter is `YES` if changing the size
|
||||
* is successful, and `NO` otherwise. This parameter can be null.
|
||||
*
|
||||
* @discussion This only sets the maximum size of the database, but App Center modules might store additional data.
|
||||
* The value passed to this method is not persisted on disk. The default maximum database size is 10485760 bytes (10 MiB).
|
||||
*/
|
||||
+ (void)setMaxStorageSize:(long)sizeInBytes completionHandler:(void (^)(BOOL))completionHandler;
|
||||
|
||||
/**
|
||||
* Set the user identifier.
|
||||
*
|
||||
* @discussion Set the user identifier for logs sent for the default target token when the secret passed in @c
|
||||
* MSACAppCenter:start:withServices: contains "target={targetToken}".
|
||||
*
|
||||
* For App Center backend the user identifier maximum length is 256 characters.
|
||||
*
|
||||
* AppCenter must be configured or started before this API can be used.
|
||||
*/
|
||||
@property(class, nonatomic, strong) NSString *userId;
|
||||
|
||||
/**
|
||||
* Set country code to use when building device properties.
|
||||
*
|
||||
* @see https://www.iso.org/obp/ui/#search for more information.
|
||||
*/
|
||||
@property(class, nonatomic, strong) NSString *countryCode;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d6c0b87fe2f081c4085d18397fe5e706
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,41 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#ifndef MSAC_APP_CENTER_ERRORS_H
|
||||
#define MSAC_APP_CENTER_ERRORS_H
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#define MSAC_APP_CENTER_BASE_DOMAIN @"com.Microsoft.AppCenter."
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
#pragma mark - Domain
|
||||
|
||||
static NSString *const kMSACACErrorDomain = MSAC_APP_CENTER_BASE_DOMAIN @"ErrorDomain";
|
||||
|
||||
#pragma mark - General
|
||||
|
||||
// Error codes.
|
||||
NS_ENUM(NSInteger){MSACACLogInvalidContainerErrorCode = 1, MSACACCanceledErrorCode = 2, MSACACDisabledErrorCode = 3};
|
||||
|
||||
// Error descriptions.
|
||||
static NSString const *kMSACACLogInvalidContainerErrorDesc = @"Invalid log container.";
|
||||
static NSString const *kMSACACCanceledErrorDesc = @"The operation was canceled.";
|
||||
static NSString const *kMSACACDisabledErrorDesc = @"The service is disabled.";
|
||||
|
||||
#pragma mark - Connection
|
||||
|
||||
// Error codes.
|
||||
NS_ENUM(NSInteger){MSACACConnectionPausedErrorCode = 100, MSACACConnectionHttpErrorCode = 101};
|
||||
|
||||
// Error descriptions.
|
||||
static NSString const *kMSACACConnectionHttpErrorDesc = @"An HTTP error occured.";
|
||||
static NSString const *kMSACACConnectionPausedErrorDesc = @"Canceled, connection paused with log deletion.";
|
||||
|
||||
// Error user info keys.
|
||||
static NSString const *kMSACACConnectionHttpCodeErrorKey = @"MSConnectionHttpCode";
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
#endif
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2e2ffb05ce25fa74c844373a605ebe88
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+87
@@ -0,0 +1,87 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#ifndef MSAC_CHANNEL_GROUP_PROTOCOL_H
|
||||
#define MSAC_CHANNEL_GROUP_PROTOCOL_H
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#if __has_include(<AppCenter/MSACChannelProtocol.h>)
|
||||
#import <AppCenter/MSACChannelProtocol.h>
|
||||
#else
|
||||
#import "MSACChannelProtocol.h"
|
||||
#endif
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class MSACChannelUnitConfiguration;
|
||||
|
||||
@protocol MSACIngestionProtocol;
|
||||
@protocol MSACChannelUnitProtocol;
|
||||
|
||||
/**
|
||||
* `MSACChannelGroupProtocol` represents a kind of channel that contains constituent MSACChannelUnit objects. When an operation from the
|
||||
* `MSACChannelProtocol` is performed on the group, that operation should be propagated to its constituent MSACChannelUnit objects.
|
||||
*/
|
||||
NS_SWIFT_NAME(ChannelGroupProtocol)
|
||||
@protocol MSACChannelGroupProtocol <MSACChannelProtocol>
|
||||
|
||||
/**
|
||||
* Initialize a channel unit with the given configuration.
|
||||
*
|
||||
* @param configuration channel configuration.
|
||||
*
|
||||
* @return The added `MSACChannelUnitProtocol`. Use this object to enqueue logs.
|
||||
*/
|
||||
- (id<MSACChannelUnitProtocol>)addChannelUnitWithConfiguration:(MSACChannelUnitConfiguration *)configuration
|
||||
NS_SWIFT_NAME(addChannelUnit(withConfiguration:));
|
||||
|
||||
/**
|
||||
* Initialize a channel unit with the given configuration.
|
||||
*
|
||||
* @param configuration channel configuration.
|
||||
* @param ingestion The alternative ingestion object
|
||||
*
|
||||
* @return The added `MSACChannelUnitProtocol`. Use this object to enqueue logs.
|
||||
*/
|
||||
- (id<MSACChannelUnitProtocol>)addChannelUnitWithConfiguration:(MSACChannelUnitConfiguration *)configuration
|
||||
withIngestion:(nullable id<MSACIngestionProtocol>)ingestion
|
||||
NS_SWIFT_NAME(addChannelUnit(_:ingestion:));
|
||||
|
||||
/**
|
||||
* Change the base URL (schema + authority + port only) used to communicate with the backend.
|
||||
*/
|
||||
@property(nonatomic, strong) NSString *_Nullable logUrl;
|
||||
|
||||
/**
|
||||
* Set the app secret.
|
||||
*/
|
||||
@property(nonatomic, strong) NSString *_Nullable appSecret;
|
||||
|
||||
/**
|
||||
* Set the maximum size of the internal storage. This method must be called before App Center is started.
|
||||
*
|
||||
* @discussion The default maximum database size is 10485760 bytes (10 MiB).
|
||||
*
|
||||
* @param sizeInBytes Maximum size of the internal storage in bytes. This will be rounded up to the nearest multiple of a SQLite page size
|
||||
* (default is 4096 bytes). Values below 24576 bytes (24 KiB) will be ignored.
|
||||
* @param completionHandler Callback that is invoked when the database size has been set. The `BOOL` parameter is `YES` if changing the size
|
||||
* is successful, and `NO` otherwise.
|
||||
*/
|
||||
- (void)setMaxStorageSize:(long)sizeInBytes
|
||||
completionHandler:(nullable void (^)(BOOL))completionHandler NS_SWIFT_NAME(setMaxStorageSize(_:completionHandler:));
|
||||
|
||||
/**
|
||||
* Return a channel unit instance for the given groupId.
|
||||
*
|
||||
* @param groupId The group ID for a channel unit.
|
||||
*
|
||||
* @return A channel unit instance or `nil`.
|
||||
*/
|
||||
- (nullable id<MSACChannelUnitProtocol>)channelUnitForGroupId:(NSString *)groupId;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
#endif
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 59b4c9ccf873ec14aac775ea6355576b
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,68 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#ifndef MSAC_CHANNEL_PROTOCOL_H
|
||||
#define MSAC_CHANNEL_PROTOCOL_H
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#if __has_include(<AppCenter/MSACEnable.h>)
|
||||
#import <AppCenter/MSACEnable.h>
|
||||
#else
|
||||
#import "MSACEnable.h"
|
||||
#endif
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol MSACChannelDelegate;
|
||||
|
||||
/**
|
||||
* `MSACChannelProtocol` contains the essential operations of a channel. Channels are broadly responsible for enqueuing logs to be sent to
|
||||
* the backend and/or stored on disk.
|
||||
*/
|
||||
NS_SWIFT_NAME(ChannelProtocol)
|
||||
@protocol MSACChannelProtocol <NSObject, MSACEnable>
|
||||
|
||||
/**
|
||||
* Add delegate.
|
||||
*
|
||||
* @param delegate delegate.
|
||||
*/
|
||||
- (void)addDelegate:(id<MSACChannelDelegate>)delegate;
|
||||
|
||||
/**
|
||||
* Remove delegate.
|
||||
*
|
||||
* @param delegate delegate.
|
||||
*/
|
||||
- (void)removeDelegate:(id<MSACChannelDelegate>)delegate;
|
||||
|
||||
/**
|
||||
* Pause operations, logs will be stored but not sent.
|
||||
*
|
||||
* @param identifyingObject Object used to identify the pause request.
|
||||
*
|
||||
* @discussion A paused channel doesn't forward logs to the ingestion. The identifying object used to pause the channel can be any unique
|
||||
* object. The same identifying object must be used to call resume. For simplicity if the caller is the one owning the channel then @c self
|
||||
* can be used as identifying object.
|
||||
*
|
||||
* @see resumeWithIdentifyingObject:
|
||||
*/
|
||||
- (void)pauseWithIdentifyingObject:(id<NSObject>)identifyingObject;
|
||||
|
||||
/**
|
||||
* Resume operations, logs can be sent again.
|
||||
*
|
||||
* @param identifyingObject Object used to passed to the pause method.
|
||||
*
|
||||
* @discussion The channel only resume when all the outstanding identifying objects have been resumed.
|
||||
*
|
||||
* @see pauseWithIdentifyingObject:
|
||||
*/
|
||||
- (void)resumeWithIdentifyingObject:(id<NSObject>)identifyingObject;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
#endif
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5c86ac1e5f839b34e9fea988dde215ab
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,18 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#ifndef MSAC_CONSTANTS_FLAGS_H
|
||||
#define MSAC_CONSTANTS_FLAGS_H
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
typedef NS_OPTIONS(NSUInteger, MSACFlags) {
|
||||
MSACFlagsNone = (0 << 0), // => 00000000
|
||||
MSACFlagsNormal = (1 << 0), // => 00000001
|
||||
MSACFlagsCritical = (1 << 1), // => 00000010
|
||||
MSACFlagsPersistenceNormal DEPRECATED_MSG_ATTRIBUTE("please use MSACFlagsNormal") = MSACFlagsNormal,
|
||||
MSACFlagsPersistenceCritical DEPRECATED_MSG_ATTRIBUTE("please use MSACFlagsCritical") = MSACFlagsCritical,
|
||||
MSACFlagsDefault = MSACFlagsNormal
|
||||
} NS_SWIFT_NAME(Flags);
|
||||
|
||||
#endif
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 691d011af5ecef846b0bf1232358d6fd
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,170 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
/**
|
||||
* Log Levels
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, MSACLogLevel) {
|
||||
|
||||
/**
|
||||
* Logging will be very chatty
|
||||
*/
|
||||
MSACLogLevelVerbose = 2,
|
||||
|
||||
/**
|
||||
* Debug information will be logged
|
||||
*/
|
||||
MSACLogLevelDebug = 3,
|
||||
|
||||
/**
|
||||
* Information will be logged
|
||||
*/
|
||||
MSACLogLevelInfo = 4,
|
||||
|
||||
/**
|
||||
* Errors and warnings will be logged
|
||||
*/
|
||||
MSACLogLevelWarning = 5,
|
||||
|
||||
/**
|
||||
* Errors will be logged
|
||||
*/
|
||||
MSACLogLevelError = 6,
|
||||
|
||||
/**
|
||||
* Only critical errors will be logged
|
||||
*/
|
||||
MSACLogLevelAssert = 7,
|
||||
|
||||
/**
|
||||
* Logging is disabled
|
||||
*/
|
||||
MSACLogLevelNone = 99
|
||||
} NS_SWIFT_NAME(LogLevel);
|
||||
|
||||
typedef NSString * (^MSACLogMessageProvider)(void)NS_SWIFT_NAME(LogMessageProvider);
|
||||
typedef void (^MSACLogHandler)(MSACLogMessageProvider messageProvider, MSACLogLevel logLevel, NSString *tag, const char *file,
|
||||
const char *function, uint line) NS_SWIFT_NAME(LogHandler);
|
||||
|
||||
/**
|
||||
* Channel priorities, check the kMSACPriorityCount if you add a new value.
|
||||
* The order matters here! Values NEED to range from low priority to high priority.
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, MSACPriority) { MSACPriorityBackground, MSACPriorityDefault, MSACPriorityHigh } NS_SWIFT_NAME(Priority);
|
||||
static short const kMSACPriorityCount = MSACPriorityHigh + 1;
|
||||
|
||||
/**
|
||||
* The priority by which the modules are initialized.
|
||||
* MSACPriorityMax is reserved for only 1 module and this needs to be Crashes.
|
||||
* Crashes needs to be initialized first to catch crashes in our other SDK Modules (which will hopefully never happen) and to avoid losing
|
||||
* any log at crash time.
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, MSACInitializationPriority) {
|
||||
MSACInitializationPriorityDefault = 500,
|
||||
MSACInitializationPriorityHigh = 750,
|
||||
MSACInitializationPriorityMax = 999
|
||||
} NS_SWIFT_NAME(InitializationPriority);
|
||||
|
||||
/**
|
||||
* Enum with the different HTTP status codes.
|
||||
*/
|
||||
typedef NS_ENUM(NSInteger, MSACHTTPCodesNo) {
|
||||
|
||||
// Invalid
|
||||
MSACHTTPCodesNo0XXInvalidUnknown = 0,
|
||||
|
||||
// Informational
|
||||
MSACHTTPCodesNo1XXInformationalUnknown = 1,
|
||||
MSACHTTPCodesNo100Continue = 100,
|
||||
MSACHTTPCodesNo101SwitchingProtocols = 101,
|
||||
MSACHTTPCodesNo102Processing = 102,
|
||||
|
||||
// Success
|
||||
MSACHTTPCodesNo2XXSuccessUnknown = 2,
|
||||
MSACHTTPCodesNo200OK = 200,
|
||||
MSACHTTPCodesNo201Created = 201,
|
||||
MSACHTTPCodesNo202Accepted = 202,
|
||||
MSACHTTPCodesNo203NonAuthoritativeInformation = 203,
|
||||
MSACHTTPCodesNo204NoContent = 204,
|
||||
MSACHTTPCodesNo205ResetContent = 205,
|
||||
MSACHTTPCodesNo206PartialContent = 206,
|
||||
MSACHTTPCodesNo207MultiStatus = 207,
|
||||
MSACHTTPCodesNo208AlreadyReported = 208,
|
||||
MSACHTTPCodesNo209IMUsed = 209,
|
||||
|
||||
// Redirection
|
||||
MSACHTTPCodesNo3XXSuccessUnknown = 3,
|
||||
MSACHTTPCodesNo300MultipleChoices = 300,
|
||||
MSACHTTPCodesNo301MovedPermanently = 301,
|
||||
MSACHTTPCodesNo302Found = 302,
|
||||
MSACHTTPCodesNo303SeeOther = 303,
|
||||
MSACHTTPCodesNo304NotModified = 304,
|
||||
MSACHTTPCodesNo305UseProxy = 305,
|
||||
MSACHTTPCodesNo306SwitchProxy = 306,
|
||||
MSACHTTPCodesNo307TemporaryRedirect = 307,
|
||||
MSACHTTPCodesNo308PermanentRedirect = 308,
|
||||
|
||||
// Client error
|
||||
MSACHTTPCodesNo4XXSuccessUnknown = 4,
|
||||
MSACHTTPCodesNo400BadRequest = 400,
|
||||
MSACHTTPCodesNo401Unauthorised = 401,
|
||||
MSACHTTPCodesNo402PaymentRequired = 402,
|
||||
MSACHTTPCodesNo403Forbidden = 403,
|
||||
MSACHTTPCodesNo404NotFound = 404,
|
||||
MSACHTTPCodesNo405MethodNotAllowed = 405,
|
||||
MSACHTTPCodesNo406NotAcceptable = 406,
|
||||
MSACHTTPCodesNo407ProxyAuthenticationRequired = 407,
|
||||
MSACHTTPCodesNo408RequestTimeout = 408,
|
||||
MSACHTTPCodesNo409Conflict = 409,
|
||||
MSACHTTPCodesNo410Gone = 410,
|
||||
MSACHTTPCodesNo411LengthRequired = 411,
|
||||
MSACHTTPCodesNo412PreconditionFailed = 412,
|
||||
MSACHTTPCodesNo413RequestEntityTooLarge = 413,
|
||||
MSACHTTPCodesNo414RequestURITooLong = 414,
|
||||
MSACHTTPCodesNo415UnsupportedMediaType = 415,
|
||||
MSACHTTPCodesNo416RequestedRangeNotSatisfiable = 416,
|
||||
MSACHTTPCodesNo417ExpectationFailed = 417,
|
||||
MSACHTTPCodesNo418IamATeapot = 418,
|
||||
MSACHTTPCodesNo419AuthenticationTimeout = 419,
|
||||
MSACHTTPCodesNo420MethodFailureSpringFramework = 420,
|
||||
MSACHTTPCodesNo420EnhanceYourCalmTwitter = 4200,
|
||||
MSACHTTPCodesNo422UnprocessableEntity = 422,
|
||||
MSACHTTPCodesNo423Locked = 423,
|
||||
MSACHTTPCodesNo424FailedDependency = 424,
|
||||
MSACHTTPCodesNo424MethodFailureWebDaw = 4240,
|
||||
MSACHTTPCodesNo425UnorderedCollection = 425,
|
||||
MSACHTTPCodesNo426UpgradeRequired = 426,
|
||||
MSACHTTPCodesNo428PreconditionRequired = 428,
|
||||
MSACHTTPCodesNo429TooManyRequests = 429,
|
||||
MSACHTTPCodesNo431RequestHeaderFieldsTooLarge = 431,
|
||||
MSACHTTPCodesNo444NoResponseNginx = 444,
|
||||
MSACHTTPCodesNo449RetryWithMicrosoft = 449,
|
||||
MSACHTTPCodesNo450BlockedByWindowsParentalControls = 450,
|
||||
MSACHTTPCodesNo451RedirectMicrosoft = 451,
|
||||
MSACHTTPCodesNo451UnavailableForLegalReasons = 4510,
|
||||
MSACHTTPCodesNo494RequestHeaderTooLargeNginx = 494,
|
||||
MSACHTTPCodesNo495CertErrorNginx = 495,
|
||||
MSACHTTPCodesNo496NoCertNginx = 496,
|
||||
MSACHTTPCodesNo497HTTPToHTTPSNginx = 497,
|
||||
MSACHTTPCodesNo499ClientClosedRequestNginx = 499,
|
||||
|
||||
// Server error
|
||||
MSACHTTPCodesNo5XXSuccessUnknown = 5,
|
||||
MSACHTTPCodesNo500InternalServerError = 500,
|
||||
MSACHTTPCodesNo501NotImplemented = 501,
|
||||
MSACHTTPCodesNo502BadGateway = 502,
|
||||
MSACHTTPCodesNo503ServiceUnavailable = 503,
|
||||
MSACHTTPCodesNo504GatewayTimeout = 504,
|
||||
MSACHTTPCodesNo505HTTPVersionNotSupported = 505,
|
||||
MSACHTTPCodesNo506VariantAlsoNegotiates = 506,
|
||||
MSACHTTPCodesNo507InsufficientStorage = 507,
|
||||
MSACHTTPCodesNo508LoopDetected = 508,
|
||||
MSACHTTPCodesNo509BandwidthLimitExceeded = 509,
|
||||
MSACHTTPCodesNo510NotExtended = 510,
|
||||
MSACHTTPCodesNo511NetworkAuthenticationRequired = 511,
|
||||
MSACHTTPCodesNo522ConnectionTimedOut = 522,
|
||||
MSACHTTPCodesNo598NetworkReadTimeoutErrorUnknown = 598,
|
||||
MSACHTTPCodesNo599NetworkConnectTimeoutErrorUnknown = 599
|
||||
} NS_SWIFT_NAME(HTTPCodesNo);
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 27edcc9a07a43ae4b968db5628d0d85e
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,71 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#ifndef MSAC_CUSTOM_PROPERTIES_H
|
||||
#define MSAC_CUSTOM_PROPERTIES_H
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
/**
|
||||
* Custom properties builder.
|
||||
* Collects multiple properties to send in one log.
|
||||
*/
|
||||
NS_SWIFT_NAME(CustomProperties)
|
||||
@interface MSACCustomProperties : NSObject
|
||||
|
||||
/**
|
||||
* Set the specified property value with the specified key.
|
||||
* If the properties previously contained a property for the key, the old value is replaced.
|
||||
*
|
||||
* @param key Key with which the specified value is to be set.
|
||||
* @param value Value to be set with the specified key.
|
||||
*
|
||||
* @return This instance.
|
||||
*/
|
||||
- (instancetype)setString:(NSString *)value forKey:(NSString *)key NS_SWIFT_NAME(set(_:forKey:));
|
||||
|
||||
/**
|
||||
* Set the specified property value with the specified key.
|
||||
* If the properties previously contained a property for the key, the old value is replaced.
|
||||
*
|
||||
* @param key Key with which the specified value is to be set.
|
||||
* @param value Value to be set with the specified key.
|
||||
*
|
||||
* @return This instance.
|
||||
*/
|
||||
- (instancetype)setNumber:(NSNumber *)value forKey:(NSString *)key NS_SWIFT_NAME(set(_:forKey:));
|
||||
|
||||
/**
|
||||
* Set the specified property value with the specified key.
|
||||
* If the properties previously contained a property for the key, the old value is replaced.
|
||||
*
|
||||
* @param key Key with which the specified value is to be set.
|
||||
* @param value Value to be set with the specified key.
|
||||
*
|
||||
* @return This instance.
|
||||
*/
|
||||
- (instancetype)setBool:(BOOL)value forKey:(NSString *)key NS_SWIFT_NAME(set(_:forKey:));
|
||||
|
||||
/**
|
||||
* Set the specified property value with the specified key.
|
||||
* If the properties previously contained a property for the key, the old value is replaced.
|
||||
*
|
||||
* @param key Key with which the specified value is to be set.
|
||||
* @param value Value to be set with the specified key.
|
||||
*
|
||||
* @return This instance.
|
||||
*/
|
||||
- (instancetype)setDate:(NSDate *)value forKey:(NSString *)key NS_SWIFT_NAME(set(_:forKey:));
|
||||
|
||||
/**
|
||||
* Clear the property for the specified key.
|
||||
*
|
||||
* @param key Key whose mapping is to be cleared.
|
||||
*
|
||||
* @return This instance.
|
||||
*/
|
||||
- (instancetype)clearPropertyForKey:(NSString *)key NS_SWIFT_NAME(clearProperty(forKey:));
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 007c15081409d7c4fb501d43d9c2b5ec
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,101 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#ifndef MSAC_DEVICE_H
|
||||
#define MSAC_DEVICE_H
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#if __has_include(<AppCenter/MSACWrapperSdk.h>)
|
||||
#import <AppCenter/MSACWrapperSdk.h>
|
||||
#else
|
||||
#import "MSACWrapperSdk.h"
|
||||
#endif
|
||||
|
||||
NS_SWIFT_NAME(Device)
|
||||
@interface MSACDevice : MSACWrapperSdk
|
||||
|
||||
/*
|
||||
* Name of the SDK. Consists of the name of the SDK and the platform, e.g. "appcenter.ios", "appcenter.android"
|
||||
*/
|
||||
@property(nonatomic, copy, readonly) NSString *sdkName;
|
||||
|
||||
/*
|
||||
* Version of the SDK in semver format, e.g. "1.2.0" or "0.12.3-alpha.1".
|
||||
*/
|
||||
@property(nonatomic, copy, readonly) NSString *sdkVersion;
|
||||
|
||||
/*
|
||||
* Device model (example: iPad2,3).
|
||||
*/
|
||||
@property(nonatomic, copy, readonly) NSString *model;
|
||||
|
||||
/*
|
||||
* Device manufacturer (example: HTC).
|
||||
*/
|
||||
@property(nonatomic, copy, readonly) NSString *oemName;
|
||||
|
||||
/*
|
||||
* OS name (example: iOS).
|
||||
*/
|
||||
@property(nonatomic, copy, readonly) NSString *osName;
|
||||
|
||||
/*
|
||||
* OS version (example: 9.3.0).
|
||||
*/
|
||||
@property(nonatomic, copy, readonly) NSString *osVersion;
|
||||
|
||||
/*
|
||||
* OS build code (example: LMY47X). [optional]
|
||||
*/
|
||||
@property(nonatomic, copy, readonly) NSString *osBuild;
|
||||
|
||||
/*
|
||||
* API level when applicable like in Android (example: 15). [optional]
|
||||
*/
|
||||
@property(nonatomic, copy, readonly) NSNumber *osApiLevel;
|
||||
|
||||
/*
|
||||
* Language code (example: en_US).
|
||||
*/
|
||||
@property(nonatomic, copy, readonly) NSString *locale;
|
||||
|
||||
/*
|
||||
* The offset in minutes from UTC for the device time zone, including daylight savings time.
|
||||
*/
|
||||
@property(nonatomic, readonly, strong) NSNumber *timeZoneOffset;
|
||||
|
||||
/*
|
||||
* Screen size of the device in pixels (example: 640x480).
|
||||
*/
|
||||
@property(nonatomic, copy, readonly) NSString *screenSize;
|
||||
|
||||
/*
|
||||
* Application version name, e.g. 1.1.0
|
||||
*/
|
||||
@property(nonatomic, copy, readonly) NSString *appVersion;
|
||||
|
||||
/*
|
||||
* Carrier name (for mobile devices). [optional]
|
||||
*/
|
||||
@property(nonatomic, copy, readonly) NSString *carrierName;
|
||||
|
||||
/*
|
||||
* Carrier country code (for mobile devices). [optional]
|
||||
*/
|
||||
@property(nonatomic, copy, readonly) NSString *carrierCountry;
|
||||
|
||||
/*
|
||||
* The app's build number, e.g. 42.
|
||||
*/
|
||||
@property(nonatomic, copy, readonly) NSString *appBuild;
|
||||
|
||||
/*
|
||||
* The bundle identifier, package identifier, or namespace, depending on what the individual plattforms use, .e.g com.microsoft.example.
|
||||
* [optional]
|
||||
*/
|
||||
@property(nonatomic, copy, readonly) NSString *appNamespace;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c6090d5dc8899f94f9c57d8de12daf8d
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,27 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#ifndef MSAC_ENABLE_H
|
||||
#define MSAC_ENABLE_H
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
/**
|
||||
* Protocol to define an instance that can be enabled/disabled.
|
||||
*/
|
||||
NS_SWIFT_NAME(Enable)
|
||||
@protocol MSACEnable <NSObject>
|
||||
|
||||
@required
|
||||
|
||||
/**
|
||||
* Enable/disable this instance and delete data on disabled state.
|
||||
*
|
||||
* @param isEnabled A boolean value set to YES to enable the instance or NO to disable it.
|
||||
* @param deleteData A boolean value set to YES to delete data or NO to keep it.
|
||||
*/
|
||||
- (void)setEnabled:(BOOL)isEnabled andDeleteDataOnDisabled:(BOOL)deleteData NS_SWIFT_NAME(setEnabled(_:deleteDataOnDisabled:));
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2b55eaf557924204490676d9e484d033
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,74 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#ifndef MSAC_LOG_H
|
||||
#define MSAC_LOG_H
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class MSACDevice;
|
||||
|
||||
NS_SWIFT_NAME(Log)
|
||||
@protocol MSACLog <NSObject>
|
||||
|
||||
/**
|
||||
* Log type.
|
||||
*/
|
||||
@property(nonatomic, copy) NSString *type;
|
||||
|
||||
/**
|
||||
* Log timestamp.
|
||||
*/
|
||||
@property(nonatomic, strong) NSDate *timestamp;
|
||||
|
||||
/**
|
||||
* A session identifier is used to correlate logs together. A session is an abstract concept in the API and is not necessarily an analytics
|
||||
* session, it can be used to only track crashes.
|
||||
*/
|
||||
@property(nonatomic, copy) NSString *sid;
|
||||
|
||||
/**
|
||||
* Optional distribution group ID value.
|
||||
*/
|
||||
@property(nonatomic, copy) NSString *distributionGroupId;
|
||||
|
||||
/**
|
||||
* Optional user identifier.
|
||||
*/
|
||||
@property(nonatomic, copy) NSString *userId;
|
||||
|
||||
/**
|
||||
* Device properties associated to this log.
|
||||
*/
|
||||
@property(nonatomic, strong) MSACDevice *device;
|
||||
|
||||
/**
|
||||
* Transient object tag. For example, a log can be tagged with a transmission target. We do this currently to prevent properties being
|
||||
* applied retroactively to previous logs by comparing their tags.
|
||||
*/
|
||||
@property(nonatomic, strong) NSObject *tag;
|
||||
|
||||
/**
|
||||
* Checks if the object's values are valid.
|
||||
*
|
||||
* @return YES, if the object is valid.
|
||||
*/
|
||||
- (BOOL)isValid;
|
||||
|
||||
/**
|
||||
* Adds a transmission target token that this log should be sent to.
|
||||
*
|
||||
* @param token The transmission target token.
|
||||
*/
|
||||
- (void)addTransmissionTargetToken:(NSString *)token;
|
||||
|
||||
/**
|
||||
* Gets all transmission target tokens that this log should be sent to.
|
||||
*
|
||||
* @returns Collection of transmission target tokens that this log should be sent to.
|
||||
*/
|
||||
- (NSSet *)transmissionTargetTokens;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 71933501f40dc174dbb1452394fe4238
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,25 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#ifndef MSAC_LOG_WITH_PROPERTIES_H
|
||||
#define MSAC_LOG_WITH_PROPERTIES_H
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#if __has_include(<AppCenter/MSACAbstractLog.h>)
|
||||
#import <AppCenter/MSACAbstractLog.h>
|
||||
#else
|
||||
#import "MSACAbstractLog.h"
|
||||
#endif
|
||||
|
||||
NS_SWIFT_NAME(LogWithProperties)
|
||||
@interface MSACLogWithProperties : MSACAbstractLog
|
||||
|
||||
/**
|
||||
* Additional key/value pair parameters. [optional]
|
||||
*/
|
||||
@property(nonatomic, strong) NSDictionary<NSString *, NSString *> *properties;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 75a4cb55a13d80944b5d9ccf48da66da
|
||||
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>
|
||||
|
||||
#ifndef MSAC_LOGGER
|
||||
#define MSAC_LOGGER
|
||||
|
||||
#if __has_include(<AppCenter/MSACConstants.h>)
|
||||
#import <AppCenter/MSACConstants.h>
|
||||
#else
|
||||
#import "MSACConstants.h"
|
||||
#endif
|
||||
|
||||
#define MSACLog(_level, _tag, _message) \
|
||||
[MSACLogger logMessage:_message level:_level tag:_tag file:__FILE__ function:__PRETTY_FUNCTION__ line:__LINE__]
|
||||
#define MSACLogAssert(tag, format, ...) \
|
||||
MSACLog(MSACLogLevelAssert, tag, (^{ \
|
||||
return [NSString stringWithFormat:(format), ##__VA_ARGS__]; \
|
||||
}))
|
||||
#define MSACLogError(tag, format, ...) \
|
||||
MSACLog(MSACLogLevelError, tag, (^{ \
|
||||
return [NSString stringWithFormat:(format), ##__VA_ARGS__]; \
|
||||
}))
|
||||
#define MSACLogWarning(tag, format, ...) \
|
||||
MSACLog(MSACLogLevelWarning, tag, (^{ \
|
||||
return [NSString stringWithFormat:(format), ##__VA_ARGS__]; \
|
||||
}))
|
||||
#define MSACLogInfo(tag, format, ...) \
|
||||
MSACLog(MSACLogLevelInfo, tag, (^{ \
|
||||
return [NSString stringWithFormat:(format), ##__VA_ARGS__]; \
|
||||
}))
|
||||
#define MSACLogDebug(tag, format, ...) \
|
||||
MSACLog(MSACLogLevelDebug, tag, (^{ \
|
||||
return [NSString stringWithFormat:(format), ##__VA_ARGS__]; \
|
||||
}))
|
||||
#define MSACLogVerbose(tag, format, ...) \
|
||||
MSACLog(MSACLogLevelVerbose, tag, (^{ \
|
||||
return [NSString stringWithFormat:(format), ##__VA_ARGS__]; \
|
||||
}))
|
||||
|
||||
NS_SWIFT_NAME(Logger)
|
||||
@interface MSACLogger : NSObject
|
||||
|
||||
+ (void)logMessage:(MSACLogMessageProvider)messageProvider
|
||||
level:(MSACLogLevel)loglevel
|
||||
tag:(NSString *)tag
|
||||
file:(const char *)file
|
||||
function:(const char *)function
|
||||
line:(uint)line;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dee347580c3ddf3438c1171ab7ec0aa0
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#ifndef SERIALIZABLE_OBJECT_H
|
||||
#define SERIALIZABLE_OBJECT_H
|
||||
|
||||
@protocol MSACSerializableObject <NSCoding>
|
||||
|
||||
/**
|
||||
* Serialize this object to a dictionary.
|
||||
*
|
||||
* @return A dictionary representing this object.
|
||||
*/
|
||||
- (NSMutableDictionary *)serializeToDictionary;
|
||||
|
||||
@end
|
||||
#endif
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4371122c1e116b444bdf89da9b5afdc9
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,23 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#ifndef MSAC_SERVICE_H
|
||||
#define MSAC_SERVICE_H
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
/**
|
||||
* Protocol declaring service logic.
|
||||
*/
|
||||
NS_SWIFT_NAME(Service)
|
||||
@protocol MSACService <NSObject>
|
||||
|
||||
/**
|
||||
* Indicates whether this service is enabled.
|
||||
* The state is persisted in the device's storage across application launches.
|
||||
*/
|
||||
@property(class, nonatomic, getter=isEnabled, setter=setEnabled:) BOOL enabled NS_SWIFT_NAME(enabled);
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9c65525e380edab4490d6a46aee7c981
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,58 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#ifndef MSAC_SERVICE_ABSTRACT_H
|
||||
#define MSAC_SERVICE_ABSTRACT_H
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#if __has_include(<AppCenter/MSACService.h>)
|
||||
#import <AppCenter/MSACService.h>
|
||||
#else
|
||||
#import "MSACService.h"
|
||||
#endif
|
||||
|
||||
@protocol MSACChannelGroupProtocol;
|
||||
|
||||
/**
|
||||
* Abstraction of services common logic.
|
||||
* This class is intended to be subclassed only not instantiated directly.
|
||||
*/
|
||||
NS_SWIFT_NAME(ServiceAbstract)
|
||||
@interface MSACServiceAbstract : NSObject <MSACService>
|
||||
|
||||
/**
|
||||
* The flag indicates whether the service is started from application or not.
|
||||
*/
|
||||
@property(nonatomic, assign) BOOL startedFromApplication;
|
||||
|
||||
/**
|
||||
* Start this service with a channel group. Also sets the flag that indicates that a service has been started.
|
||||
*
|
||||
* @param channelGroup channel group used to persist and send logs.
|
||||
* @param appSecret app secret for the SDK.
|
||||
* @param token default transmission target token for this service.
|
||||
* @param fromApplication indicates whether the service started from an application or not.
|
||||
*/
|
||||
- (void)startWithChannelGroup:(id<MSACChannelGroupProtocol>)channelGroup
|
||||
appSecret:(NSString *)appSecret
|
||||
transmissionTargetToken:(NSString *)token
|
||||
fromApplication:(BOOL)fromApplication;
|
||||
|
||||
/**
|
||||
* Update configuration when the service requires to start again. This method should only be called if the service is started from libraries
|
||||
* and then is being started from an application.
|
||||
*
|
||||
* @param appSecret app secret for the SDK.
|
||||
* @param token default transmission target token for this service.
|
||||
*/
|
||||
- (void)updateConfigurationWithAppSecret:(NSString *)appSecret transmissionTargetToken:(NSString *)token;
|
||||
|
||||
/**
|
||||
* The flag indicate whether the service needs the application secret or not.
|
||||
*/
|
||||
@property(atomic, readonly) BOOL isAppSecretRequired;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f5909332c1126f14fad70da5caf8d496
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,21 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#if __has_include(<AppCenter/MSACConstants.h>)
|
||||
#import <AppCenter/MSACConstants.h>
|
||||
#else
|
||||
#import "MSACConstants.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* This is a utility for producing App Center style log messages. It is only intended for use by App Center services and wrapper SDKs of App
|
||||
* Center.
|
||||
*/
|
||||
NS_SWIFT_NAME(WrapperLogger)
|
||||
@interface MSACWrapperLogger : NSObject
|
||||
|
||||
+ (void)MSACWrapperLog:(MSACLogMessageProvider)message tag:(NSString *)tag level:(MSACLogLevel)level;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b03b11801281aa24e922bbbb46ff78fa
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,60 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#ifndef MSAC_WRAPPER_SDK_H
|
||||
#define MSAC_WRAPPER_SDK_H
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_SWIFT_NAME(WrapperSdk)
|
||||
@interface MSACWrapperSdk : NSObject
|
||||
|
||||
/*
|
||||
* Version of the wrapper SDK. When the SDK is embedding another base SDK (for example Xamarin.Android wraps Android), the Xamarin specific
|
||||
* version is populated into this field while sdkVersion refers to the original Android SDK. [optional]
|
||||
*/
|
||||
@property(nonatomic, copy, readonly) NSString *wrapperSdkVersion;
|
||||
|
||||
/*
|
||||
* Name of the wrapper SDK (examples: Xamarin, Cordova). [optional]
|
||||
*/
|
||||
@property(nonatomic, copy, readonly) NSString *wrapperSdkName;
|
||||
|
||||
/*
|
||||
* Version of the wrapper technology framework (Xamarin runtime version or ReactNative or Cordova etc...). [optional]
|
||||
*/
|
||||
@property(nonatomic, copy, readonly) NSString *wrapperRuntimeVersion;
|
||||
|
||||
/*
|
||||
* Label that is used to identify application code 'version' released via Live Update beacon running on device.
|
||||
*/
|
||||
@property(nonatomic, copy, readonly) NSString *liveUpdateReleaseLabel;
|
||||
|
||||
/*
|
||||
* Identifier of environment that current application release belongs to, deployment key then maps to environment like Production, Staging.
|
||||
*/
|
||||
@property(nonatomic, copy, readonly) NSString *liveUpdateDeploymentKey;
|
||||
|
||||
/*
|
||||
* Hash of all files (ReactNative or Cordova) deployed to device via LiveUpdate beacon. Helps identify the Release version on device or need
|
||||
* to download updates in future
|
||||
*/
|
||||
@property(nonatomic, copy, readonly) NSString *liveUpdatePackageHash;
|
||||
|
||||
- (instancetype)initWithWrapperSdkVersion:(NSString *)wrapperSdkVersion
|
||||
wrapperSdkName:(NSString *)wrapperSdkName
|
||||
wrapperRuntimeVersion:(NSString *)wrapperRuntimeVersion
|
||||
liveUpdateReleaseLabel:(NSString *)liveUpdateReleaseLabel
|
||||
liveUpdateDeploymentKey:(NSString *)liveUpdateDeploymentKey
|
||||
liveUpdatePackageHash:(NSString *)liveUpdatePackageHash;
|
||||
|
||||
/**
|
||||
* 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: 1d5d8ceddea113a43bacc8e2f7886c39
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bfefdac84f20eff42a420ca79913b106
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 41af84fa5b977164488a92e63716da66
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,13 @@
|
||||
framework module AppCenter {
|
||||
umbrella header "AppCenter.h"
|
||||
|
||||
export *
|
||||
module * { export * }
|
||||
|
||||
link framework "Foundation"
|
||||
link framework "CoreTelephony"
|
||||
link framework "SystemConfiguration"
|
||||
link framework "UIKit"
|
||||
link "sqlite3"
|
||||
link "z"
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5da2ec48007613d4990bbb90acdc0914
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 748066203d70bfc4aafc78f80d8a18a0
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+114
@@ -0,0 +1,114 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "MSACConstants+Flags.h"
|
||||
|
||||
@protocol MSACChannelUnitProtocol;
|
||||
@protocol MSACChannelGroupProtocol;
|
||||
@protocol MSACChannelProtocol;
|
||||
@protocol MSACLog;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol MSACChannelDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
|
||||
/**
|
||||
* A callback that is called when a channel unit is added to the channel group.
|
||||
*
|
||||
* @param channelGroup The channel group.
|
||||
* @param channel The newly added channel.
|
||||
*/
|
||||
- (void)channelGroup:(id<MSACChannelGroupProtocol>)channelGroup didAddChannelUnit:(id<MSACChannelUnitProtocol>)channel;
|
||||
|
||||
/**
|
||||
* A callback that is called when a log is just enqueued. Delegates may want to prepare the log a little more before further processing.
|
||||
*
|
||||
* @param log The log to prepare.
|
||||
*/
|
||||
- (void)channel:(id<MSACChannelProtocol>)channel prepareLog:(id<MSACLog>)log;
|
||||
|
||||
/**
|
||||
* A callback that is called after a log is definitely prepared.
|
||||
*
|
||||
* @param log The log.
|
||||
* @param internalId An internal Id to keep track of logs.
|
||||
* @param flags Options for the log.
|
||||
*/
|
||||
- (void)channel:(id<MSACChannelProtocol>)channel didPrepareLog:(id<MSACLog>)log internalId:(NSString *)internalId flags:(MSACFlags)flags;
|
||||
|
||||
/**
|
||||
* A callback that is called after a log completed the enqueueing process whether it was successful or not.
|
||||
*
|
||||
* @param log The log.
|
||||
* @param internalId An internal Id to keep track of logs.
|
||||
*/
|
||||
- (void)channel:(id<MSACChannelProtocol>)channel didCompleteEnqueueingLog:(id<MSACLog>)log internalId:(NSString *)internalId;
|
||||
|
||||
/**
|
||||
* Callback method that will be called before each log will be send to the server.
|
||||
*
|
||||
* @param channel The channel object.
|
||||
* @param log The log to be sent.
|
||||
*/
|
||||
- (void)channel:(id<MSACChannelProtocol>)channel willSendLog:(id<MSACLog>)log;
|
||||
|
||||
/**
|
||||
* Callback method that will be called in case the SDK was able to send a log.
|
||||
*
|
||||
* @param channel The channel object.
|
||||
* @param log The log to be sent.
|
||||
*/
|
||||
- (void)channel:(id<MSACChannelProtocol>)channel didSucceedSendingLog:(id<MSACLog>)log;
|
||||
|
||||
/**
|
||||
* Callback method that will be called in case the SDK was unable to send a log.
|
||||
*
|
||||
* @param channel The channel object.
|
||||
* @param log The log to be sent.
|
||||
* @param error The error that occured.
|
||||
*/
|
||||
- (void)channel:(id<MSACChannelProtocol>)channel didFailSendingLog:(id<MSACLog>)log withError:(nullable NSError *)error;
|
||||
|
||||
/**
|
||||
* A callback that is called when setEnabled has been invoked.
|
||||
*
|
||||
* @param channel The channel.
|
||||
* @param isEnabled The boolean that indicates enabled.
|
||||
* @param deletedData The boolean that indicates deleting data on disabled.
|
||||
*/
|
||||
- (void)channel:(id<MSACChannelProtocol>)channel didSetEnabled:(BOOL)isEnabled andDeleteDataOnDisabled:(BOOL)deletedData;
|
||||
|
||||
/**
|
||||
* A callback that is called when pause has been invoked.
|
||||
*
|
||||
* @param channel The channel.
|
||||
* @param identifyingObject The identifying object used to pause the channel.
|
||||
*/
|
||||
- (void)channel:(id<MSACChannelProtocol>)channel didPauseWithIdentifyingObject:(id<NSObject>)identifyingObject;
|
||||
|
||||
/**
|
||||
* A callback that is called when resume has been invoked.
|
||||
*
|
||||
* @param channel The channel.
|
||||
* @param identifyingObject The identifying object used to resume the channel.
|
||||
*/
|
||||
- (void)channel:(id<MSACChannelProtocol>)channel didResumeWithIdentifyingObject:(id<NSObject>)identifyingObject;
|
||||
|
||||
/**
|
||||
* Callback method that will determine if a log should be filtered out from the usual processing pipeline. If any delegate returns true, the
|
||||
* log is filtered.
|
||||
*
|
||||
* @param channelUnit The channel unit that is going to send the log.
|
||||
* @param log The log to be filtered or not.
|
||||
*
|
||||
* @return `true` if the log should be filtered out.
|
||||
*/
|
||||
- (BOOL)channelUnit:(id<MSACChannelUnitProtocol>)channelUnit shouldFilterLog:(id<MSACLog>)log;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 152ef2246954088468276b005fe3b321
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface AppCenterStarter : NSObject
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,31 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 66682104049734a38a8f3114df75215f
|
||||
timeCreated: 1502221064
|
||||
licenseType: Pro
|
||||
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: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,136 @@
|
||||
#define APPCENTER_UNITY_USE_CRASHES
|
||||
#define APPCENTER_UNITY_USE_ANALYTICS
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#import "AppCenterStarter.h"
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@import AppCenter;
|
||||
|
||||
#ifdef APPCENTER_UNITY_USE_CRASHES
|
||||
@import AppCenterCrashes;
|
||||
#endif
|
||||
|
||||
#ifdef APPCENTER_UNITY_USE_ANALYTICS
|
||||
@import AppCenterAnalytics;
|
||||
#endif
|
||||
|
||||
#ifdef APPCENTER_UNITY_USE_DISTRIBUTE
|
||||
@import AppCenterDistribute;
|
||||
#import "../Distribute/DistributeDelegate.h"
|
||||
#endif
|
||||
|
||||
enum StartupMode {
|
||||
APPCENTER,
|
||||
ONECOLLECTOR,
|
||||
BOTH,
|
||||
NONE,
|
||||
SKIP
|
||||
};
|
||||
|
||||
@implementation AppCenterStarter
|
||||
|
||||
static NSString *const kMSAppSecret = @"d8e69880-4b16-468e-9216-d0eec8fff482";
|
||||
static NSString *const kMSTargetToken = @"appcenter-transmission-target-token";
|
||||
static NSString *const kMSCustomLogUrl = @"custom-log-url";
|
||||
static NSString *const kMSCustomAllowNetworkRequests = @"YES";
|
||||
static NSString *const kMSCustomApiUrl = @"custom-api-url";
|
||||
static NSString *const kMSCustomInstallUrl = @"custom-install-url";
|
||||
static NSString *const kMSStartTargetKey = @"MSAppCenterStartTargetUnityKey";
|
||||
static NSString *const kMSStorageSizeKey = @"MSAppCenterMaxStorageSizeUnityKey";
|
||||
static NSString *const kMSLogUrlKey = @"MSAppCenterLogUrlUnityKey";
|
||||
static NSString *const kMSAppSecretKey = @"MSAppCenterAppSecretUnityKey";
|
||||
static NSString *const kMSUpdateTrackKey = @"MSAppCenterUpdateTrackUnityKey";
|
||||
|
||||
static const int kMSLogLevel = 0 /*LOG_LEVEL*/;
|
||||
static const int kMSStartupType = 0 /*STARTUP_TYPE*/;
|
||||
static const int kMSUpdateTrack = 1;
|
||||
|
||||
+ (void)load {
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(startAppCenter)
|
||||
name:UIApplicationDidFinishLaunchingNotification
|
||||
object:nil];
|
||||
}
|
||||
|
||||
+ (void)startAppCenter {
|
||||
NSNumber *startTarget = [[NSUserDefaults standardUserDefaults] objectForKey:kMSStartTargetKey];
|
||||
int startTargetValue = startTarget == nil ? kMSStartupType : startTarget.intValue;
|
||||
[MSACAppCenter setLogLevel:(MSACLogLevel)kMSLogLevel];
|
||||
if (startTargetValue == SKIP) {
|
||||
return;
|
||||
}
|
||||
|
||||
NSMutableArray<Class> *classes = [[NSMutableArray alloc] init];
|
||||
|
||||
NSNumber *maxStorageSize = [[NSUserDefaults standardUserDefaults] objectForKey:kMSStorageSizeKey];
|
||||
if (maxStorageSize != nil) {
|
||||
[MSACAppCenter setMaxStorageSize:maxStorageSize
|
||||
completionHandler:^void(BOOL result) {
|
||||
if (!result) {
|
||||
MSACLogWarning(@"MSACAppCenter", @"setMaxStorageSize failed");
|
||||
}
|
||||
}];
|
||||
} else {
|
||||
#ifdef APPCENTER_USE_CUSTOM_MAX_STORAGE_SIZE
|
||||
[MSACAppCenter setMaxStorageSize:APPCENTER_MAX_STORAGE_SIZE
|
||||
completionHandler:^void(BOOL result) {
|
||||
if (!result) {
|
||||
MSACLogWarning(@"MSACAppCenter", @"setMaxStorageSize failed");
|
||||
}
|
||||
}];
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef APPCENTER_UNITY_USE_ANALYTICS
|
||||
[classes addObject:MSACAnalytics.class];
|
||||
#endif
|
||||
|
||||
#ifdef APPCENTER_UNITY_USE_DISTRIBUTE
|
||||
|
||||
[MSACDistribute setUpdateTrack:(MSACUpdateTrack)kMSUpdateTrack];
|
||||
|
||||
#ifdef APPCENTER_UNITY_USE_CUSTOM_API_URL
|
||||
[MSACDistribute setApiUrl:kMSCustomApiUrl];
|
||||
#endif // APPCENTER_UNITY_USE_CUSTOM_API_URL
|
||||
|
||||
#ifdef APPCENTER_UNITY_USE_CUSTOM_INSTALL_URL
|
||||
[MSACDistribute setInstallUrl:kMSCustomInstallUrl];
|
||||
#endif // APPCENTER_UNITY_USE_CUSTOM_INSTALL_URL
|
||||
|
||||
#ifdef APPCENTER_DISTRIBUTE_DISABLE_AUTOMATIC_CHECK_FOR_UPDATE
|
||||
[MSACDistribute disableAutomaticCheckForUpdate];
|
||||
#endif // APPCENTER_DISTRIBUTE_DISABLE_AUTOMATIC_CHECK_FOR_UPDATE
|
||||
|
||||
#endif // APPCENTER_UNITY_USE_DISTRIBUTE
|
||||
|
||||
NSString *customLogUrl = [[NSUserDefaults standardUserDefaults] objectForKey:kMSLogUrlKey];
|
||||
if (customLogUrl != nil) {
|
||||
[MSACAppCenter setLogUrl:customLogUrl];
|
||||
} else {
|
||||
#ifdef APPCENTER_UNITY_USE_CUSTOM_LOG_URL
|
||||
[MSACAppCenter setLogUrl:kMSCustomLogUrl];
|
||||
#endif
|
||||
}
|
||||
[MSACAppCenter setNetworkRequestsAllowed:[kMSCustomAllowNetworkRequests boolValue]];
|
||||
NSString *customAppSecret = [[NSUserDefaults standardUserDefaults] objectForKey:kMSAppSecretKey];
|
||||
NSString *customAppSecretValue = customAppSecret == nil ? kMSAppSecret : customAppSecret;
|
||||
switch (startTargetValue) {
|
||||
case APPCENTER:
|
||||
[MSACAppCenter start:customAppSecretValue withServices:classes];
|
||||
break;
|
||||
case ONECOLLECTOR:
|
||||
[MSACAppCenter start:[NSString stringWithFormat:@"target=%@", kMSTargetToken] withServices:classes];
|
||||
break;
|
||||
case BOTH:
|
||||
[MSACAppCenter start:[NSString stringWithFormat:@"appsecret=%@;target=%@", customAppSecretValue, kMSTargetToken] withServices:classes];
|
||||
break;
|
||||
case NONE:
|
||||
[MSACAppCenter startWithServices:classes];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,37 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 319e7c6587510e9448244e0315279873
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
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:
|
||||
@@ -0,0 +1,134 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#import "AppCenterStarter.h"
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@import AppCenter;
|
||||
|
||||
#ifdef APPCENTER_UNITY_USE_CRASHES
|
||||
@import AppCenterCrashes;
|
||||
#endif
|
||||
|
||||
#ifdef APPCENTER_UNITY_USE_ANALYTICS
|
||||
@import AppCenterAnalytics;
|
||||
#endif
|
||||
|
||||
#ifdef APPCENTER_UNITY_USE_DISTRIBUTE
|
||||
@import AppCenterDistribute;
|
||||
#import "../Distribute/DistributeDelegate.h"
|
||||
#endif
|
||||
|
||||
enum StartupMode {
|
||||
APPCENTER,
|
||||
ONECOLLECTOR,
|
||||
BOTH,
|
||||
NONE,
|
||||
SKIP
|
||||
};
|
||||
|
||||
@implementation AppCenterStarter
|
||||
|
||||
static NSString *const kMSAppSecret = @"appcenter-app-secret";
|
||||
static NSString *const kMSTargetToken = @"appcenter-transmission-target-token";
|
||||
static NSString *const kMSCustomLogUrl = @"custom-log-url";
|
||||
static NSString *const kMSCustomAllowNetworkRequests = @"allow-network-requests";
|
||||
static NSString *const kMSCustomApiUrl = @"custom-api-url";
|
||||
static NSString *const kMSCustomInstallUrl = @"custom-install-url";
|
||||
static NSString *const kMSStartTargetKey = @"MSAppCenterStartTargetUnityKey";
|
||||
static NSString *const kMSStorageSizeKey = @"MSAppCenterMaxStorageSizeUnityKey";
|
||||
static NSString *const kMSLogUrlKey = @"MSAppCenterLogUrlUnityKey";
|
||||
static NSString *const kMSAppSecretKey = @"MSAppCenterAppSecretUnityKey";
|
||||
static NSString *const kMSUpdateTrackKey = @"MSAppCenterUpdateTrackUnityKey";
|
||||
|
||||
static const int kMSLogLevel = 0 /*LOG_LEVEL*/;
|
||||
static const int kMSStartupType = 0 /*STARTUP_TYPE*/;
|
||||
static const int kMSUpdateTrack = 1 /*UPDATE_TRACK*/;
|
||||
|
||||
+ (void)load {
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(startAppCenter)
|
||||
name:UIApplicationDidFinishLaunchingNotification
|
||||
object:nil];
|
||||
}
|
||||
|
||||
+ (void)startAppCenter {
|
||||
NSNumber *startTarget = [[NSUserDefaults standardUserDefaults] objectForKey:kMSStartTargetKey];
|
||||
int startTargetValue = startTarget == nil ? kMSStartupType : startTarget.intValue;
|
||||
[MSACAppCenter setLogLevel:(MSACLogLevel)kMSLogLevel];
|
||||
if (startTargetValue == SKIP) {
|
||||
return;
|
||||
}
|
||||
|
||||
NSMutableArray<Class> *classes = [[NSMutableArray alloc] init];
|
||||
|
||||
NSNumber *maxStorageSize = [[NSUserDefaults standardUserDefaults] objectForKey:kMSStorageSizeKey];
|
||||
if (maxStorageSize != nil) {
|
||||
[MSACAppCenter setMaxStorageSize:maxStorageSize
|
||||
completionHandler:^void(BOOL result) {
|
||||
if (!result) {
|
||||
MSACLogWarning(@"MSACAppCenter", @"setMaxStorageSize failed");
|
||||
}
|
||||
}];
|
||||
} else {
|
||||
#ifdef APPCENTER_USE_CUSTOM_MAX_STORAGE_SIZE
|
||||
[MSACAppCenter setMaxStorageSize:APPCENTER_MAX_STORAGE_SIZE
|
||||
completionHandler:^void(BOOL result) {
|
||||
if (!result) {
|
||||
MSACLogWarning(@"MSACAppCenter", @"setMaxStorageSize failed");
|
||||
}
|
||||
}];
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef APPCENTER_UNITY_USE_ANALYTICS
|
||||
[classes addObject:MSACAnalytics.class];
|
||||
#endif
|
||||
|
||||
#ifdef APPCENTER_UNITY_USE_DISTRIBUTE
|
||||
|
||||
[MSACDistribute setUpdateTrack:(MSACUpdateTrack)kMSUpdateTrack];
|
||||
|
||||
#ifdef APPCENTER_UNITY_USE_CUSTOM_API_URL
|
||||
[MSACDistribute setApiUrl:kMSCustomApiUrl];
|
||||
#endif // APPCENTER_UNITY_USE_CUSTOM_API_URL
|
||||
|
||||
#ifdef APPCENTER_UNITY_USE_CUSTOM_INSTALL_URL
|
||||
[MSACDistribute setInstallUrl:kMSCustomInstallUrl];
|
||||
#endif // APPCENTER_UNITY_USE_CUSTOM_INSTALL_URL
|
||||
|
||||
#ifdef APPCENTER_DISTRIBUTE_DISABLE_AUTOMATIC_CHECK_FOR_UPDATE
|
||||
[MSACDistribute disableAutomaticCheckForUpdate];
|
||||
#endif // APPCENTER_DISTRIBUTE_DISABLE_AUTOMATIC_CHECK_FOR_UPDATE
|
||||
|
||||
#endif // APPCENTER_UNITY_USE_DISTRIBUTE
|
||||
|
||||
NSString *customLogUrl = [[NSUserDefaults standardUserDefaults] objectForKey:kMSLogUrlKey];
|
||||
if (customLogUrl != nil) {
|
||||
[MSACAppCenter setLogUrl:customLogUrl];
|
||||
} else {
|
||||
#ifdef APPCENTER_UNITY_USE_CUSTOM_LOG_URL
|
||||
[MSACAppCenter setLogUrl:kMSCustomLogUrl];
|
||||
#endif
|
||||
}
|
||||
[MSACAppCenter setNetworkRequestsAllowed:[kMSCustomAllowNetworkRequests boolValue]];
|
||||
NSString *customAppSecret = [[NSUserDefaults standardUserDefaults] objectForKey:kMSAppSecretKey];
|
||||
NSString *customAppSecretValue = customAppSecret == nil ? kMSAppSecret : customAppSecret;
|
||||
switch (startTargetValue) {
|
||||
case APPCENTER:
|
||||
[MSACAppCenter start:customAppSecretValue withServices:classes];
|
||||
break;
|
||||
case ONECOLLECTOR:
|
||||
[MSACAppCenter start:[NSString stringWithFormat:@"target=%@", kMSTargetToken] withServices:classes];
|
||||
break;
|
||||
case BOTH:
|
||||
[MSACAppCenter start:[NSString stringWithFormat:@"appsecret=%@;target=%@", customAppSecretValue, kMSTargetToken] withServices:classes];
|
||||
break;
|
||||
case NONE:
|
||||
[MSACAppCenter startWithServices:classes];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
Loaded 100 of 719 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user