Fullstack mobile apps developer 📱
istornz / flutter_gaimon Goto Github PK
View Code? Open in Web Editor NEWA Flutter plugin to fully support Haptic feedback with custom pattern 📳
License: MIT License
A Flutter plugin to fully support Haptic feedback with custom pattern 📳
License: MIT License
I copy pasted the example code but for some reason tapping on them does nothing on iPhone 6s+ 15.4.1 I even went into settings and made sure vibration was on
I see it's been on the roadmap for quite some time. Any plans to implement this?
Thanks
Using custom vibration patterns is only supported on iPhone 8 and newer devices.
Source – Introducing Core Haptics - WWDC19 - Videos - Apple Developer. Timecode – 1:50
Using other vibration types like UISelectionFeedbackGenerator, UINotificationFeedbackGenerator, etc. works since iPhone 7.
Source
On older iPhones, like 6s, the functionality is not supported at all
On Android I am receiving MissingPluginException (MissingPluginException(No implementation found for method canSupportsHaptic on channel gaimon))
when calling await Gaimon.canSupportsHaptic;
. Haptics do work on my phone; should this method only be used for iOS?
Got this error after build:
* What went wrong:
A problem occurred configuring project ':gaimon'.
> Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl.
> Namespace not specified. Specify a namespace in the module's build file. See https://d.android.com/r/tools/upgrade-assistant/set-namespace for information about setting the namespace.
If you've specified the package attribute in the source AndroidManifest.xml, you can use the AGP Upgrade Assistant to migrate to the namespace value in the build file. Refer to https://d.android.com/r/tools/upgrade-assistant/agp-upgrade-assistant for general information about using the AGP Upgrade Assistant.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
BUILD FAILED in 1s
Running Gradle task 'assembleRelease'... 1.662ms
Gradle task assembleRelease failed with exit code 1
Flutter Doctor:
[✓] Flutter (Channel stable, 3.16.8, on Fedora Linux 36 (KDE Plasma) 5.18.13-200.fc36.x86_64, locale pt_BR.UTF-8)
• Flutter version 3.16.8 on channel stable at /home/vicente/fvm/versions/3.16.8
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 67457e669f (10 days ago), 2024-01-16 16:22:29 -0800
• Engine revision 6e2ea58a5c
• Dart version 3.2.5
• DevTools version 2.28.5
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /home/vicente/Android/Sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: /opt/android-studio/jbr/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• Chrome at google-chrome
[✓] Linux toolchain - develop for Linux desktop
• clang version 14.0.5 (Fedora 14.0.5-2.fc36)
• cmake version 3.26.3
• ninja version 1.10.2
• pkg-config version 1.8.0
[✓] Android Studio (version 2023.1)
• Android Studio at /opt/android-studio
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
[✓] VS Code (version 1.85.1)
• VS Code at /usr/share/code
• Flutter extension version 3.80.0
[✓] Connected device (2 available)
• Linux (desktop) • linux • linux-x64 • Fedora Linux 36 (KDE Plasma) 5.18.13-200.fc36.x86_64
• Chrome (web) • chrome • web-javascript • Google Chrome 116.0.5845.179
[✓] Network resources
• All expected network resources are available.
• No issues found!
^1.2.1
android {
namespace '<mynamespace>'
...
}
Android build fails since version 1.1.0
The placement of the parameter name and type is incorrect.
It should be changed to:
fun vibrate(effect: VibrationEffect) {
As stated in the readme.md, the support for .ahab files in Android is still missing. To support custom haptic behaviour based on .ahab files on all devices, a Android implementation should be provided as well.
I started on a Pull Request implementing .ahab support on Android. It still has some values that are missing based on the documentation of Apple. Also the only thing that is considered now is the Intensity of an event. The Sharpness is, as far as I know, not something that can be controlled with the vibration api of Android.
@istornz What do you think of the current approach? I intend to add the implementation of missing values as well
I'm doing this app that will give haptic feedback when the user swipes on the screen. I put Gaimon.soft() in onPanUpdates gesture event, it worked well at first, but after a while i get this error:
[Feedback] failed to create player with pattern for <_UIFeedbackCoreHapticsHapticsOnlyEngine: 0x280f7aa00>: Error Domain=com.apple.CoreHaptics Code=-10851 "(null)"
[hapi] CHHapticEngine.mm:1917 -[CHHapticEngine(CHHapticEngineInternal) getAvailableChannel:]: ERROR: Unable to add an additional player channel
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.