私は、私たちのウェブサイトからAPIを使うべきiOSアプリケーションに取り組んでいます。 接続するには、デバイスからGoogleアカウントにログインし、自動的にAPIに接続する必要があります。我々はhttps://developers.google.com/identity/sign-in/ios/start-integrating 承認のために実行時にクライアントIDを変更する、Googleログイン
を使用します。問題は複数のウェブサイトがあり、それぞれに異なるクライアントIDがあることです。
私はプログラム的にCLIENT_IDを格納するの.plistを変更しようとした、それが動作しないでしょう。
@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)
}
たぶん誰もが知っている、それを行うことも可能でしょうか?