Skip to content

Commit

Permalink
Merge pull request #743 from Microsoft/develop
Browse files Browse the repository at this point in the history
Merge develop to master
  • Loading branch information
iamclement authored Aug 30, 2017
2 parents eb890d2 + 12a683b commit 7c4f4f4
Show file tree
Hide file tree
Showing 113 changed files with 116 additions and 81 deletions.
29 changes: 22 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,34 @@
# Mobile Center SDK for iOS Change Log

## Version 0.12.1

This version contains bug fixes.

### MobileCenterCrashes

* **[Fix]** Fixed missing logs sent to server on crash.

### MobileCenterDistribute

* **[Fix]** Workaraound a bug on iOS 11 where the Safari in-app page remains stuck activating in-app update. It is now opening the Safari app.
* **[Fix]** Fixed update won't start until the app is explicitly closed on iOS 11.

___

## Version 0.12.0

This version contains bug fixes, an improvement and a new feature. When you update to this release, there will be **potential data loss** if an application installed with previous versions of MobileCenter SDK on devices that has pending logs which are not sent to server yet at the time of the application is being updated.

## MobileCenter
### MobileCenter

* **[Improvement]** Changed to send one crash or error attachment log at a time to prevent HTTP requests become bigger.
* **[Fix]** Fixed database access failure when an application contains other SQLite libraries for custom database.

## MobileCenterCrashes
### MobileCenterCrashes

* **[Fix]** Fixed duplicated logs sent to server on crash.

## MobileCenterDistribute
### MobileCenterDistribute

* **[Feature]** New feature that allows to share your applications to anyone with public link.

Expand All @@ -23,7 +38,7 @@ ___

This version contains a bug fix that wasn't properly fixed in the previous release.

## MobileCenterCrashes
### MobileCenterCrashes

* **[Fix]** Fixed a bug that the Crashes picked up one next session after previous crash.

Expand All @@ -33,15 +48,15 @@ ___

This version contains bug fixes and an improvement that changes the current behavior.

## MobileCenter
### MobileCenter

* **[Fix]** Fix bugs that sent multiple or empty service start logs at launch time.

## MobileCenterAnalytics
### MobileCenterAnalytics

* **[Improvement]** Send truncated event name and properties instead of skipping it if its lengths are beyond the limits.

## MobileCenterCrashes
### MobileCenterCrashes

* **[Fix]** Fixes two bugs that caused error logs to be assiciated with wrong session information.

Expand Down
2 changes: 1 addition & 1 deletion Config/Global.xcconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
BUILD_NUMBER = 1
VERSION_STRING = 0.12.0
VERSION_STRING = 0.12.1

// :Mark: Architectures
MS_WATCH_ARCHS = armv7k
Expand Down
2 changes: 1 addition & 1 deletion Documentation/iOS/MobileCenter/.jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sdk: iphonesimulator
theme: ../../Themes/apple

module: MobileCenter
module_version: 0.12.0
module_version: 0.12.1
author: Microsoft Corp
author_url: http://www.microsoft.com

Expand Down
2 changes: 1 addition & 1 deletion Documentation/iOS/MobileCenterAnalytics/.jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sdk: iphonesimulator
theme: ../../Themes/apple

module: MobileCenterAnalytics
module_version: 0.12.0
module_version: 0.12.1
author: Microsoft Corp
author_url: http://www.microsoft.com

Expand Down
2 changes: 1 addition & 1 deletion Documentation/iOS/MobileCenterCrashes/.jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sdk: iphonesimulator
theme: ../../Themes/apple

module: Crashes
module_version: 0.12.0
module_version: 0.12.1
author: Microsoft Corp
author_url: http://www.microsoft.com

Expand Down
2 changes: 1 addition & 1 deletion Documentation/iOS/MobileCenterDistribute/.jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sdk: iphonesimulator
theme: ../../Themes/apple

module: Distribute
module_version: 0.12.0
module_version: 0.12.1
author: Microsoft Corp
author_url: http://www.microsoft.com

Expand Down
2 changes: 1 addition & 1 deletion Documentation/iOS/MobileCenterPush/.jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sdk: iphonesimulator
theme: ../../Themes/apple

module: MobileCenterPush
module_version: 0.12.0
module_version: 0.12.1
author: Microsoft Corp
author_url: http://www.microsoft.com

Expand Down
2 changes: 1 addition & 1 deletion Documentation/macOS/MobileCenter/.jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sdk: macosx
theme: ../../Themes/apple

