@erkamyaman/capacitor-foldable 7.0.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Package.swift +1 -1
- package/README.md +6 -10
- package/package.json +2 -2
package/Package.swift
CHANGED
|
@@ -10,7 +10,7 @@ let package = Package(
|
|
|
10
10
|
targets: ["FoldablePlugin"])
|
|
11
11
|
],
|
|
12
12
|
dependencies: [
|
|
13
|
-
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", "
|
|
13
|
+
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", "8.0.0"..<"9.0.0")
|
|
14
14
|
],
|
|
15
15
|
targets: [
|
|
16
16
|
.target(
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<a href="LICENSE"><img src="https://img.shields.io/npm/l/@erkamyaman/capacitor-foldable?style=for-the-badge" /></a>
|
|
8
8
|
</p>
|
|
9
9
|
<p align="center">
|
|
10
|
-
Fold state, posture, hinge angle
|
|
10
|
+
Fold state, posture, hinge angle, size classes and bar placement for foldable phones such as Galaxy Z Fold and Flip, Pixel Fold and iPhone Duo, in Capacitor apps.
|
|
11
11
|
</p>
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
@@ -15,9 +15,6 @@ const { state, hingeOrientation } = await Foldable.getFoldState();
|
|
|
15
15
|
// { state: 'half-opened', hingeOrientation: 'horizontal' }
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
> [!NOTE]
|
|
19
|
-
> **This is v7, for Capacitor 7.** On Android every function and event works. On iOS only size classes are real: `getSizeClass()` and `sizeClassChange`. The other functions run but report no fold (`getFoldState()` returns `flat`, `getHingeAngle()` returns `{ angle: null }` and `getBarPlacement()` `{ verticalBarEdge: null }`), and `hingeAngleChange` and `barPlacementChange` never fire. Capacitor 7 apps must be built with Xcode 26, which doesn't have Apple's iPhone Duo APIs. For iPhone Duo, use v8 with Capacitor 8.5 or later.
|
|
20
|
-
|
|
21
18
|
### Versions
|
|
22
19
|
|
|
23
20
|
| Capacitor | Plugin | iOS |
|
|
@@ -29,8 +26,8 @@ const { state, hingeOrientation } = await Foldable.getFoldState();
|
|
|
29
26
|
|
|
30
27
|
| Platform | Status | Minimum |
|
|
31
28
|
| -------- | ------ | ------- |
|
|
32
|
-
| Android | Supported | API
|
|
33
|
-
| iOS | Size classes
|
|
29
|
+
| Android | Supported | API 24, `compileSdk` 34 |
|
|
30
|
+
| iOS | Size classes everywhere; fold, hinge and bar placement on iPhone Duo with Capacitor 8.5+, Xcode 27.1+ and iOS 27.1+ | iOS 15 |
|
|
34
31
|
| Web | Stub, returns `flat` | |
|
|
35
32
|
|
|
36
33
|
## Do you need this plugin?
|
|
@@ -42,18 +39,17 @@ Web views already resize with the window, so a responsive layout that pads with
|
|
|
42
39
|
- **How the device is held**: flat, tabletop or book.
|
|
43
40
|
- **The hinge angle**, for effects and interactions.
|
|
44
41
|
- **Outer or inner display**, and Material window size classes.
|
|
42
|
+
- **Where iPhone Duo puts native bars**, so your HTML tab bar can follow.
|
|
45
43
|
- **The outer display on Android foldables**: rear display and dual screen.
|
|
46
44
|
|
|
47
45
|
## Installation
|
|
48
46
|
|
|
49
47
|
```bash
|
|
50
|
-
npm install @erkamyaman/capacitor-foldable
|
|
48
|
+
npm install @erkamyaman/capacitor-foldable
|
|
51
49
|
npx cap sync
|
|
52
50
|
```
|
|
53
51
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
Build Capacitor 7 apps with Xcode 26. iOS 27 requires the scene lifecycle for apps built with Xcode 27, and Capacitor 7 doesn't adopt it, so a Capacitor 7 app built with Xcode 27 crashes at launch, with or without this plugin.
|
|
52
|
+
On Capacitor 7, install `@erkamyaman/capacitor-foldable@7` instead.
|
|
57
53
|
|
|
58
54
|
## Usage
|
|
59
55
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@erkamyaman/capacitor-foldable",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"description": "Fold-state and dual-display APIs for foldable devices in Capacitor apps",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"typescript": "^5.9.3"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
|
-
"@capacitor/core": "^
|
|
78
|
+
"@capacitor/core": "^8.0.0"
|
|
79
79
|
},
|
|
80
80
|
"prettier": "@ionic/prettier-config",
|
|
81
81
|
"swiftlint": "@ionic/swiftlint-config",
|