Skip to content

Commit

Permalink
Merge pull request #2207 from MicrosoftDocs/master
Browse files Browse the repository at this point in the history
master -> live
  • Loading branch information
King-of-Spades committed Jan 27, 2021
2 parents a6cf833 + 5010867 commit 8e3f1d3
Show file tree
Hide file tree
Showing 9 changed files with 117 additions and 8 deletions.
23 changes: 22 additions & 1 deletion docs/sdk/getting-started/android.md
Expand Up @@ -4,7 +4,7 @@ description: Get started (Android)
keywords: sdk
author: king-of-spades
ms.author: kegr
ms.date: 12/22/2020
ms.date: 01/18/2021
ms.topic: article
ms.assetid: ef67ec59-c868-49e7-99e8-42b0399bde92
ms.tgt_pltfrm: android
Expand Down Expand Up @@ -113,6 +113,27 @@ AppCenter.start(getApplication(), "{Your App Secret}", Analytics.class, Crashes.
AppCenter.start(application, "{Your App Secret}", Analytics::class.java, Crashes::class.java)
```

If you need to start App Center services separately, you should:

1. Configure or start it with the App Secret.
1. If the code can be called multiple times, check if the App Center is already configured.
1. Start the required service(s) without the App Secret.

```java
AppCenter.configure(application, "{Your App Secret}");
if (AppCenter.isConfigured()) {
AppCenter.start(Analytics.class);
AppCenter.start(Crashes.class);
}
```
```kotlin
AppCenter.configure(application, "{Your App Secret}");
if (AppCenter.isConfigured()) {
AppCenter.start(Analytics::class.java);
AppCenter.start(Crashes::class.java);
}
```

If you have more than one entry point to your application (for example, a deep link activity, a service or a broadcast receiver), call `start` in the application custom class or in each entry point. In the latter case, check if App Center is already configured before the `start` call:

```java
Expand Down
34 changes: 34 additions & 0 deletions docs/sdk/getting-started/includes/apple-configure-appcenter.md
@@ -0,0 +1,34 @@
---
title: Shared docs for Apple SDKs
description: Shared docs for Apple SDKs
keywords: sdk
author: king-of-spades
ms.author: kegr
ms.date: 01/18/2021
ms.topic: include
ms.assetid: 1cef8428-597e-11eb-ae93-0242ac130002
ms.tgt_pltfrm: apple
dev_langs:
- swift
- objc
---
If you need to start App Center services separately, you should:

1. Configure or start it with the App Secret.
1. If the code can be called multiple times, check if the App Center is already configured.
1. Start the required service(s) without the App Secret.

```objc
[MSACAppCenter configureWithAppSecret:@"{Your App Secret}"];
if ([MSACAppCenter isConfigured]) {
[MSACAppCenter startService:[MSACAnalytics class]];
[MSACAppCenter startService:[MSACCrashes class]];
}
```
```swift
AppCenter.configure(withAppSecret: "{Your App Secret}")
if AppCenter.isConfigured {
AppCenter.startService(Analytics.self)
AppCenter.startService(Crashes.self)
}
```
27 changes: 27 additions & 0 deletions docs/sdk/getting-started/includes/windows-configure-appcenter.md
@@ -0,0 +1,27 @@
---
title: Shared docs for .Net SDKs
description: Shared docs for .Net SDKs
keywords: sdk
author: king-of-spades
ms.author: kegr
ms.date: 01/18/2021
ms.topic: include
ms.assetid: a05d996a-5980-11eb-ae93-0242ac130002
ms.tgt_pltfrm: wpf-winforms
dev_langs:
- csharp
---
If you need to start App Center services separately, you should:

1. Configure or start it with the App Secret.
1. If the code can be called multiple times, check if the App Center is already configured.
1. Start the required service(s) without the App Secret.

```csharp
AppCenter.Configure("{Your App Secret}");
if (AppCenter.Configured)
{
AppCenter.Start(typeof(Analytics));
AppCenter.Start(typeof(Crashes));
}
```
4 changes: 3 additions & 1 deletion docs/sdk/getting-started/ios.md
Expand Up @@ -4,7 +4,7 @@ description: Get started with iOS
keywords: sdk
author: king-of-spades
ms.author: kegr
ms.date: 01/06/2020
ms.date: 01/18/2021
ms.topic: article
ms.assetid: 513247e0-9a7e-4f7a-b212-43fd32474900
ms.tgt_pltfrm: ios
Expand Down Expand Up @@ -175,6 +175,8 @@ If you have a Catalyst application, you can pass app secrets for both iOS and ma
AppCenter.start(withAppSecret:"ios={Your iOS App Secret};macos={Your macOS App Secret}", services: [Analytics.self, Crashes.self])
```

[!INCLUDE [apple-configure-appcenter](includes/apple-configure-appcenter.md)]

### 4.3 Replace the placeholder with your App Secret
Make sure to replace `{Your App Secret}` text with the actual value for your application. The App Secret can be found on the **Getting Started** page or **Settings** page on the App Center portal.

Expand Down
4 changes: 3 additions & 1 deletion docs/sdk/getting-started/macos.md
Expand Up @@ -4,7 +4,7 @@ description: Get started with macOS
keywords: sdk
author: king-of-spades
ms.author: kegr
ms.date: 10/26/2020
ms.date: 01/18/2021
ms.topic: article
ms.assetid: 669af2f0-553c-11e7-b114-b2f933d5fe66
ms.tgt_pltfrm: macos
Expand Down Expand Up @@ -167,6 +167,8 @@ If you have a Catalyst application, you can pass app secrets for both iOS and ma
AppCenter.start(withAppSecret:"ios={Your iOS App Secret};macos={Your macOS App Secret}", services: [Analytics.self, Crashes.self])
```

[!INCLUDE [apple-configure-appcenter](includes/apple-configure-appcenter.md)]

### 4.3 Replace the placeholder with your App Secret
Make sure to replace `{Your App Secret}` text with the actual value for your application. The App Secret can be found on the **Getting Started** page or **Settings** page on the App Center portal.

Expand Down
6 changes: 4 additions & 2 deletions docs/sdk/getting-started/tvos.md
Expand Up @@ -4,7 +4,7 @@ description: Get started with tvOS
keywords: sdk
author: king-of-spades
ms.author: kegr
ms.date: 10/22/2020
ms.date: 01/18/2021
ms.topic: article
ms.assetid: 679af2f0-553c-11e7-b114-b2f933d5fe66
ms.tgt_pltfrm: tvOS
Expand Down Expand Up @@ -147,7 +147,7 @@ import AppCenterCrashes

### 4.2 Add the `start:withServices:` method

*Insert the following line in the app's `didFinishLaunchingWithOptions` delegate method:
Insert the following line in the app's `didFinishLaunchingWithOptions` delegate method:

```objc
[MSACAppCenter start:@"{Your App Secret}" withServices:@[[MSACAnalytics class], [MSACCrashes class]]];
Expand All @@ -156,6 +156,8 @@ import AppCenterCrashes
AppCenter.start(withAppSecret: "{Your App Secret}", services: [Analytics.self, Crashes.self])
```

[!INCLUDE [apple-configure-appcenter](includes/apple-configure-appcenter.md)]

### 4.3 Replace the placeholder with your App Secret

Make sure to replace `{Your App Secret}` text with the actual value for your application. The App Secret can be found on the **Getting Started** page or **Settings** page on the App Center portal.
Expand Down
4 changes: 3 additions & 1 deletion docs/sdk/getting-started/uwp.md
Expand Up @@ -4,7 +4,7 @@ description: Get Started with UWP
keywords: sdk
author: king-of-spades
ms.author: kegr
ms.date: 04/23/2019
ms.date: 01/18/2021
ms.topic: article
ms.assetid: e66eeedb-5395-46ce-9526-9e22319a94d4
ms.tgt_pltfrm: uwp
Expand Down Expand Up @@ -104,6 +104,8 @@ Add the following call to your application's **constructor**:
AppCenter.Start("{Your App Secret}", typeof(Analytics), typeof(Crashes));
```

[!INCLUDE [windows-configure-appcenter](includes/windows-configure-appcenter.md)]

### 5.3 Replace the placeholder with your App Secret

Make sure to replace `{Your App Secret}` text with the actual value for your application. The App Secret can be found on the **Getting Started** page or **Settings** page on the App Center portal.
Expand Down
6 changes: 5 additions & 1 deletion docs/sdk/getting-started/wpf-winforms.md
Expand Up @@ -4,7 +4,7 @@ description: Get started (WPF/Winforms)
keywords: sdk
author: king-of-spades
ms.author: kegr
ms.date: 03/09/2020
ms.date: 01/18/2021
ms.topic: article
ms.assetid: ec34cd84-2614-48fc-af57-a457e7cbf6a7
ms.tgt_pltfrm: wpf-winforms
Expand Down Expand Up @@ -110,6 +110,8 @@ public partial class App : Application
}
```

[!INCLUDE [windows-configure-appcenter](includes/windows-configure-appcenter.md)]

#### WinForms

For your WinForms application, modify the `Program.cs` file and add the following using statements:
Expand All @@ -126,6 +128,8 @@ Then in the same file, add the following code in the `Main` method, before the `
AppCenter.Start("{Your App Secret}", typeof(Analytics), typeof(Crashes));
```

[!INCLUDE [windows-configure-appcenter](includes/windows-configure-appcenter.md)]


### 5.2 Replace the placeholder with your App Secret

Expand Down
17 changes: 16 additions & 1 deletion docs/sdk/getting-started/xamarin.md
Expand Up @@ -4,7 +4,7 @@ description: Get Started with Xamarin
keywords: sdk
author: king-of-spades
ms.author: kegr
ms.date: 11/10/2020
ms.date: 01/18/2021
ms.topic: article
ms.assetid: 466c0195-c2c7-491b-83dc-2ec03dd9ab18
ms.tgt_pltfrm: xamarin
Expand Down Expand Up @@ -164,6 +164,21 @@ To use a Xamarin.Forms application targeting iOS, Android and UWP platforms, you
AppCenter.Start("ios={Your App Secret};android={Your App Secret};uwp={Your App Secret}", typeof(Analytics), typeof(Crashes));
```

If you need to start App Center services separately, you should:

1. Configure or start it with the App Secret.
1. If the code can be called multiple times, check if the App Center is already configured.
1. Start the required service(s) without the App Secret.

```csharp
AppCenter.Configure("ios={Your App Secret};android={Your App Secret};uwp={Your App Secret}");
if (AppCenter.Configured)
{
AppCenter.Start(typeof(Analytics));
AppCenter.Start(typeof(Crashes));
}
```

> [!IMPORTANT]
> The curly braces show where to place the actual app secrets, don't put curly braces in the `Start` call.
>
Expand Down

0 comments on commit 8e3f1d3

Please sign in to comment.