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 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.
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.