This SDK relies on Universal Links. You may refer to this guide to setup your mobile app with a domain name.
// Import the SDK
import fr.alphalyr.marketingstudiosdk.AlphalyrMarketingStudioSdk
class MainActivity: AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
// Configure the SDK
AlphalyrMarketingStudioSdk.configure(
"MY_ALPHALYR_AID",
applicationContext,
excludedUniversalLinkingParams = arrayOf("secret", "params"),
)
// Add a listener for universal linking
AlphalyrMarketingStudioSdk.onNewIntent(intent)
}
override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
// Add a listener for universal linking
AlphalyrMarketingStudioSdk.onNewIntent(intent)
}
}AlphalyrMarketingStudioSdk.setCustomerId(customerId: String) // usually SHA256 of email address
AlphalyrMarketingStudioSdk.setGdprConsent(consent: Bool)AlphalyrMarketingStudioSdk.trackTransaction(
totalPrice: Double, // amount without taxes, without shipping costs
totalPriceWithTax: Double, // amount with taxes included
reference: String, // order id
new: Bool, // true if new customer, false if returning customer
currency: String, // currency ISO-4217 code (i.e: EUR)
discountCode: String?, // coupon code
discountAmount: Double?,
products: List<Triple<String, Int, Double>>
)