module: MobileCenter
module_version: 0.12.0
module_version: 0.12.1
author: Microsoft Corp
author_url: http://www.microsoft.com

Expand Down
2 changes: 1 addition & 1 deletion Documentation/macOS/MobileCenterAnalytics/.jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sdk: macosx
theme: ../../Themes/apple

module: MobileCenterAnalytics
module_version: 0.12.0
module_version: 0.12.1
author: Microsoft Corp
author_url: http://www.microsoft.com

Expand Down
2 changes: 1 addition & 1 deletion Documentation/macOS/MobileCenterCrashes/.jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sdk: macosx
theme: ../../Themes/apple

module: Crashes
module_version: 0.12.0
module_version: 0.12.1
author: Microsoft Corp
author_url: http://www.microsoft.com

Expand Down
2 changes: 1 addition & 1 deletion Documentation/macOS/MobileCenterPush/.jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sdk: macosx
theme: ../../Themes/apple

module: MobileCenterPush
module_version: 0.12.0
module_version: 0.12.1
author: Microsoft Corp
author_url: http://www.microsoft.com

Expand Down
2 changes: 1 addition & 1 deletion Documentation/tvOS/MobileCenter/.jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sdk: appletvsimulator
theme: ../../Themes/apple

module: MobileCenter
module_version: 0.12.0
module_version: 0.12.1
author: Microsoft Corp
author_url: http://www.microsoft.com

Expand Down
2 changes: 1 addition & 1 deletion Documentation/tvOS/MobileCenterAnalytics/.jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sdk: appletvsimulator
theme: ../../Themes/apple

module: MobileCenterAnalytics
module_version: 0.12.0
module_version: 0.12.1
author: Microsoft Corp
author_url: http://www.microsoft.com

Expand Down
2 changes: 1 addition & 1 deletion Documentation/tvOS/MobileCenterCrashes/.jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sdk: appletvsimulator
theme: ../../Themes/apple

module: Crashes
module_version: 0.12.0
module_version: 0.12.1
author: Microsoft Corp
author_url: http://www.microsoft.com

Expand Down
2 changes: 1 addition & 1 deletion MobileCenter.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'MobileCenter'
s.version = '0.12.0'
s.version = '0.12.1'

s.summary = 'Mobile Center is mission control for mobile apps. Get faster release cycles, higher-quality apps, and the insights to build what users want.'
s.description = <<-DESC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ - (void)processLog:(id<MSLog>)log forGroupId:(NSString *)groupId {
}

