FIRDLRetrievalProcessFactory.m 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 *_clientID;
  24. NSString *_URLScheme;
  25. NSString *_APIKey;
  26. NSString *_FDLSDKVersion;
  27. id<FIRDLRetrievalProcessDelegate> _delegate;
  28. }
  29. - (instancetype)initWithNetworkingService:(FIRDynamicLinkNetworking *)networkingService
  30. clientID:(NSString *)clientID
  31. URLScheme:(NSString *)URLScheme
  32. APIKey:(NSString *)APIKey
  33. FDLSDKVersion:(NSString *)FDLSDKVersion
  34. delegate:(id<FIRDLRetrievalProcessDelegate>)delegate {
  35. if (self = [super init]) {
  36. _networkingService = networkingService;
  37. _clientID = clientID;
  38. _URLScheme = URLScheme;
  39. _APIKey = APIKey;
  40. _FDLSDKVersion = FDLSDKVersion;
  41. _delegate = delegate;
  42. }
  43. return self;
  44. }
  45. - (id<FIRDLRetrievalProcessProtocol>)automaticRetrievalProcess {
  46. return [[FIRDLDefaultRetrievalProcessV2 alloc] initWithNetworkingService:_networkingService
  47. clientID:_clientID
  48. URLScheme:_URLScheme
  49. APIKey:_APIKey
  50. FDLSDKVersion:_FDLSDKVersion
  51. delegate:_delegate];
  52. }
  53. @end
  54. NS_ASSUME_NONNULL_END
  55. #endif // TARGET_OS_IOS