fluttercommunity / fluttercommunity/wakelock_plus

Migrate iOS Objective-C version to Swift

Open
#110 0 comments 0 reactions 1 assignee Claimed by @diegotori View on GitHub
enhancement
Dominant language
Dart
Stars
109
Forks
97
Avg merge
5d 4h
Merged PRs (30d)
2

Description

iOS has known issues where it may not keep the screen on (affecting 16.4 and higher). Once I get myself an iOS device, I'm gonna port the code from [Insomnia.swift](https://github.com/ochococo/Insomnia/blob/master/Insomnia/Insomnia.swift) into the iOS platform channel. The emulator may not be ideal for testing the wakelock.

Nevertheless, I do accept and will review PRs related to this. As long as it passes the existing integration tests, then it'll get merged and released.

If you submit a PR to this effect, then you will also have to update wakelock_plus_platform_interface and regenerate the pigeon classes so that they generate Swift instead of Objective-C.

As a bonus goal, if we can centralize the Darwin (iOS/MacOS) version into a single location, then we can simplify things further. That would involve creating a base protocol that gets implemented for both MacOS and iOS respectively. Then load up the correct one for each platform via static factory method.

EDIT: Here's what the [implementation](https://gist.github.com/diegotori/8a01a9eb93a83c997bb3fe151a75bedc) make look like.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.