FIRDLRetrievalProcessFactory.m 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright 2018 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import "DynamicLinks/FIRDLRetrievalProcessFactory.h"
  17. #import "DynamicLinks/FIRDLDefaultRetrievalProcessV2.h"
  18. NS_ASSUME_NONNULL_BEGIN
  19. @implementation FIRDLRetrievalProcessFactory {
  20. FIRDynamicLinkNetworking *_networkingService;
  21. NSString *_clientID;
  22. NSString *_URLScheme;
  23. NSString *_APIKey;
  24. NSString *_FDLSDKVersion;
  25. id<FIRDLRetrievalProcessDelegate> _delegate;
  26. }
  27. - (instancetype)initWithNetworkingService:(FIRDynamicLinkNetworking *)networkingService
  28. clientID:(NSString *)clientID
  29. URLScheme:(NSString *)URLScheme
  30. APIKey:(NSString *)APIKey
  31. FDLSDKVersion:(NSString *)FDLSDKVersion
  32. delegate:(id<FIRDLRetrievalProcessDelegate>)delegate {
  33. if (self = [super init]) {
  34. _networkingService = networkingService;
  35. _clientID = clientID;
  36. _URLScheme = URLScheme;
  37. _APIKey = APIKey;
  38. _FDLSDKVersion = FDLSDKVersion;
  39. _delegate = delegate;
  40. }
  41. return self;
  42. }
  43. - (id<FIRDLRetrievalProcessProtocol>)automaticRetrievalProcess {
  44. return [[FIRDLDefaultRetrievalProcessV2 alloc] initWithNetworkingService:_networkingService
  45. clientID:_clientID
  46. URLScheme:_URLScheme
  47. APIKey:_APIKey
  48. FDLSDKVersion:_FDLSDKVersion
  49. delegate:_delegate];
  50. }
  51. @end
  52. NS_ASSUME_NONNULL_END