Sunday, October 27, 2019

App center SDK integration

 It is useful App Center iOS SDK in your app to use App Center Analytics and App Center Crashes.

To integrate via CocoaPods, below are the steps

Add the following dependencies to your podfile to include App Center Analytics and App Center Crashes into your app. This will pull in the following frameworks: AppCenter, AppCenterAnalytics, and AppCenterCrashes. Alternatively, you can specify which services you want to use in your app. Each service has its own subspec and they all rely on AppCenter. It will get pulled in automatically.

# Use the following line to use App Center Analytics and Crashes.
 pod 'AppCenter'

 # Use the following lines if you want to specify which service you want to use.
 pod 'AppCenter/Analytics'
 pod 'AppCenter/Crashes'
 pod 'AppCenter/Distribute'

Run pod install to install your newly defined pod and open the project's .xcworkspace.

Now to start it, below are the steps


import AppCenter
import AppCenterAnalytics
import AppCenterCrashes

MSAppCenter.start("{Your App Secret}", withServices: [MSAnalytics.self, MSCrashes.self])
MSAppCenter.start("{Your App Secret}", withServices: [MSAnalytics.self])


References:
https://docs.microsoft.com/en-us/appcenter/sdk/getting-started/ios 

No comments:

Post a Comment