Closed gitbetter closed 6 years ago
I compiled with Xcode 8.3.2 and it gave me error on run time at these lines: self.timer.setEventHandler(handler: self.timerCallBack()) self.timer.scheduleRepeating(deadline: .now(), interval: Double(NSEC_PER_SEC) / 300.0, leeway: .seconds(0))
Test with iPhone 6 Plus iOS 10.3.3.
Please help, thanks!
What is the error you're getting? Can you provide a stack trace?
Hi gitbetter,
To reproduce it, i do as followings:
Create a new cordova project named "Test"
Add platform ios@4.4.0
Install the plugin from your branch https://github.com/gitbetter/cordova-plugin-dbmeter.git
Open "www/js/index.js" file, put this code into onDeviceReady function handler (line 31): DBMeter.start(function(dB){ console.log(dB); }, function(e){ console.log('code: ' + e.code + ', message: ' + e.message); });
Build it for iOS (My XCode is 8.3.2) - No error throwing so far
Navigate to this file "Test.xcworkspace" in ios platform folder and open it in XCode
Set "Deployment target = 9.0". Run it in debug mode to my iPhone 6 device which is running iOS 10.3.2
Please let me know if you need any other info in order to debug it. I thought it could be because I call the DBMeter.start function before the device is in ready state mode but seems not. My code is clearly placed inside the onDeviceReady function:
onDeviceReady: function() {
this.receivedEvent('deviceready');
DBMeter.start(function(dB){
console.log(dB);
}, function(e){
console.log('code: ' + e.code + ', message: ' + e.message);
});
},
Thanks!
The Swift file was throwing errors and the plugin was not compiling the file to reflect changes in the newer Swift versions. It now compiles and works like a charm. It should work for both iOS 9 and 10.