1. What is the context?
I have built an Ionic 5/Capacitor/React app where I have added the cordova-plugin-shake through capacitor by following the Ionic Docs.
2. What does the code look like?
import React from "react";
import { Subscription } from "rxjs";
import { Shake } from "@ionic-native/shake";
// other stuff...
class MagicEightBall extends React.Component {
shakeSubscription: Subscription = new Subscription();
ionViewWillEnter() {
console.log("Magic8Ball ionViewWillEnter()");
this.shakeSubscription = Shake.startWatch().subscribe(() => this.onShake());
}
onShake() {
// process shake
}
}
3. What is the problem?
This works perfectly on Android, but it does not work on iOS. I have made sure the Cordova dependencies have been installed through pod install and that seems to have gone fine. Have been looking for an answer for quite some time now, but I cannot seem to fix it. It has been tested on an iPhone 6S with the latest iOS version as well as on an iPad. The Android version has been run on a Xiaomi Mi 9 and it has worked since the start. Just cannot get it running on iOS.
Any ideas?
1. What is the context?
I have built an Ionic 5/Capacitor/React app where I have added the cordova-plugin-shake through capacitor by following the Ionic Docs.
2. What does the code look like?
3. What is the problem?
This works perfectly on Android, but it does not work on iOS. I have made sure the Cordova dependencies have been installed through pod install and that seems to have gone fine. Have been looking for an answer for quite some time now, but I cannot seem to fix it. It has been tested on an iPhone 6S with the latest iOS version as well as on an iPad. The Android version has been run on a Xiaomi Mi 9 and it has worked since the start. Just cannot get it running on iOS.
Any ideas?