let accessToken = BuddyBuildSDK.valueForDeviceKey("Facebook_Token")
You might have API keys and other secrets that your app needs to consume — either at run time or during a build. However, you might not want to check these secrets into your source code to make them available to your app.
In order to securely propagate your credentials to your build and app, buddybuild provides two sets of variables that you can define:
Let’s get started with Device Variables!
Step 1: Create Device Variables in buddybuild
Launch the buddybuild dashboard and click on App Settings.
In the left navigation, select Build settings, then Device Variables.
Enter a name, value and select Create.
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).
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.