FIRBundleUtil.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright 2017 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 <Foundation/Foundation.h>
  17. /**
  18. * This class provides utilities for accessing resources in bundles.
  19. */
  20. @interface FIRBundleUtil : NSObject
  21. /**
  22. * Finds all relevant bundles, starting with [NSBundle mainBundle].
  23. */
  24. + (NSArray *)relevantBundles;
  25. /**
  26. * Reads the options dictionary from one of the provided bundles.
  27. *
  28. * @param resourceName The resource name, e.g. @"GoogleService-Info".
  29. * @param fileType The file type (extension), e.g. @"plist".
  30. * @param bundles The bundles to expect, in priority order. See also
  31. * +[FIRBundleUtil relevantBundles].
  32. */
  33. + (NSString *)optionsDictionaryPathWithResourceName:(NSString *)resourceName
  34. andFileType:(NSString *)fileType
  35. inBundles:(NSArray *)bundles;
  36. /**
  37. * Finds URL schemes defined in all relevant bundles, starting with those from
  38. * [NSBundle mainBundle].
  39. */
  40. + (NSArray *)relevantURLSchemes;
  41. /**
  42. * Checks if any of the given bundles have a matching bundle identifier prefix (removing extension
  43. * suffixes).
  44. */
  45. + (BOOL)hasBundleIdentifierPrefix:(NSString *)bundleIdentifier inBundles:(NSArray *)bundles;
  46. @end