Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Commit

Permalink
Release AppMetrica Unity Plugin 3.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Aliaksei Nestsiarovich committed Jul 15, 2020
1 parent fbfcf70 commit 353a4dc
Show file tree
Hide file tree
Showing 18 changed files with 394 additions and 25 deletions.
4 changes: 2 additions & 2 deletions AppMetrica.unitypackage
Git LFS file not shown
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ Documentation could be found at [AppMetrica official site][DOCUMENTATION].

## Changelog

### Version 3.6.0

* Updated native SDKs *(iOS 3.11.1, Android 3.14.3)*
* Added the configuration property AppForKids for applications from App Store Kids' Category.

### Version 3.5.1

* Added a method to report referral url
* Added a method to report open url
* Added property PriceDecimal to YandexAppMetricaRevenue. Use it instead of deprecated Price
Expand Down
2 changes: 1 addition & 1 deletion YandexMetricaPluginSample/Assets/AppMetrica/AppMetrica.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

public class AppMetrica : MonoBehaviour
{
public const string VERSION = "3.5.1";
public const string VERSION = "3.6.0";

[SerializeField]
private string ApiKey;
Expand Down

This file was deleted.

Git LFS file not shown
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ BOOL ymm_isDictionaryOrNil(NSDictionary *dictionary)
if (configDictionary[@"StatisticsSending"] != nil) {
config.statisticsSending = [configDictionary[@"StatisticsSending"] boolValue];
}
if (configDictionary[@"AppForKids"] != nil) {
config.appForKids = [configDictionary[@"AppForKids"] boolValue];
}

return config;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* Version for iOS
* © 2012–2020 YANDEX
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://yandex.com/legal/appmetrica_sdk_agreement/
*/

#import <Foundation/Foundation.h>

#if __has_include("YMMErrorRepresentable.h")
#import "YMMErrorRepresentable.h"
#else
#import <YandexMobileMetrica/YMMErrorRepresentable.h>
#endif

NS_ASSUME_NONNULL_BEGIN

/** The default implementation of the `YMMErrorRepresentable` protocol.
*/
@interface YMMError : NSObject <YMMErrorRepresentable>

/** Creates the error instance with its ID.
@note For more information, see `YMMErrorRepresentable`.
@param identifier Unique error identifier
@return The `YMMError` instance
*/
+ (instancetype)errorWithIdentifier:(NSString *)identifier;

/** Creates the error instance with its ID and other properties.
@note For more information on parameters, see `YMMErrorRepresentable`.
@param identifier Unique error identifier
@param message Arbitrary description of the error
@param parameters Addittional error parameters
@return The `YMMError` instance
*/
+ (instancetype)errorWithIdentifier:(NSString *)identifier
message:(nullable NSString *)message
parameters:(nullable NSDictionary<NSString *, id> *)parameters;

/** Creates the error instance with its ID and other properties.
@note For more information on parameters, see `YMMErrorRepresentable`.
@param identifier Unique error identifier
@param message Arbitrary description of the error
@param parameters Addittional error parameters
@param backtrace Custom error backtrace
@param underlyingError Underlying error instance that conforms to the `YMMErrorRepresentable` protocol
@return The `YMMError` instance
*/
+ (instancetype)errorWithIdentifier:(NSString *)identifier
message:(nullable NSString *)message
parameters:(nullable NSDictionary<NSString *, id> *)parameters
backtrace:(nullable NSArray<NSNumber *> *)backtrace
underlyingError:(nullable id<YMMErrorRepresentable>)underlyingError;

- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/*
* Version for iOS
* © 2012–2020 YANDEX
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://yandex.com/legal/appmetrica_sdk_agreement/
*/

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

/** A key from the user info dictionary of NSError. It should contain error backtrace.
You can get it from `NSThread.callStackReturnAddresses` (Objective-C) or `Thread.callStackReturnAddresses`(Swift).
AppMetrica automatically parses the passed value.
*/
extern NSErrorUserInfoKey const YMMBacktraceErrorKey;

/** Reporting options enumeration.
*/
typedef NS_OPTIONS(NSUInteger, YMMErrorReportingOptions) {

/** Option that does not attach the backtrace of the current thread to an error. This option might speed up the reporting.
*/
YMMErrorReportingOptionsNoBacktrace = 1 << 0,
};

/** The protocol for errors that can be reported to AppMetrica.
Each error instance should have the specified `identifier` property. AppMetrica uses the property value to group errors.
All reported information on error is displayed in the AppMetrica report.
You can implement this protocol to send custom errors. Also, you can use the default protocol implementation `YMMError`.
*/
@protocol YMMErrorRepresentable <NSObject>

#pragma mark - Required

@required

/** Unique error identifier.
AppMetrica uses it for grouping.
The maximum length is 300 characters.
If the value exceeds the limit, AppMetrica truncates it.
@note AppMetrica doesn't use the IDs of underlying errors for grouping.
*/
@property (nonatomic, copy, readonly) NSString *identifier;

#pragma mark - Optional

@optional

/** Arbitrary description of the error.
The maximum length is 1000 characters.
If the value exceeds the limit, AppMetrica truncates it.
*/
@property (nonatomic, copy, readonly, nullable) NSString *message;

/** Addittional error parameters.
Parameters are cast to key-value pairs, where key and value are strings. If the key or value differs from a string, the library automatically invokes the `description` method to create a textual representation of an object.
The maximum number of key-value parameters is 50. The maximum length is 100 characters for the key and 2000 for the value.
If the value exceeds the limit, AppMetrica truncates it.
*/
@property (nonatomic, copy, readonly, nullable) NSDictionary<NSString *, id> *parameters;

/** Custom error backtrace.
You can get it from `NSThread.callStackReturnAddresses` (Objective-C) or `Thread.callStackReturnAddresses`(Swift).
The maximum number of stack frames in a backtrace is 200.
If the value exceeds the limit, AppMetrica truncates it.
*/
@property (nonatomic, copy, readonly, nullable) NSArray<NSNumber *> *backtrace;

/** Underlying error instance that conforms to the `YMMErrorRepresentable` protocol.
The maximum number of underlying errors is 10.
If the value exceeds the limit, AppMetrica truncates it.
*/
@property (nonatomic, strong, readonly, nullable) id<YMMErrorRepresentable> underlyingError;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,19 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (nonatomic, assign, readonly) NSUInteger sessionTimeout;

/** Maximum number of reports stored in the database.
Acceptable values are in the range of [100; 10000]. If passed value is outside of the range, AppMetrica automatically
trims it to closest border value.
@note Different apiKeys use different databases and can have different limits of reports count.
The parameter only affects the configuration created for that apiKey.
To set the parameter for the main apiKey, see `YMMYandexMetricaConfiguration.maxReportsInDatabaseCount`.
By default, the parameter value is 1000.
*/
@property (nonatomic, assign, readonly) NSUInteger maxReportsInDatabaseCount;

/** Logging activation status.
*/
@property (nonatomic, assign, readonly) BOOL logs;
Expand Down Expand Up @@ -60,6 +73,19 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (nonatomic, assign) NSUInteger sessionTimeout;

/** Maximum number of reports stored in the database.
Acceptable values are in the range of [100; 10000]. If passed value is outside of the range, AppMetrica automatically
trims it to closest border value.
@note Different apiKeys use different databases and can have different limits of reports count.
The parameter only affects the configuration created for that apiKey.
To set the parameter for the main apiKey, see `YMMYandexMetricaConfiguration.maxReportsInDatabaseCount`.
By default, the parameter value is 1000.
*/
@property (nonatomic, assign) NSUInteger maxReportsInDatabaseCount;

/** Enables/disables logging.
By default logging is disabled.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
#define __YMM_VERSION_H__

#define YMM_VERSION_MAJOR 3
#define YMM_VERSION_MINOR 9
#define YMM_VERSION_PATCH 4
#define YMM_VERSION_MINOR 11
#define YMM_VERSION_PATCH 1

// This line is uncommented in pre-releases.
// #define YMM_VERSION_PRERELEASE_ID "rc.1"

#define YMM_BUILD_NUMBER 16684
#define YMM_BUILD_NUMBER 18489

#endif // __YMM_VERSION_H__
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@
*/

#import <Foundation/Foundation.h>
#import "YMMCompletionBlocks.h"

#if __has_include("YMMCompletionBlocks.h")
#import "YMMCompletionBlocks.h"
#import "YMMErrorRepresentable.h"
#else
#import <YandexMobileMetrica/YMMCompletionBlocks.h>
#import <YandexMobileMetrica/YMMErrorRepresentable.h>
#endif

@class CLLocation;
@class YMMYandexMetricaConfiguration;
Expand All @@ -32,7 +39,7 @@ typedef NS_ENUM(NSInteger, YMMYandexMetricaEventErrorCode) {

@interface YMMYandexMetrica : NSObject

/** Starting the statistics collection process.
/** Starts the statistics collection process.
@param configuration Configuration combines all AppMetrica settings in one place.
Configuration initialized with unique application key that is issued during application registration in AppMetrica.
Expand All @@ -41,15 +48,15 @@ typedef NS_ENUM(NSInteger, YMMYandexMetricaEventErrorCode) {
*/
+ (void)activateWithConfiguration:(YMMYandexMetricaConfiguration *)configuration;

/** Reporting custom event.
/** Reports a custom event.
@param message Short name or description of the event.
@param onFailure Block to be executed if an error occurs while reporting, the error is passed as block argument.
*/
+ (void)reportEvent:(NSString *)message
onFailure:(nullable void (^)(NSError *error))onFailure;

/** Reporting custom event with additional parameters.
/** Reports a custom event with additional parameters.
@param message Short name or description of the event.
@param params Dictionary of name/value pairs that should be sent to the server.
Expand All @@ -59,15 +66,76 @@ typedef NS_ENUM(NSInteger, YMMYandexMetricaEventErrorCode) {
parameters:(nullable NSDictionary *)params
onFailure:(nullable void (^)(NSError *error))onFailure;

/** Reporting custom error messages.
/** Reports custom error messages.
@param message Short name or description of the error
@param exception Exception contains an NSException object that must be passed to the server. It can take the nil value.
@param onFailure Block to be executed if an error occurs while reporting, the error is passed as block argument.
*/
+ (void)reportError:(NSString *)message
exception:(nullable NSException *)exception
onFailure:(nullable void (^)(NSError *error))onFailure;
onFailure:(nullable void (^)(NSError *error))onFailure
DEPRECATED_MSG_ATTRIBUTE("Use reportError:options:onFailure: or reportNSError:options:onFailure:");

/** Reports an error of the `NSError` type.
AppMetrica uses domain and code for grouping errors.
Limits for `NSError`:
- 200 characters for `domain`;
- 50 key-value pairs for `userInfo`. 100 characters for a key length, 2000 for a value length;
- 10 underlying errors using `NSUnderlyingErrorKey` as a key in `userInfo`;
- 200 stack frames in a backtrace using `YMMBacktraceErrorKey` as a key in `userInfo`.
If the value exceeds the limit, AppMetrica truncates it.
@note You can also report custom backtrace in `NSError`, see the `YMMBacktraceErrorKey` constant.
@param error The error to report.
@param onFailure Block to be executed if an error occurres while reporting, the error is passed as block argument.
*/
+ (void)reportNSError:(NSError *)error
onFailure:(nullable void (^)(NSError *error))onFailure NS_SWIFT_NAME(report(nserror:onFailure:));

/** Reports an error of the `NSError` type.
AppMetrica uses domain and code for grouping errors.
Use this method to set the reporting options.
Limits for `NSError`:
- 200 characters for `domain`;
- 50 key-value pairs for `userInfo`. 100 characters for a key length, 2000 for a value length;
- 10 underlying errors using `NSUnderlyingErrorKey` as a key in `userInfo`;
- 200 stack frames in a backtrace using `YMMBacktraceErrorKey` as a key in `userInfo`.
If the value exceeds the limit, AppMetrica truncates it.
@note You can also report custom backtrace in `NSError`, see the `YMMBacktraceErrorKey` constant.
@param error The error to report.
@param options The options of error reporting.
@param onFailure Block to be executed if an error occurres while reporting, the error is passed as block argument.
*/
+ (void)reportNSError:(NSError *)error
options:(YMMErrorReportingOptions)options
onFailure:(nullable void (^)(NSError *error))onFailure NS_SWIFT_NAME(report(nserror:options:onFailure:));

/** Reports a custom error.
@note See `YMMErrorRepresentable` for more information.
@param error The error to report.
@param onFailure Block to be executed if an error occurres while reporting, the error is passed as block argument.
*/
+ (void)reportError:(id<YMMErrorRepresentable>)error
onFailure:(nullable void (^)(NSError *error))onFailure NS_SWIFT_NAME(report(error:onFailure:));

/** Reports a custom error.
Use this method to set the reporting options.
@note See `YMMErrorRepresentable` for more information.
@param error The error to report.
@param options The options of error reporting.
@param onFailure Block to be executed if an error occurres while reporting, the error is passed as block argument.
*/
+ (void)reportError:(id<YMMErrorRepresentable>)error
options:(YMMErrorReportingOptions)options
onFailure:(nullable void (^)(NSError *error))onFailure NS_SWIFT_NAME(report(error:options:onFailure:));

/** Sends information about the user profile.
Expand Down Expand Up @@ -187,6 +255,16 @@ typedef NS_ENUM(NSInteger, YMMYandexMetricaEventErrorCode) {
*/
+ (void)pauseSession;

/** Sets a key-value pair associated with errors and crashes.
@note
AppMetrica uses it as additional information for further unhandled exceptions.
If the value is nil, AppMetrica removes the previously set key-value pair.
@param value Error environment value.
@param key Error environment key.
*/
+ (void)setErrorEnvironmentValue:(nullable NSString *)value forKey:(NSString *)key;

@end

NS_ASSUME_NONNULL_END
Loading

0 comments on commit 353a4dc

Please sign in to comment.