RCNDevice.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright 2019 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. typedef NS_ENUM(NSInteger, RCNDeviceModel) {
  18. RCNDeviceModelOther,
  19. RCNDeviceModelPhone,
  20. RCNDeviceModelTablet,
  21. RCNDeviceModelTV,
  22. RCNDeviceModelGlass,
  23. RCNDeviceModelCar,
  24. RCNDeviceModelWearable,
  25. };
  26. /// CocoaPods SDK version
  27. NSString *FIRRemoteConfigPodVersion(void);
  28. /// App version.
  29. NSString *FIRRemoteConfigAppVersion(void);
  30. /// Device country, in lowercase.
  31. NSString *FIRRemoteConfigDeviceCountry(void);
  32. /// Device locale, in language_country format, e.g. en_US.
  33. NSString *FIRRemoteConfigDeviceLocale(void);
  34. /// Device subtype.
  35. RCNDeviceModel FIRRemoteConfigDeviceSubtype(void);
  36. /// Device timezone.
  37. NSString *FIRRemoteConfigTimezone(void);
  38. /// SDK version. This is different than CocoaPods SDK version.
  39. /// It is used for config server to keep track iOS client version.
  40. /// major * 10000 + minor + 100 + patch.
  41. int FIRRemoteConfigSDKVersion(void);
  42. /// Update device context to the given dictionary.
  43. NSMutableDictionary *FIRRemoteConfigDeviceContextWithProjectIdentifier(
  44. NSString *GMPProjectIdentifier);
  45. /// Check whether client has changed device context, including app version,
  46. /// iOS version, device country etc. This is used to determine whether to throttle.
  47. BOOL FIRRemoteConfigHasDeviceContextChanged(NSDictionary *deviceContext,
  48. NSString *GMPProjectIdentifier);