Skip to content

Commit

Permalink
Merge pull request #1 from aidan-24com/main
Browse files Browse the repository at this point in the history
Update NarratiiveSDK.kt
  • Loading branch information
dlin-me authored Jul 9, 2021
2 parents fc3c3c4 + 0e4d4c4 commit fe2c9c2
Showing 1 changed file with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@ object NarratiiveSDK {
private var isSending: Boolean = false
private var isDebug: Boolean = false


fun init(context: Context, isDebug: Boolean = false) {
fun init(context: Context, _host: String, _hostKey: String, _useAaid: Boolean, isDebug: Boolean = false) {
this.isDebug = isDebug
this.context = context
this.apiService = NarratiiveApiService(context)
this.host = context.getString(R.string.narratiive_host)
this.hostKey = context.getString(R.string.narratiive_hostkey)
this.useAaid = context.getString(R.string.narratiive_use_aaid) == "1"
this.host = _host
this.hostKey = _hostKey
this.useAaid = _useAaid
this.sharedPref = context.getSharedPreferences(SHARED_PREF_FILE, Context.MODE_PRIVATE)
this.token = this.sharedPref.getString("token", null)

Expand All @@ -42,6 +41,14 @@ object NarratiiveSDK {
this.log("Init completed")
}

fun init(context: Context, isDebug: Boolean = false) {
this.init(context,
context.getString(R.string.narratiive_host),
context.getString(R.string.narratiive_hostkey),
context.getString(R.string.narratiive_use_aaid) == "1",
isDebug)
}

fun send(screenName: String?) {
this.log("Send started")
this.createHit(screenName)
Expand Down Expand Up @@ -103,4 +110,4 @@ object NarratiiveSDK {
}
}
}
}
}

0 comments on commit fe2c9c2

Please sign in to comment.