I am working on iOS app which should use API from our website. In order to connect to it user should Log In to his google account from device and then we automatically connect to API. We use https://developers.google.com/identity/sign-in/ios/start-integrating for authorization
The problem is that there is more than one website and each of them has different Client ID.
I've tried to change .plist which stores CLIENT_ID programmatically and it wouldn't work:
@IBAction func signInButtonClicked(sender: AnyObject) {
let signInPlistDirectory = *pathToGoogleService-Info.plist*
let signInPlist = NSMutableDictionary(contentsOfFile: signInPlistDirectory)!
if ((webNodeUrl.text?.hasSuffix(".testing-sites.internal")) != nil) {
signInPlist["CLIENT_ID"] = signInPlist["TESTING_CLIENT_ID"]
} else {
signInPlist["CLIENT_ID"] = signInPlist["PROD_CLIENT_ID"]
}
signInPlist.writeToFile(signInPlistDirectory, atomically: true)
}
Maybe anybody knows, is it even possible to do?