Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: KeepAwake MIA in iOS #50

Closed
adventmedia opened this issue Aug 24, 2024 · 2 comments
Closed

bug: KeepAwake MIA in iOS #50

adventmedia opened this issue Aug 24, 2024 · 2 comments

Comments

@adventmedia
Copy link

Plugin version:
5.0.1

Platform(s):
iOS 17.6.1, iPad Pro 3rd Gen.

Current behaviour:
Calls to KeepAwake in iOS app fail silently - no result returned (works just fine in desktop web browser)

Expected behavior:
Calls to KeepAwake should return result

Related code:
Code in app:

  private async checkIsSleepSupported() {
    console.log('checkIsSleepSupported', KeepAwake);
    try {
      const ok = await KeepAwake.isSupported();
      this.sleepSupported = ok.isSupported;
      console.log('sleep supported:', KeepAwake, ok, this.sleepSupported);
    } catch (err) {
      console.error('KeepAwake failed:', err);
    }
  }

Other information:
Console logs in desktop browser (Chrome):

checkIsSleepSupported 
sleep supported: Proxy(Object) {}  {isSupported: true} true

in Xcode console:

⚡️  [log] - checkIsSleepSupported {}
⚡️  [error] - KeepAwake failed: {"code":"UNIMPLEMENTED"}

Capacitor doctor:

💊   Capacitor Doctor  💊 

Latest Dependencies:

  @capacitor/cli: 6.1.2
  @capacitor/core: 6.1.2
  @capacitor/android: 6.1.2
  @capacitor/ios: 6.1.2

Installed Dependencies:

  @capacitor/android: not installed
  @capacitor/cli: 6.1.0
  @capacitor/core: 6.1.0
  @capacitor/ios: 6.1.0

[success] iOS looking great! 👌

App is using Angular 18.x

@robingenz
Copy link
Member

This error does not come from the plugin, but from Capacitor. It appears that you have not installed the plugin correctly. Please take a look at the Capacitor iOS Troubleshooting Guide.

@adventmedia
Copy link
Author

actually the problem appears to be that capacitor does not like mono-repos (I’m developing two apps with a lot of shared code). Wonder is that everything worked before except KeepAwake; now the app doesn’t run at all. Such fun.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants