• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

realm / realm-js / 6379399597

02 Oct 2023 11:17AM UTC coverage: 85.388%. Remained the same
6379399597

Pull #6169

github

web-flow
Delete deploy-cluster workflow

This workflow keeps a cluster on QA alive for v11 to test against - which is no longer needed are we're focussing work on v12 going forward.
Pull Request #6169: Delete deploy-cluster workflow

894 of 1109 branches covered (0.0%)

Branch coverage included in aggregate %.

2326 of 2662 relevant lines covered (87.38%)

969.9 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/packages/realm/src/platform/react-native/device-info.ts
1
////////////////////////////////////////////////////////////////////////////
2
//
3
// Copyright 2023 Realm Inc.
4
//
5
// Licensed under the Apache License, Version 2.0 (the "License");
6
// you may not use this file except in compliance with the License.
7
// You may obtain a copy of the License at
8
//
9
// http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing, software
12
// distributed under the License is distributed on an "AS IS" BASIS,
13
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
// See the License for the specific language governing permissions and
15
// limitations under the License.
16
//
17
////////////////////////////////////////////////////////////////////////////
18

19
import { Platform } from "react-native";
20

21
import { version } from "realm/package.json";
22
import { REALM_ANONYMIZED_BUNDLE_ID } from "realm/realm-constants.json";
23

24
import { inject } from "../device-info";
25
import { JsPlatformHelpers } from "../../binding";
26

27
function getDeviceName() {
28
  if (Platform.OS === "ios") {
×
29
    if (Platform.isPad) {
×
30
      return "iPad";
×
31
    } else if (Platform.isTV) {
×
32
      return "AppleTV";
×
33
    } else {
34
      // RN doesn't support Apple Watch
35
      return "iPhone";
×
36
    }
37
  } else if (Platform.OS === "android") {
×
38
    return `${Platform.constants.Manufacturer}:${Platform.constants.Brand}`;
×
39
  } else {
40
    return "unknown";
×
41
  }
42
}
43

44
function getDeviceVersion() {
45
  if (Platform.OS === "android") {
×
46
    return `${Platform.constants.Model}`;
×
47
  } else {
48
    return "unknown";
×
49
  }
50
}
51

52
function getReactNativeVersion() {
53
  const { major, minor, patch, prerelease } = Platform.constants.reactNativeVersion;
×
54
  const result = [major, minor, patch].join(".");
×
55
  if (prerelease) {
×
56
    return result + "-" + prerelease;
×
57
  } else {
58
    return result;
×
59
  }
60
}
61

62
inject({
×
63
  create() {
64
    return {
×
65
      sdk: "JS",
66
      sdkVersion: version,
67

68
      platform: Platform.OS,
69
      // Android reports a number ...
70
      platformVersion: `${Platform.Version}`,
71

72
      deviceName: getDeviceName(),
73
      deviceVersion: getDeviceVersion(),
74

75
      cpuArch: JsPlatformHelpers.getCpuArch(),
76

77
      frameworkName: "react-native",
78
      frameworkVersion: getReactNativeVersion(),
79

80
      bundleId: REALM_ANONYMIZED_BUNDLE_ID,
81
    };
82
  },
83
});
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc