Skip to content

Latest commit

 

History

History
59 lines (41 loc) · 1.75 KB

device_variables.adoc

File metadata and controls

59 lines (41 loc) · 1.75 KB
titletext description
How to create device variables to secure passwords and keys
Define device variables, that can be accessed during the build or at run-time, to store keys, access tokens, or other secrets required by your mobile app.

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.

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.