Update Readme and Changelog
This commit is contained in:
Родитель
351472fb83
Коммит
08611c9ca6
10
CHANGELOG.md
10
CHANGELOG.md
|
@ -1,3 +1,13 @@
|
|||
## 1.0-beta.7 (3/2/2016)
|
||||
|
||||
**Crash Reporting and the API to send handled exceptions have been removed from the SDK. In addition, the Application Insights for iOS SDK is now deprecated.**
|
||||
|
||||
The reason for this is that [HockeyApp](http://hockeyapp.net/) is now our major offering for mobile and cross-plattform crash reporting, beta distribution and user feedback. We are focusing all our efforts on enhancing the HockeySDK and adding telemetry features to make HockeyApp the best platform to build awesome apps. We've launched [HockeyApp Preseason](http://hockeyapp.net/blog/2016/02/02/introducing-preseason.html) so you can try all the new bits yourself, including User Metrics.
|
||||
|
||||
* Remove crash reporting. To add this feature to your app, we recommend to use [HockeyApp](http://hockeyapp.net/features/) which provides you with superior crash reporting, feedback, beta distribution and much more.
|
||||
* Enable Bitcode. This was previously not possible as Bitcode-enabled apps are recompiled at unknown times on Apple's servers and make it very hard to get fully symbolicated and useful crash reports.
|
||||
* Fixes an issue where pageview durations where incorrectly sent as days instead of as a string in the 'd:hh:mm:ss.fffffff' format. The relevant methods now take an `NSTimeInterval` parameter with the duration in seconds.
|
||||
|
||||
## 1.0-beta.6 (7/8/2015)
|
||||
|
||||
* Add CHANGELOG.md
|
||||
|
|
110
README.md
110
README.md
|
@ -11,64 +11,53 @@ The SDK runs on devices with iOS 6.0 or higher. You'll need a subscription to [M
|
|||
|
||||
##Breaking Changes!
|
||||
|
||||
Breaking Changes!
|
||||
|
||||
Version 1.0-beta.7 of the Application Insights for iOS SDK comes with two major changes:
|
||||
|
||||
Crash Reporting and the API to send handled exceptions have been removed from the SDK. In addition, the Application Insights for iOS SDK is now *deprecated*.
|
||||
Crash Reporting and the API to send handled exceptions have been removed from the SDK. In addition, the Application Insights for iOS SDK is now deprecated.
|
||||
|
||||
The reason for this is that [HockeyApp](http://hockeyapp.net/features/) is now our major offering for mobile and cross-plattform crash reporting, update distribution and user feedback. We are concentrating all our efforts on enhancing the HockeySDK and add telemetry features to make HockeyApp the best plattform to build awesome apps. We've launched [HockeyApp Preseason](http://hockeyapp.net/blog/2016/02/02/introducing-preseason.html) so you can try all the new bits yourself, including User Metrics which is HockeyApp's telemetry offering.
|
||||
The reason for this is that [HockeyApp](http://hockeyapp.net/) is now our major offering for mobile and cross-plattform crash reporting, beta distribution and user feedback. We are focusing all our efforts on enhancing the HockeySDK and adding telemetry features to make HockeyApp the best platform to build awesome apps. We've launched [HockeyApp Preseason](http://hockeyapp.net/blog/2016/02/02/introducing-preseason.html) so you can try all the new bits yourself, including User Metrics.
|
||||
|
||||
While the Application Insights for Android SDK will still be available, we don't plan on investing time in it but focus on HockeyApp instead.
|
||||
|
||||
We apologize for any inconvenience and please feel free to contact us at any time.
|
||||
We apologize for any inconvenience and please feel free to [contact us](http://support.hockeyapp.net/) at any time.
|
||||
|
||||
## Content
|
||||
|
||||
1. [Release Notes](#releasenotes)
|
||||
2. [Breaking Changes](#breakingchanges)
|
||||
3. [Requirements](#requirements)
|
||||
4. [Setup](#setup)
|
||||
5. [Advanced Setup](#advancedsetup)
|
||||
6. [Developer Mode](#developermode)
|
||||
7. [Basic Usage](#basicusage)
|
||||
8. [Advanced Usage](#advancedusage)
|
||||
9. [Automatic collection of life-cycle events](#autolifecycle)
|
||||
10. [Set Custom Server Endpoint](#additionalconfig)
|
||||
11. [Documentation](#documentation)
|
||||
12. [Contributing](#contributing)
|
||||
13. [Contact](#contact)
|
||||
2. [Requirements](#requirements)
|
||||
3. [Setup](#setup)
|
||||
4. [Advanced Setup](#advancedsetup)
|
||||
5. [Developer Mode](#developermode)
|
||||
6. [Basic Usage](#basicusage)
|
||||
7. [Advanced Usage](#advancedusage)
|
||||
8. [Automatic collection of life-cycle events](#autolifecycle)
|
||||
9. [Set Custom Server Endpoint](#additionalconfig)
|
||||
10. [Documentation](#documentation)
|
||||
11. [Contributing](#contributing)
|
||||
12. [Contact](#contact)
|
||||
|
||||
<a name="releasenotes"></a>
|
||||
## 1. Release Notes
|
||||
|
||||
* Important improvements to crash reports.
|
||||
* We now filter some pageviews from standard view controllers in order to reduce noise and make pageviews more useful.
|
||||
* Smaller refactorings and improvements.
|
||||
|
||||
See [here](https://github.com/Microsoft/ApplicationInsights-iOS/releases) for the release notes of previous versions.
|
||||
|
||||
<a name="releasenotes"></a>
|
||||
## 1. Release Notes
|
||||
|
||||
* Fix API: Duration support for page views
|
||||
* Fix issues when using SDK with other crash reporting SDK
|
||||
* Remove crash/exception reporting. To add this feature to your app, we recommend to use the [HockeySDK for iOS](http://http://hockeyapp.net/releases/) which comes with crash reporting, feedback, beta distribution and much more.
|
||||
* Smaller refactorings and improvements
|
||||
* Remove crash reporting. To add this feature to your app, we recommend to use [HockeyApp](http://hockeyapp.net/features/) which provides you with superior crash reporting, feedback, beta distribution and much more.
|
||||
* Enable Bitcode. This was previously not possible as Bitcode-enabled apps are recompiled at unknown times on Apple's servers and make it very hard to get fully symbolicated and useful crash reports.
|
||||
* Fixes an issue where pageview durations where incorrectly sent as days instead of as a string in the 'd:hh:mm:ss.fffffff' format. The relevant methods now take an `NSTimeInterval` parameter with the duration in seconds.
|
||||
|
||||
See [here](https://github.com/Microsoft/ApplicationInsights-iOS/releases) for the release notes of previous versions.
|
||||
|
||||
<a id="requirements"></a>
|
||||
## 3. Requirements
|
||||
## 2. Requirements
|
||||
|
||||
The SDK runs on devices with iOS 6.0 or higher.
|
||||
|
||||
<a name="setup"></a>
|
||||
## 4. Setup
|
||||
## 3. Setup
|
||||
|
||||
We recommend integration of our binary into your Xcode project to setup Application Insights for your iOS app. For other ways to setup the SDK, see [Advanced Setup](#advancedsetup).
|
||||
|
||||
You can use the [Application Insights for Mac](http://go.microsoft.com/fwlink/?linkid=533209&clcid=0x409) tool to integrate the SDK, which provides you with a step-by-step wizard for this process. If you want to integrate the SDK manually, you can do that by following this steps:
|
||||
|
||||
### 4.1 Obtain an Instrumentation Key
|
||||
### 3.1 Obtain an Instrumentation Key
|
||||
|
||||
To view your telemetry, you'll need an [Application Insights](https://azure.microsoft.com/documentation/articles/app-insights-overview/) resource in the [Microsoft Azure Portal](https://portal.azure.com). You can either:
|
||||
|
||||
|
@ -78,17 +67,17 @@ To view your telemetry, you'll need an [Application Insights](https://azure.micr
|
|||
Open your resource and open the Essentials drop-down. Shortly, you'll need to copy the Instrumentation Key.
|
||||
|
||||
<a id="downloadsdk"></a>
|
||||
### 4.2 Download the SDK
|
||||
### 3.2 Download the SDK
|
||||
|
||||
1. Download the latest [Application Insights for iOS](https://github.com/Microsoft/ApplicationInsights-iOS/releases) framework which is provided as a zip-File.
|
||||
2. Unzip the file and you will see a folder called `ApplicationInsights` .
|
||||
|
||||
### 4.3 Copy the SDK into your projects directory in Finder
|
||||
### 3.3 Copy the SDK into your projects directory in Finder
|
||||
|
||||
From our experience, 3rd-party libraries usually reside inside a subdirectory (let's call our subdirectory `Vendor`), so if you don't have your project organized with a subdirectory for libraries, now would be a great start for it. To continue our example, create a folder called "Vendor" inside your project directory and move the unzipped `ApplicationInsights`-folder into it.
|
||||
|
||||
<a id="setupxcode"></a>
|
||||
### 4.4 Set up the SDK in Xcode
|
||||
### 3.4 Set up the SDK in Xcode
|
||||
|
||||
1. We recommend to use Xcode's group-feature to create a group for 3rd-party-libraries similar to the structure of our files on disk. For example, similar to the file structure in 4.3 above, our projects have a group called `Vendor`.
|
||||
2. Make sure the `Project Navigator` is visible (⌘+1)
|
||||
|
@ -97,7 +86,7 @@ From our experience, 3rd-party libraries usually reside inside a subdirectory (l
|
|||
5. Open the `Info.plist` of your app target and add a new field of type *String*. Name it `MSAIInstrumentationKey` and set your Application Insights instrumentation key from 4.1 as its value.
|
||||
|
||||
<a id="modifycode"/>
|
||||
### 4.5 Modify Code
|
||||
### 3.5 Modify Code
|
||||
|
||||
**Objective-C**
|
||||
|
||||
|
@ -157,9 +146,9 @@ From our experience, 3rd-party libraries usually reside inside a subdirectory (l
|
|||
**Congratulation, now you're all set to use Application Insights! See [Basic Usage](#basicusage) on how to use Application Insights.**
|
||||
|
||||
<a id="advancedsetup"></a>
|
||||
## 5. Advanced Setup
|
||||
## 4. Advanced Setup
|
||||
|
||||
### 5.1 Set Instrumentation Key in Code
|
||||
### 4.1 Set Instrumentation Key in Code
|
||||
|
||||
It is also possible to set the instrumentation key of your app in code. This will override the one you might have set in your `Info.plist`. To set it in code, MSAIApplicationInsights provides an overloaded constructor:
|
||||
|
||||
|
@ -172,7 +161,7 @@ It is also possible to set the instrumentation key of your app in code. This wil
|
|||
```
|
||||
|
||||
<a id="linkmanually"/>
|
||||
### 5.2 Linking System Frameworks manually
|
||||
### 4.2 Linking System Frameworks manually
|
||||
|
||||
If you are working with an older project which doesn't support clang modules yet or you for some reason turned off the `Enable Modules (C and Objective-C` and `Link Frameworks Automatically` options in Xcode, you have to manually link some system frameworks:
|
||||
|
||||
|
@ -190,7 +179,7 @@ If you are working with an older project which doesn't support clang modules yet
|
|||
|
||||
Note that this also means that you can't use the `@import` syntax mentioned in the [Modify Code](#modify) section but have to stick to the old `#import <ApplicationInsights/ApplicationInsights.h>`.
|
||||
|
||||
### 5.3 Setup with CocoaPods
|
||||
### 4.3 Setup with CocoaPods
|
||||
|
||||
[CocoaPods](https://cocoapods.org/) is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like ApplicationInsights in your projects. To learn how to setup CocoaPods for your project, visit the [official CocoaPods website](https://cocoapods.org/).
|
||||
|
||||
|
@ -205,7 +194,7 @@ platform :ios, '8.0'
|
|||
pod "ApplicationInsights", '1.0-beta.4'
|
||||
```
|
||||
|
||||
### 5.4 iOS 8 Extensions
|
||||
### 4.4 iOS 8 Extensions
|
||||
|
||||
The following points need to be considered to use the Application Insights SDK with iOS 8 Extensions:
|
||||
|
||||
|
@ -229,7 +218,7 @@ The following points need to be considered to use the Application Insights SDK w
|
|||
}
|
||||
```
|
||||
|
||||
### 5.4 WatchKit Extensions
|
||||
### 4.5 WatchKit Extensions
|
||||
|
||||
WatchKit extensions don't use regular `UIViewControllers` but rather `WKInterfaceController` subclasses. These have a different lifecycle than you might be used to.
|
||||
To make sure that the Application Insights SDK is only instantiated once in the WatchKit extension's lifecycle we recommend using a helper class similar to this:
|
||||
|
@ -289,13 +278,13 @@ Then, in each of your WKInterfaceControllers where you want to use the Applicati
|
|||
```
|
||||
|
||||
<a name="developermode"></a>
|
||||
## 6. Developer Mode
|
||||
## 5. Developer Mode
|
||||
|
||||
###6.1 Batching of data
|
||||
###5.1 Batching of data
|
||||
|
||||
The **developer mode** is enabled automatically in case the debugger is attached or if the app is running in the simulator. This will decrease the number of telemetry items sent in a batch (5 items) as well as the interval items when telemetry will be sent (3 seconds).
|
||||
|
||||
###6.2 Logging
|
||||
###5.2 Logging
|
||||
|
||||
We're all big fans of a clean debugging output without 3rd-party-SDKs messages piling up in the debugging view, right?!
|
||||
That's why Application Insights keeps log messages to a minimum (like critical errors) unless the developer specifically enables debug logging before starting the SDK:
|
||||
|
@ -311,7 +300,7 @@ That's why Application Insights keeps log messages to a minimum (like critical e
|
|||
This setting is ignored if the app is running in an app store environment, so the user's console won't be littered with our log messages.
|
||||
|
||||
<a id="basicusage"></a>
|
||||
## 7. Basic Usage
|
||||
## 6. Basic Usage
|
||||
|
||||
**[NOTE]** The SDK is optimized to defer everything possible to a later time while making sure each module executes other code with a delay of some seconds. This ensures that `applicationDidFinishLaunching:` will process as fast as possible and the SDK will not block the startup sequence resulting in a possible kill by the watchdog process.
|
||||
|
||||
|
@ -319,7 +308,7 @@ After you have set up the SDK as [described above](#setup), the ```MSAITelemetry
|
|||
|
||||
For an overview of how to use the API and view the results in the Application Insights resource, see [API Overview](https://azure.microsoft.com/documentation/articles/app-insights-api-custom-events-metrics/). The examples are in Java, but the principles are the same.
|
||||
|
||||
### 7.1 Objective-C
|
||||
### 6.1 Objective-C
|
||||
|
||||
```objectivec
|
||||
// Send an event with custom properties and measurements data
|
||||
|
@ -350,7 +339,7 @@ NSArray *zeroItemArray = [NSArray new];
|
|||
}
|
||||
```
|
||||
|
||||
### 7.2 Swift
|
||||
### 6.2 Swift
|
||||
|
||||
```swift
|
||||
// Send an event with custom properties and measuremnts data
|
||||
|
@ -381,11 +370,11 @@ In the [Azure portal](https://portal.azure.com), open the application resource t
|
|||
* Click [Search](https://azure.microsoft.com/documentation/articles/app-insights-diagnostic-search/) to see individual trackEvent, trackTrace, trackException and trackPageView messages.
|
||||
|
||||
<a name="advancedusage"></a>
|
||||
## 8. Advanced Usage
|
||||
## 7. Advanced Usage
|
||||
|
||||
The SDK also allows for some more advanced usages.
|
||||
|
||||
### 8.1 Common Properties
|
||||
### 7.1 Common Properties
|
||||
|
||||
It is also possible to set so-called "common properties" that will then be automatically attached to all telemetry data items.
|
||||
|
||||
|
@ -406,14 +395,13 @@ MSAITelemetryManager.setCommonProperties(["custom info":"some value"])
|
|||
Use the properties to [segment and filter metric charts](https://azure.microsoft.com/documentation/articles/app-insights-metrics-explorer/#segment-your-data) and [filter searches](https://azure.microsoft.com/documentation/articles/app-insights-diagnostic-search/#filter-on-property-values).
|
||||
|
||||
<a name="autolifecycle"></a>
|
||||
## 9. Automatic collection of lifecycle events
|
||||
## 8. Automatic collection of lifecycle events
|
||||
|
||||
Automatic collection of lifecycle events is **enabled by default**. This means that Application Insights automatically tracks the appearance of a view controller and manages sessions for you.
|
||||
|
||||
### 9.1. Page views
|
||||
### 8.1. Page views
|
||||
The automatic tracking of viewcontroller appearance can be disabled between setup and start of the SDK.
|
||||
|
||||
|
||||
```objectivec
|
||||
[MSAIApplicationInsights setup]; //setup the SDK
|
||||
|
||||
|
@ -422,7 +410,7 @@ The automatic tracking of viewcontroller appearance can be disabled between setu
|
|||
[MSAIApplicationInsights start]; //start using the SDK
|
||||
```
|
||||
|
||||
### 9.2. Sessions
|
||||
### 8.2. Sessions
|
||||
|
||||
By default, the Application Insights for iOS SDK starts a new session when the containing app is restarted (this means a 'cold start', i.e. when the app has not already been in memory prior to being launched) or when it has been in the background for more than 20 seconds.
|
||||
|
||||
|
@ -441,7 +429,7 @@ This then requires you to manage sessions manually:
|
|||
[MSAIApplicationInsights renewSessionWithId:@"4815162342"];
|
||||
```
|
||||
|
||||
### 9.3. Users
|
||||
### 8.3. Users
|
||||
|
||||
Normally, a random anonymous ID is automatically generated for every user of your app by the SDK. Alternatively you can set your own user ID or other user attributes, which will then be attached to all telemetry events:
|
||||
```objectivec
|
||||
|
@ -452,7 +440,7 @@ Normally, a random anonymous ID is automatically generated for every user of you
|
|||
```
|
||||
|
||||
<a name="additionalconfig"></a>
|
||||
## 10. Set Custom Server Endpoint
|
||||
## 9. Set Custom Server Endpoint
|
||||
|
||||
You can also configure a different server endpoint for the SDK if needed using a full URL
|
||||
|
||||
|
@ -465,13 +453,13 @@ You can also configure a different server endpoint for the SDK if needed using a
|
|||
```
|
||||
|
||||
<a id="documentation"></a>
|
||||
## 11. Documentation
|
||||
## 10. Documentation
|
||||
|
||||
Our documentation can be found on [CocoaDocs](http://cocoadocs.org/docsets/ApplicationInsights/1.0-beta.4/).
|
||||
|
||||
|
||||
<a id="contributing"></a>
|
||||
## 12. Contributing
|
||||
## 11. Contributing
|
||||
|
||||
We're looking forward to your contributions via pull requests.
|
||||
|
||||
|
@ -483,6 +471,6 @@ We're looking forward to your contributions via pull requests.
|
|||
* [Cocoapods](https://cocoapods.org/)
|
||||
|
||||
<a id="contact"></a>
|
||||
## 13. Contact
|
||||
## 12. Contact
|
||||
|
||||
If you have further questions or are running into trouble that cannot be resolved by any of the steps here, feel free to open a GitHub issue here or contact us at [AppInsights-iOS@microsoft.com](mailto:AppInsights-ios@microsoft.com)
|
||||
If you have further questions or are running into trouble that cannot be resolved by any of the steps here, feel free to open a GitHub issue here or contact us at [support@hockeyapp.net](mailto:support@hockeyapp.net)
|
||||
|
|
|
@ -9,51 +9,55 @@ The SDK runs on devices with iOS 6.0 or higher. You'll need a subscription to [M
|
|||
|
||||
[Application Insights overview](https://azure.microsoft.com/documentation/articles/app-insights-overview/)
|
||||
|
||||
##Breaking Changes!
|
||||
|
||||
Breaking Changes!
|
||||
|
||||
Version 1.0-beta.7 of the Application Insights for iOS SDK comes with two major changes:
|
||||
|
||||
Crash Reporting and the API to send handled exceptions have been removed from the SDK. In addition, the Application Insights for iOS SDK is now deprecated.
|
||||
|
||||
The reason for this is that [HockeyApp](http://hockeyapp.net/) is now our major offering for mobile and cross-plattform crash reporting, beta distribution and user feedback. We are focusing all our efforts on enhancing the HockeySDK and adding telemetry features to make HockeyApp the best platform to build awesome apps. We've launched [HockeyApp Preseason](http://hockeyapp.net/blog/2016/02/02/introducing-preseason.html) so you can try all the new bits yourself, including User Metrics.
|
||||
|
||||
We apologize for any inconvenience and please feel free to [contact us](http://support.hockeyapp.net/) at any time.
|
||||
|
||||
## Content
|
||||
|
||||
1. [Release Notes](#releasenotes)
|
||||
2. [Breaking Changes](#breakingchanges)
|
||||
3. [Requirements](#requirements)
|
||||
4. [Setup](#setup)
|
||||
5. [Advanced Setup](#advancedsetup)
|
||||
6. [Developer Mode](#developermode)
|
||||
7. [Basic Usage](#basicusage)
|
||||
8. [Advanced Usage](#advancedusage)
|
||||
9. [Automatic collection of life-cycle events](#autolifecycle)
|
||||
10. [Set Custom Server Endpoint](#additionalconfig)
|
||||
11. [Documentation](#documentation)
|
||||
12. [Contributing](#contributing)
|
||||
13. [Contact](#contact)
|
||||
2. [Requirements](#requirements)
|
||||
3. [Setup](#setup)
|
||||
4. [Advanced Setup](#advancedsetup)
|
||||
5. [Developer Mode](#developermode)
|
||||
6. [Basic Usage](#basicusage)
|
||||
7. [Advanced Usage](#advancedusage)
|
||||
8. [Automatic collection of life-cycle events](#autolifecycle)
|
||||
9. [Set Custom Server Endpoint](#additionalconfig)
|
||||
10. [Documentation](#documentation)
|
||||
11. [Contributing](#contributing)
|
||||
12. [Contact](#contact)
|
||||
|
||||
<a name="releasenotes"></a>
|
||||
## 1. Release Notes
|
||||
|
||||
* Important improvements to crash reports.
|
||||
* We now filter some pageviews from standard view controllers in order to reduce noise and make pageviews more useful.
|
||||
* Smaller refactorings and improvements.
|
||||
* Remove crash reporting. To add this feature to your app, we recommend to use [HockeyApp](http://hockeyapp.net/features/) which provides you with superior crash reporting, feedback, beta distribution and much more.
|
||||
* Enable Bitcode. This was previously not possible as Bitcode-enabled apps are recompiled at unknown times on Apple's servers and make it very hard to get fully symbolicated and useful crash reports.
|
||||
* Fixes an issue where pageview durations where incorrectly sent as days instead of as a string in the 'd:hh:mm:ss.fffffff' format. The relevant methods now take an `NSTimeInterval` parameter with the duration in seconds.
|
||||
|
||||
See [here](https://github.com/Microsoft/ApplicationInsights-iOS/releases) for the release notes of previous versions.
|
||||
|
||||
<a name="breakingchanges"></a>
|
||||
## 2. Breaking Changes
|
||||
There haven't been any breaking changes since 1.0-beta.2. In case the API of the SDK changes, we will deprecate methods, etc. before removing them.
|
||||
|
||||
* **[1.0-beta.2]** ```MSAIAppInsights``` was the the central entry-point to use the Application Insights SDK. It has been renamed to ```MSAIApplicationInsights```.
|
||||
* **[1.0-beta.2]** Setting the custom server URL now requires the complete URL to the server
|
||||
|
||||
<a id="requirements"></a>
|
||||
## 3. Requirements
|
||||
## 2. Requirements
|
||||
|
||||
The SDK runs on devices with iOS 6.0 or higher.
|
||||
|
||||
<a name="setup"></a>
|
||||
## 4. Setup
|
||||
## 3. Setup
|
||||
|
||||
We recommend integration of our binary into your Xcode project to setup Application Insights for your iOS app. For other ways to setup the SDK, see [Advanced Setup](#advancedsetup).
|
||||
|
||||
You can use the [Application Insights for Mac](http://go.microsoft.com/fwlink/?linkid=533209&clcid=0x409) tool to integrate the SDK, which provides you with a step-by-step wizard for this process. If you want to integrate the SDK manually, you can do that by following this steps:
|
||||
|
||||
### 4.1 Obtain an Instrumentation Key
|
||||
### 3.1 Obtain an Instrumentation Key
|
||||
|
||||
To view your telemetry, you'll need an [Application Insights](https://azure.microsoft.com/documentation/articles/app-insights-overview/) resource in the [Microsoft Azure Portal](https://portal.azure.com). You can either:
|
||||
|
||||
|
@ -63,17 +67,17 @@ To view your telemetry, you'll need an [Application Insights](https://azure.micr
|
|||
Open your resource and open the Essentials drop-down. Shortly, you'll need to copy the Instrumentation Key.
|
||||
|
||||
<a id="downloadsdk"></a>
|
||||
### 4.2 Download the SDK
|
||||
### 3.2 Download the SDK
|
||||
|
||||
1. Download the latest [Application Insights for iOS](https://github.com/Microsoft/ApplicationInsights-iOS/releases) framework which is provided as a zip-File.
|
||||
2. Unzip the file and you will see a folder called `ApplicationInsights` .
|
||||
|
||||
### 4.3 Copy the SDK into your projects directory in Finder
|
||||
### 3.3 Copy the SDK into your projects directory in Finder
|
||||
|
||||
From our experience, 3rd-party libraries usually reside inside a subdirectory (let's call our subdirectory `Vendor`), so if you don't have your project organized with a subdirectory for libraries, now would be a great start for it. To continue our example, create a folder called "Vendor" inside your project directory and move the unzipped `ApplicationInsights`-folder into it.
|
||||
|
||||
<a id="setupxcode"></a>
|
||||
### 4.4 Set up the SDK in Xcode
|
||||
### 3.4 Set up the SDK in Xcode
|
||||
|
||||
1. We recommend to use Xcode's group-feature to create a group for 3rd-party-libraries similar to the structure of our files on disk. For example, similar to the file structure in 4.3 above, our projects have a group called `Vendor`.
|
||||
2. Make sure the `Project Navigator` is visible (⌘+1)
|
||||
|
@ -82,7 +86,7 @@ From our experience, 3rd-party libraries usually reside inside a subdirectory (l
|
|||
5. Open the `Info.plist` of your app target and add a new field of type *String*. Name it `MSAIInstrumentationKey` and set your Application Insights instrumentation key from 4.1 as its value.
|
||||
|
||||
<a id="modifycode"/>
|
||||
### 4.5 Modify Code
|
||||
### 3.5 Modify Code
|
||||
|
||||
**Objective-C**
|
||||
|
||||
|
@ -142,9 +146,9 @@ From our experience, 3rd-party libraries usually reside inside a subdirectory (l
|
|||
**Congratulation, now you're all set to use Application Insights! See [Basic Usage](#basicusage) on how to use Application Insights.**
|
||||
|
||||
<a id="advancedsetup"></a>
|
||||
## 5. Advanced Setup
|
||||
## 4. Advanced Setup
|
||||
|
||||
### 5.1 Set Instrumentation Key in Code
|
||||
### 4.1 Set Instrumentation Key in Code
|
||||
|
||||
It is also possible to set the instrumentation key of your app in code. This will override the one you might have set in your `Info.plist`. To set it in code, MSAIApplicationInsights provides an overloaded constructor:
|
||||
|
||||
|
@ -157,7 +161,7 @@ It is also possible to set the instrumentation key of your app in code. This wil
|
|||
```
|
||||
|
||||
<a id="linkmanually"/>
|
||||
### 5.2 Linking System Frameworks manually
|
||||
### 4.2 Linking System Frameworks manually
|
||||
|
||||
If you are working with an older project which doesn't support clang modules yet or you for some reason turned off the `Enable Modules (C and Objective-C` and `Link Frameworks Automatically` options in Xcode, you have to manually link some system frameworks:
|
||||
|
||||
|
@ -175,7 +179,7 @@ If you are working with an older project which doesn't support clang modules yet
|
|||
|
||||
Note that this also means that you can't use the `@import` syntax mentioned in the [Modify Code](#modify) section but have to stick to the old `#import <ApplicationInsights/ApplicationInsights.h>`.
|
||||
|
||||
### 5.3 Setup with CocoaPods
|
||||
### 4.3 Setup with CocoaPods
|
||||
|
||||
[CocoaPods](https://cocoapods.org/) is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like ApplicationInsights in your projects. To learn how to setup CocoaPods for your project, visit the [official CocoaPods website](https://cocoapods.org/).
|
||||
|
||||
|
@ -190,7 +194,7 @@ platform :ios, '8.0'
|
|||
pod "ApplicationInsights", '1.0-beta.4'
|
||||
```
|
||||
|
||||
### 5.4 iOS 8 Extensions
|
||||
### 4.4 iOS 8 Extensions
|
||||
|
||||
The following points need to be considered to use the Application Insights SDK with iOS 8 Extensions:
|
||||
|
||||
|
@ -214,7 +218,7 @@ The following points need to be considered to use the Application Insights SDK w
|
|||
}
|
||||
```
|
||||
|
||||
### 5.4 WatchKit Extensions
|
||||
### 4.5 WatchKit Extensions
|
||||
|
||||
WatchKit extensions don't use regular `UIViewControllers` but rather `WKInterfaceController` subclasses. These have a different lifecycle than you might be used to.
|
||||
To make sure that the Application Insights SDK is only instantiated once in the WatchKit extension's lifecycle we recommend using a helper class similar to this:
|
||||
|
@ -274,13 +278,13 @@ Then, in each of your WKInterfaceControllers where you want to use the Applicati
|
|||
```
|
||||
|
||||
<a name="developermode"></a>
|
||||
## 6. Developer Mode
|
||||
## 5. Developer Mode
|
||||
|
||||
###6.1 Batching of data
|
||||
###5.1 Batching of data
|
||||
|
||||
The **developer mode** is enabled automatically in case the debugger is attached or if the app is running in the simulator. This will decrease the number of telemetry items sent in a batch (5 items) as well as the interval items when telemetry will be sent (3 seconds).
|
||||
|
||||
###6.2 Logging
|
||||
###5.2 Logging
|
||||
|
||||
We're all big fans of a clean debugging output without 3rd-party-SDKs messages piling up in the debugging view, right?!
|
||||
That's why Application Insights keeps log messages to a minimum (like critical errors) unless the developer specifically enables debug logging before starting the SDK:
|
||||
|
@ -296,7 +300,7 @@ That's why Application Insights keeps log messages to a minimum (like critical e
|
|||
This setting is ignored if the app is running in an app store environment, so the user's console won't be littered with our log messages.
|
||||
|
||||
<a id="basicusage"></a>
|
||||
## 7. Basic Usage
|
||||
## 6. Basic Usage
|
||||
|
||||
**[NOTE]** The SDK is optimized to defer everything possible to a later time while making sure each module executes other code with a delay of some seconds. This ensures that `applicationDidFinishLaunching:` will process as fast as possible and the SDK will not block the startup sequence resulting in a possible kill by the watchdog process.
|
||||
|
||||
|
@ -304,7 +308,7 @@ After you have set up the SDK as [described above](#setup), the ```MSAITelemetry
|
|||
|
||||
For an overview of how to use the API and view the results in the Application Insights resource, see [API Overview](https://azure.microsoft.com/documentation/articles/app-insights-api-custom-events-metrics/). The examples are in Java, but the principles are the same.
|
||||
|
||||
### 7.1 Objective-C
|
||||
### 6.1 Objective-C
|
||||
|
||||
```objectivec
|
||||
// Send an event with custom properties and measurements data
|
||||
|
@ -335,7 +339,7 @@ NSArray *zeroItemArray = [NSArray new];
|
|||
}
|
||||
```
|
||||
|
||||
### 7.2 Swift
|
||||
### 6.2 Swift
|
||||
|
||||
```swift
|
||||
// Send an event with custom properties and measuremnts data
|
||||
|
@ -366,11 +370,11 @@ In the [Azure portal](https://portal.azure.com), open the application resource t
|
|||
* Click [Search](https://azure.microsoft.com/documentation/articles/app-insights-diagnostic-search/) to see individual trackEvent, trackTrace, trackException and trackPageView messages.
|
||||
|
||||
<a name="advancedusage"></a>
|
||||
## 8. Advanced Usage
|
||||
## 7. Advanced Usage
|
||||
|
||||
The SDK also allows for some more advanced usages.
|
||||
|
||||
### 8.1 Common Properties
|
||||
### 7.1 Common Properties
|
||||
|
||||
It is also possible to set so-called "common properties" that will then be automatically attached to all telemetry data items.
|
||||
|
||||
|
@ -391,14 +395,13 @@ MSAITelemetryManager.setCommonProperties(["custom info":"some value"])
|
|||
Use the properties to [segment and filter metric charts](https://azure.microsoft.com/documentation/articles/app-insights-metrics-explorer/#segment-your-data) and [filter searches](https://azure.microsoft.com/documentation/articles/app-insights-diagnostic-search/#filter-on-property-values).
|
||||
|
||||
<a name="autolifecycle"></a>
|
||||
## 9. Automatic collection of lifecycle events
|
||||
## 8. Automatic collection of lifecycle events
|
||||
|
||||
Automatic collection of lifecycle events is **enabled by default**. This means that Application Insights automatically tracks the appearance of a view controller and manages sessions for you.
|
||||
|
||||
### 9.1. Page views
|
||||
### 8.1. Page views
|
||||
The automatic tracking of viewcontroller appearance can be disabled between setup and start of the SDK.
|
||||
|
||||
|
||||
```objectivec
|
||||
[MSAIApplicationInsights setup]; //setup the SDK
|
||||
|
||||
|
@ -407,7 +410,7 @@ The automatic tracking of viewcontroller appearance can be disabled between setu
|
|||
[MSAIApplicationInsights start]; //start using the SDK
|
||||
```
|
||||
|
||||
### 9.2. Sessions
|
||||
### 8.2. Sessions
|
||||
|
||||
By default, the Application Insights for iOS SDK starts a new session when the containing app is restarted (this means a 'cold start', i.e. when the app has not already been in memory prior to being launched) or when it has been in the background for more than 20 seconds.
|
||||
|
||||
|
@ -426,7 +429,7 @@ This then requires you to manage sessions manually:
|
|||
[MSAIApplicationInsights renewSessionWithId:@"4815162342"];
|
||||
```
|
||||
|
||||
### 9.3. Users
|
||||
### 8.3. Users
|
||||
|
||||
Normally, a random anonymous ID is automatically generated for every user of your app by the SDK. Alternatively you can set your own user ID or other user attributes, which will then be attached to all telemetry events:
|
||||
```objectivec
|
||||
|
@ -437,7 +440,7 @@ Normally, a random anonymous ID is automatically generated for every user of you
|
|||
```
|
||||
|
||||
<a name="additionalconfig"></a>
|
||||
## 10. Set Custom Server Endpoint
|
||||
## 9. Set Custom Server Endpoint
|
||||
|
||||
You can also configure a different server endpoint for the SDK if needed using a full URL
|
||||
|
||||
|
@ -450,13 +453,13 @@ You can also configure a different server endpoint for the SDK if needed using a
|
|||
```
|
||||
|
||||
<a id="documentation"></a>
|
||||
## 11. Documentation
|
||||
## 10. Documentation
|
||||
|
||||
Our documentation can be found on [CocoaDocs](http://cocoadocs.org/docsets/ApplicationInsights/1.0-beta.4/).
|
||||
|
||||
|
||||
<a id="contributing"></a>
|
||||
## 12. Contributing
|
||||
## 11. Contributing
|
||||
|
||||
We're looking forward to your contributions via pull requests.
|
||||
|
||||
|
@ -468,6 +471,6 @@ We're looking forward to your contributions via pull requests.
|
|||
* [Cocoapods](https://cocoapods.org/)
|
||||
|
||||
<a id="contact"></a>
|
||||
## 13. Contact
|
||||
## 12. Contact
|
||||
|
||||
If you have further questions or are running into trouble that cannot be resolved by any of the steps here, feel free to open a GitHub issue here or contact us at [AppInsights-iOS@microsoft.com](mailto:AppInsights-ios@microsoft.com)
|
||||
If you have further questions or are running into trouble that cannot be resolved by any of the steps here, feel free to open a GitHub issue here or contact us at [support@hockeyapp.net](mailto:support@hockeyapp.net)
|
||||
|
|
Загрузка…
Ссылка в новой задаче