In Android I used to store my keys using NDK, what is the equivalent way of storing API keys in iOS. Can I store them in a header file?
Asked
Active
Viewed 136 times
1
-
Create a constants file and you can store keys into it.struct Appkeys { static let APP_DEVICE_ID = "Your device ID" } – manishsharma93 Jun 24 '19 at 07:02
-
@manishsharma93 I am little bit new to iOS app development.. will the Constants.swift file safe to decompilation of my app – Aditya Borde Jun 24 '19 at 07:07
-
Yes. But if your data is too sensitive. Store it in Keychain. But remember you can't store much in it. Just few items. – manishsharma93 Jun 24 '19 at 07:09
-
@manishsharma93 But I think we cannot store a static value in keychain before app installs i.e. on first open I have to programatically add the API keys to the keychain? – Aditya Borde Jun 24 '19 at 07:18
-
Yes. Then go for constant file with Static. – manishsharma93 Jun 24 '19 at 07:24
-
@manishsharma93 Ok... cool – Aditya Borde Jun 24 '19 at 07:28