GIDSignInPreferences.m 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // Copyright 2021 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #import "GoogleSignIn/Sources/GIDSignInPreferences.h"
  15. NS_ASSUME_NONNULL_BEGIN
  16. static NSString *const kLSOServer = @"accounts.google.com";
  17. static NSString *const kTokenServer = @"oauth2.googleapis.com";
  18. static NSString *const kUserInfoServer = @"www.googleapis.com";
  19. // This convolved list of C macros is needed because the Xcode project generated
  20. // by blaze build and the command itself have inconsistent escaping of the
  21. // quotation marks in -D flags, which makes passing '"' as part of the macro
  22. // value impossible.
  23. #define STR(x) STR_EXPAND(x)
  24. #define STR_EXPAND(x) #x
  25. // The name of the query parameter used for logging the SDK version.
  26. NSString *const kSDKVersionLoggingParameter = @"gpsdk";
  27. // The prefixed sdk version string to differentiate gid version values used with the legacy gpsdk
  28. // logging key.
  29. NSString* GIDVersion(void) {
  30. return [NSString stringWithFormat:@"gid-%s",(const char* const)STR(GID_SDK_VERSION)];
  31. }
  32. @implementation GIDSignInPreferences
  33. + (NSString *)googleAuthorizationServer {
  34. return kLSOServer;
  35. }
  36. + (NSString *)googleTokenServer {
  37. return kTokenServer;
  38. }
  39. + (NSString *)googleUserInfoServer {
  40. return kUserInfoServer;
  41. }
  42. @end
  43. NS_ASSUME_NONNULL_END