GIDSignInPreferences.m 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. // The name of the query parameter used for logging the SDK version.
  20. NSString *const kSDKVersionLoggingParameter = @"gpsdk";
  21. #ifndef GID_SDK_VERSION
  22. #error "GID_SDK_VERSION is not defined: add -DGID_SDK_VERSION=x.x.x to the build invocation."
  23. #endif
  24. // Because macro expansions aren't performed on a token following the # preprocessor operator, we
  25. // wrap STR_EXPAND(x) with the STR(x) to produce a quoted string representation of a macro.
  26. // https://www.guyrutenberg.com/2008/12/20/expanding-macros-into-string-constants-in-c/
  27. #define STR(x) STR_EXPAND(x)
  28. #define STR_EXPAND(x) #x
  29. // The prefixed sdk version string to differentiate gid version values used with the legacy gpsdk
  30. // logging key.
  31. NSString* GIDVersion(void) {
  32. return [NSString stringWithFormat:@"gid-%@", @STR(GID_SDK_VERSION)];
  33. }
  34. @implementation GIDSignInPreferences
  35. + (NSString *)googleAuthorizationServer {
  36. return kLSOServer;
  37. }
  38. + (NSString *)googleTokenServer {
  39. return kTokenServer;
  40. }
  41. + (NSString *)googleUserInfoServer {
  42. return kUserInfoServer;
  43. }
  44. @end
  45. NS_ASSUME_NONNULL_END