For Kotlin & Kotlin DSL
Step 1
Create folder libs in your Android project, under your app folder and copy the SparkYou-v1.1.aar to this folder

Step 2
Open your build.gradle.kts , add implementation(files("libs/SparkYou-v1.1.aar")) to dependencies section

Now you can import and use the SparkYouWebView to load SparkYou web app and inject the current user access token.
For example, add a button in your main activity and when user click this button, it will initiate a SparkYouWebView instance
Add a button to the main activity layout

In
MainActivity.ktImport
SparkYouWebViewandSparkYouWebViewDelegateAdd
import com.evehr.bosch.sparkyou.SparkYouWebViewDelegateSince we use
delegatefor communication between MainActivity and the SparkYouWebView , your MainActivity need to implement theSparkYouWebViewDelegateinterface. Modify your MainActivity as below:Add
openWebsiteButtonClickfunction (which was added toandroid:onClickin the above button code)Implement two functions required by the
SparkYouWebViewDelegateinterface
Last updated