-
Notifications
You must be signed in to change notification settings - Fork 293
Expand file tree
/
Copy pathApp.kt
More file actions
36 lines (30 loc) · 959 Bytes
/
App.kt
File metadata and controls
36 lines (30 loc) · 959 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package ly.count.android.demo.kotlin
import android.app.Application
import android.util.Log
import ly.count.android.sdk.Countly
import ly.count.android.sdk.CountlyConfig
/**
* Main Application class
*/
class App : Application() {
private val COUNTLY_SERVER_URL = "https://your.server.ly"
private val COUNTLY_APP_KEY = "YOUR_APP_KEY"
override fun onCreate() {
super.onCreate()
if (COUNTLY_SERVER_URL == "https://your.server.ly" || COUNTLY_APP_KEY == "YOUR_APP_KEY") {
Log.e("CountlyDemo", "Please provide correct COUNTLY_SERVER_URL and COUNTLY_APP_KEY")
return
}
val countlyConfig = CountlyConfig(
this,
COUNTLY_APP_KEY,
COUNTLY_SERVER_URL
)
.setDeviceId(
"myDeviceId"
)
.setLoggingEnabled(true)
countlyConfig.crashes.enableCrashReporting().enableRecordAllThreadsWithCrash()
Countly.sharedInstance().init(countlyConfig)
}
}