FIRDLRetrievalProcessFactory.m 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 <TargetConditionals.h>
  17. #if TARGET_OS_IOS
  18. #import "FirebaseDynamicLinks/Sources/FIRDLRetrievalProcessFactory.h"
  19. #import "FirebaseDynamicLinks/Sources/FIRDLDefaultRetrievalProcessV2.h"
  20. NS_ASSUME_NONNULL_BEGIN
  21. @implementation FIRDLRetrievalProcessFactory {
  22. FIRDynamicLinkNetworking *_networkingService;
  23. NSString *_URLScheme;
  24. NSString *_APIKey;
  25. NSString *_FDLSDKVersion;
  26. id<FIRDLRetrievalProcessDelegate> _delegate;
  27. }
  28. - (instancetype)initWithNetworkingService:(FIRDynamicLinkNetworking *)networkingService
  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. _URLScheme = URLScheme;
  36. _APIKey = APIKey;
  37. _FDLSDKVersion = FDLSDKVersion;
  38. _delegate = delegate;
  39. }
  40. return self;
  41. }
  42. - (id<FIRDLRetrievalProcessProtocol>)automaticRetrievalProcess {
  43. return [[FIRDLDefaultRetrievalProcessV2 alloc] initWithNetworkingService:_networkingService
  44. URLScheme:_URLScheme
  45. APIKey:_APIKey
  46. FDLSDKVersion:_FDLSDKVersion
  47. delegate:_delegate];
  48. }
  49. @end
  50. NS_ASSUME_NONNULL_END
  51. #endif // TARGET_OS_IOS