Mobile SDK

Integrate alby into your mobile app with our SDK

The alby SDK enables you to use the Alby Widget in your app. We offer two versions of the SDK - one for Android and another one for iOS.

Requirements

Before installing the SDK make sure you already have a brand created at alby and that you've already loaded at least some of your products to our system.

Documentation

Android SDK

iOS SDK


iOS

You can find a full example in our GitHub repository.

Installation

The iOS version only works for apps using SwiftUI.

You can install Alby for iOS using Swift Package Manager. Add https://github.com/albycom/alby_widget_ios as a Swift Package Repository in Xcode and follow the instructions to add AlbyWidget as a Swift Package.

Setup and Configuration

The alby widget works as an extension for any SwiftUI view.

Depending on how your view is structured the keyboard inside the bottom sheet might not work as expected. Make sure that you place the widget inside a ScrollView so the keyboard can scroll and the content be displayed.

import AlbyWidget

struct MyView: View {
  var body: some View {
    ScrollView {
      Text("Hello")
    }.addAlbyWidget(productId: "your product id", brandId: "your-brand-id")
  }
}
 Android

You can find a full example in the GitHub repository of the SDK.

Installation

AlbyWidget for Android requires a SDK 29+ and Jetpack Compose.

Gradle Kotlin

implementation("com.alby.widget:alby-widget:<version>")
 Gradle
implementation 'com.alby.widget:alby-widget:<version>'
 Apache Maven
<dependency>
<groupId>com.alby.widget</groupId>
<artifactId>alby-widget</artifactId>
<version><version></version>
</dependency>

Setup and Configuration

 First of all, make sure that you have internet permission enabled for your app inside your AndroidManifest.xml
<uses-permission android:name="android.permission.INTERNET" />
The widget is positioned at the bottom of the screen by default. If your app includes a bottom navigation bar or a similar component, ensure that the bottom sheet encompasses the tab area. Additionally, be sure to provide the necessary padding from the bottom bar to the widget, allowing it to display correctly above the navigation elements.
import com.alby.widget.AlbyWidgetScreen

AlbyWidgetScreen(brandId = "your-brand-id", productId ="your-product-id" ) {
 YourScreenGoesHere()
}