Device variables

Device variables allow you to specify API keys, access tokens, or other secrets that your app needs to consume at run time, without having them checked in to your repository.

Device variables are made available to your app during run time via the buddybuild SDK.

Important

Device variables are currently only available for iOS apps.

Step 1: Create Device Variables in buddybuild

Launch the buddybuild dashboard and click on App Settings.

The buddybuild dashboard

In the left navigation, select Build settings, then Device Variables.

The Device variables button

Enter a name, value and select Create.

The Device variables screen

Buddybuild securely embeds your variable into the app when it is built next. Your variable is consumable via the buddybuild SDK.

Step 2: Consuming the variable

To consume the variable in your build, substitute the name of your device variable where applicable (see example below).

let accessToken = BuddyBuildSDK.valueForDeviceKey("Facebook_Token")
NSString* accessToken = [BuddyBuildSDK valueForDeviceKey:@"Facebook_Token"];

That’s it! For more details, refer to our SDK API guide.

If you want to consume your variables from within your build instead, follow the Environment Variables guide.

results matching ""

    No results matching ""