Aucune description

utils.js 748B

123456789101112131415161718192021222324252627
  1. export const APPID = 'Your Agora APP_ID';
  2. // iPhoneX Xs
  3. const X_WIDTH = 375;
  4. const X_HEIGHT = 812;
  5. // iPhoneXR XsMax
  6. const XR_WIDTH = 414;
  7. const XR_HEIGHT = 896;
  8. //判断是否为iphoneX或Xs
  9. export function isIphoneX(Platform, SCREEN_WIDTH, SCREEN_HEIGHT) {
  10. return (
  11. Platform.OS === 'ios' &&
  12. ((SCREEN_HEIGHT === X_HEIGHT && SCREEN_WIDTH === X_WIDTH) ||
  13. (SCREEN_HEIGHT === X_WIDTH && SCREEN_WIDTH === X_HEIGHT))
  14. )
  15. };
  16. //判断是否为iphoneXR或XsMAX
  17. export function isIphoneXR(Platform, SCREEN_WIDTH, SCREEN_HEIGHT) {
  18. return (
  19. Platform.OS === 'ios' &&
  20. ((SCREEN_HEIGHT === XR_HEIGHT && SCREEN_WIDTH === XR_WIDTH) ||
  21. (SCREEN_HEIGHT === XR_WIDTH && SCREEN_WIDTH === XR_HEIGHT))
  22. )
  23. };