// Notify delegates.
[self enumerateDelegatesForSelector:@selector(onPreparedLog:withInternalId:)
withBlock:^(id<MSLogManagerDelegate> delegate) {
[delegate onPreparedLog:log withInternalId:internalLogId];
}];
[self enumerateDelegatesForSelector:@selector(onEnqueuingLog:withInternalId:)
withBlock:^(id<MSLogManagerDelegate> delegate) {
[delegate onEnqueuingLog:log withInternalId:internalLogId];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@

@optional

/**
* A callback that is called when a log is ready to enqueue.
*
* @param log The log.
* @param internalId An internal Id that can be used to keep track of logs.
*/
- (void)onPreparedLog:(id<MSLog>)log withInternalId:(NSString *)internalId;

/**
* A callback that is called when a log has been enqueued, before a log has been forwarded to persistence, etc.
*
Expand Down
1 change: 1 addition & 0 deletions MobileCenter/MobileCenterTests/MSLogManagerDefaultTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ - (void)testProcessingLogWillTriggerOnProcessingCall {
[sut processLog:log forGroupId:groupId];

// Then
OCMVerify([mockDelegate onPreparedLog:log withInternalId:OCMOCK_ANY]);
OCMVerify([mockDelegate onEnqueuingLog:log withInternalId:OCMOCK_ANY]);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ - (void)applicationWillEnterForeground {

#pragma mark - MSLogManagerDelegate

- (void)onEnqueuingLog:(id<MSLog>)log withInternalId:(NSString *)internalId {
- (void)onPreparedLog:(id<MSLog>)log withInternalId:(NSString *)internalId {
(void)internalId;

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ - (void)testOnProcessingLog {
XCTAssertNil(log.timestamp);

// When
[self.sut onEnqueuingLog:log withInternalId:nil];
[self.sut onPreparedLog:log withInternalId:nil];

// Then
XCTAssertNil(log.timestamp);
Expand All @@ -217,7 +217,7 @@ - (void)testOnProcessingLog {
// When
NSDate *timestamp = [NSDate dateWithTimeIntervalSince1970:42];
log.timestamp = timestamp;
[self.sut onEnqueuingLog:log withInternalId:nil];
[self.sut onPreparedLog:log withInternalId:nil];

// Then
XCTAssertEqual(timestamp, log.timestamp);
Expand All @@ -234,7 +234,7 @@ - (void)testNoStartSessionWithStartSessionLog {
XCTAssertNil(log.timestamp);

// When
[self.sut onEnqueuingLog:log withInternalId:nil];
[self.sut onPreparedLog:log withInternalId:nil];

// Then
XCTAssertNil(log.timestamp);
Expand All @@ -248,7 +248,7 @@ - (void)testNoStartSessionWithStartSessionLog {
XCTAssertNil(sessionLog.timestamp);

// When
[self.sut onEnqueuingLog:sessionLog withInternalId:nil];
[self.sut onPreparedLog:sessionLog withInternalId:nil];

// Then
XCTAssertNil(sessionLog.timestamp);
Expand All @@ -262,7 +262,7 @@ - (void)testNoStartSessionWithStartSessionLog {
XCTAssertNil(serviceLog.timestamp);

// When
[self.sut onEnqueuingLog:serviceLog withInternalId:nil];
[self.sut onPreparedLog:serviceLog withInternalId:nil];

// Then
XCTAssertNil(serviceLog.timestamp);
Expand Down
25 changes: 16 additions & 9 deletions MobileCenterDistribute/MobileCenterDistribute/MSDistribute.m
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,18 @@ - (void)requestInstallInformationWith:(NSString *)releaseHash {
if (url) {

/*
* iOS 9+ only, check for `SFSafariViewController` availability. `SafariServices` framework MUST be weakly linked.
* We can't use `NSClassFromString` here to avoid the warning.
* It doesn't detect the class correctly unless the application explicitly imports the related framework.
* Only iOS 9.x and 10.x will download the update after users click the "Install" button.
* We need to force-exit the application for other versions or for any versions when the update is mandatory.
*/
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpartial-availability"
Class clazz = [SFSafariViewController class];
#pragma clang diagnostic pop
if (clazz) {
/*
* TODO Checking operating system version is a workaround for iOS 11 where SFSafariViewController can't read Safari's cookies.
* Revert this change when SFAuthenticationSession will be ready.
*/
if (clazz && ![NSProcessInfo.processInfo isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion){11, 0, 0}]) {

// Manipulate App UI on the main queue.
dispatch_async(dispatch_get_main_queue(), ^{
Expand Down Expand Up @@ -672,11 +675,13 @@ - (void)startDownload:(nullable MSReleaseDetails *)details {
}

/*
* We've seen the behavior on iOS 8.x devices in HockeyApp that it doesn't download until the application
* goes in background by pressing home button. Simply exit the app to start the update process.
* For iOS version >= 9.0, we still need to exit the app if it is a mandatory update.
* On iOS 8.x and >= iOS 11.0 devices the update download doesn't start until the application goes
* in background by pressing home button. Simply exit the app to start the update process.
* For iOS version >= 9.0 and < iOS 11.0, we still need to exit the app if it is a mandatory update.
*/
if ((floor(NSFoundationVersionNumber) < NSFoundationVersionNumber_iOS_9_0) || details.mandatoryUpdate) {
if ((floor(NSFoundationVersionNumber) < NSFoundationVersionNumber_iOS_9_0) ||
[NSProcessInfo.processInfo isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion){11, 0, 0}] ||
details.mandatoryUpdate) {
[self closeApp];
}
}];
Expand Down Expand Up @@ -753,7 +758,9 @@ - (BOOL)openURL:(NSURL *)url {
[MSKeychainUtil deleteStringForKey:kMSUpdateTokenKey];
}
if (queryUpdateToken || queryDistributionGroupId) {
[self checkLatestRelease:queryUpdateToken distributionGroupId:queryDistributionGroupId releaseHash:MSPackageHash()];
[self checkLatestRelease:queryUpdateToken
distributionGroupId:queryDistributionGroupId
releaseHash:MSPackageHash()];
} else {
MSLogError([MSDistribute logTag], @"Cannot find either update token or distribution group id.");
}
Expand Down
Loading

0 comments on commit 7c4f4f4

Please sign in to comment.