@erkamyaman/capacitor-foldable 7.0.1 → 8.0.1

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.
Files changed (3) hide show
  1. package/Package.swift +1 -1
  2. package/README.md +13 -12
  3. 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", "7.0.0"..<"8.0.0")
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,12 +7,17 @@
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 and size classes for foldable phones such as Galaxy Z Fold and Flip and Pixel Fold, in Capacitor 7 apps.
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
  <p align="center">
14
- <img width="420" alt="Pixel Fold in tabletop posture" src="https://raw.githubusercontent.com/erkamyaman/capacitor-foldable/main/docs/images/android-tabletop.jpg">
15
- <img width="420" alt="Pixel Fold half-open in book posture" src="https://raw.githubusercontent.com/erkamyaman/capacitor-foldable/main/docs/images/android-book.jpg">
14
+ <img height="240" alt="iPhone Duo closed, on the outer display" src="https://raw.githubusercontent.com/erkamyaman/capacitor-foldable/main/docs/images/iphone-duo-closed.png">
15
+ <img height="240" alt="iPhone Duo half-open in book posture" src="https://raw.githubusercontent.com/erkamyaman/capacitor-foldable/main/docs/images/iphone-duo-book.png">
16
+ <img height="240" alt="iPhone Duo fully open" src="https://raw.githubusercontent.com/erkamyaman/capacitor-foldable/main/docs/images/iphone-duo-open.png">
17
+ </p>
18
+ <p align="center">
19
+ <img height="300" alt="Pixel Fold in tabletop posture" src="https://raw.githubusercontent.com/erkamyaman/capacitor-foldable/main/docs/images/android-tabletop.jpg">
20
+ <img height="300" alt="Pixel Fold half-open in book posture" src="https://raw.githubusercontent.com/erkamyaman/capacitor-foldable/main/docs/images/android-book.jpg">
16
21
  </p>
17
22
 
18
23
  ```typescript
@@ -20,9 +25,6 @@ const { state, hingeOrientation } = await Foldable.getFoldState();
20
25
  // { state: 'half-opened', hingeOrientation: 'horizontal' }
21
26
  ```
22
27
 
23
- > [!NOTE]
24
- > **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.
25
-
26
28
  ### Versions
27
29
 
28
30
  | Capacitor | Plugin | iOS |
@@ -34,8 +36,8 @@ const { state, hingeOrientation } = await Foldable.getFoldState();
34
36
 
35
37
  | Platform | Status | Minimum |
36
38
  | -------- | ------ | ------- |
37
- | Android | Supported | API 23, `compileSdk` 34 |
38
- | iOS | Size classes. No iPhone Duo features: use plugin v8 with Capacitor 8.5+ for those | iOS 14, built with Xcode 26 |
39
+ | Android | Supported | API 24, `compileSdk` 34 |
40
+ | 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 |
39
41
  | Web | Stub, returns `flat` | |
40
42
 
41
43
  ## Do you need this plugin?
@@ -47,18 +49,17 @@ Web views already resize with the window, so a responsive layout that pads with
47
49
  - **How the device is held**: flat, tabletop or book.
48
50
  - **The hinge angle**, for effects and interactions.
49
51
  - **Outer or inner display**, and Material window size classes.
52
+ - **Where iPhone Duo puts native bars**, so your HTML tab bar can follow.
50
53
  - **The outer display on Android foldables**: rear display and dual screen.
51
54
 
52
55
  ## Installation
53
56
 
54
57
  ```bash
55
- npm install @erkamyaman/capacitor-foldable@7
58
+ npm install @erkamyaman/capacitor-foldable
56
59
  npx cap sync
57
60
  ```
58
61
 
59
- This is the Capacitor 7 version. On Capacitor 8, install the latest `@erkamyaman/capacitor-foldable` instead, which also supports iPhone Duo.
60
-
61
- 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.
62
+ On Capacitor 7, install `@erkamyaman/capacitor-foldable@7` instead.
62
63
 
63
64
  ## Usage
64
65
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erkamyaman/capacitor-foldable",
3
- "version": "7.0.1",
3
+ "version": "8.0.1",
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": "^7.0.0"
78
+ "@capacitor/core": "^8.0.0"
79
79
  },
80
80
  "prettier": "@ionic/prettier-config",
81
81
  "swiftlint": "@ionic/swiftlint-config",