GIDSignInInternalOptions.m 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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/GIDSignInInternalOptions.h"
  15. NS_ASSUME_NONNULL_BEGIN
  16. @implementation GIDSignInInternalOptions
  17. + (instancetype)defaultOptions {
  18. GIDSignInInternalOptions *options = [[GIDSignInInternalOptions alloc] init];
  19. if (options) {
  20. options->_interactive = YES;
  21. options->_continuation = NO;
  22. }
  23. return options;
  24. }
  25. + (instancetype)silentOptions {
  26. GIDSignInInternalOptions *options = [self defaultOptions];
  27. if (options) {
  28. options->_interactive = NO;
  29. }
  30. return options;
  31. }
  32. + (instancetype)optionsWithExtraParams:(NSDictionary *)extraParams {
  33. GIDSignInInternalOptions *options = [self defaultOptions];
  34. if (options) {
  35. options->_extraParams = [extraParams copy];
  36. }
  37. return options;
  38. }
  39. - (instancetype)optionsWithExtraParameters:(NSDictionary *)extraParams
  40. forContinuation:(BOOL)continuation {
  41. GIDSignInInternalOptions *options = [[GIDSignInInternalOptions alloc] init];
  42. if (options) {
  43. options->_interactive = _interactive;
  44. options->_continuation = continuation;
  45. options->_extraParams = [extraParams copy];
  46. }
  47. return options;
  48. }
  49. @end
  50. NS_ASSUME_NONNULL_END