So let me start of by saying I am new to Objective-C and pretty much all of my experience has been in very high-level languages like javascript and ruby so learning it has been tough and I know there are a lot of concepts I don't have a good grasp on.
I am currently building a cordova plugin to be able to integrate the MagTek eDynamo reader into cordova IOS apps. My plugin is based largely off of this plugin and I have been using the existing code along with the Magtek SDK Documentation/(the sample code in the SDK) to work my way through updating the plugin.
Now to my problem: Every time I call the openDevice function I am getting the error in the title. [corebluetooth] XPC connection invalid. I have looked this up and have gotten pretty confused by other answers on stack overflow and some blogs I found discussing the error. From what I understand it is thrown when there are multiple instances of CBCentralManager, or when it is referenced as a local variable instead of a strong reference to the class. To be honest I think this is where my lack of experience with objective-c and mid/lower level languages in general is really hurting me because I don't really understand these answers and from what I thought the SDK files and functions were taking care of the interaction with core bluetooth so I'm not really sure what I am doing to cause problems with core bluetooth at all.
I have been stuck on this for over a week now and I really don't know what to try next.
Thank you in advance for any insight and I am willing to provide any more code or logs that might be helpful although all of the code for the plugin is in this Github repo.
In https://github.com/kevinjung2/CardReaderPlugin/tree/ios-branch there is not a single reference to "XPC connection invalid".
In foundation there is a XPC connection invalid error from Cocoa framework.
https://developer.apple.com/documentation/foundation/cocoaerror/2293178-xpcconnectioninvalid/
In the lack of more information I'm guessing that your driver are not updated to what the Cocoa framework are expecting for open a connection.
MAYBE, and this is just a guess... Apple changed something in their API that needs to be updated in the driver.
On the repository provided there is a https://github.com/eGood/CardReaderPlugin/blob/master/src/ios/libMTSCRA.a file that is not open for change and further investigation with easy. Pehaps the needed-to-update-function that provides metadata to open a connection to bluetooth are created there. And, in this case, there is nothing to do unless ask for the Magtek to update their driver.
EDIT: Have you tried what the manufacturer said in section 3.3.2... they have a test app. Try to connect with theirs... if it works, then you know is something wrong in your app, but if theirs didn't work either. Is most likely my hypothesis above.
Related
I've been struggling to find how I could potentially implement a simple (iOS) app that would be able to block all connections to a specific domain (to prevent the user from accessing a specific social media platform for example, even from another app).
The information that I have found so far is that I should probably create a Packet Tunnel Provider within a Network Extension and ask the user to add VPN configurations, but I haven't found any example code that would show exactly how to implement this.
Do you have any idea how I could do that in a simple way (block all connections to a specific domain)? Is there a framework/library that I could use to do it easily?
Thank you!
Well, it would not be easy, but you can do it.
Sample code from Apple could be found here and here. This project is for iOS, but it may be on deprecated Swift version, so you will need to do some work to launch it now.
The part you are interested in the SimpleTunnel sample is FilterDataProvider and FilterControlProvider, other things you can omit, because the purpose of this sample is to demonstrate a lot of abilities.
There is also a sample for macOS that is more focused on your needs, and macOS SDK is alike to iOS, but less powerful.
You may want to see this video to sort things up in mind.
There are a lot of firewalls solutions for ios and mac, and some of them are opensource
The part you are interested in the SimpleTunnel sample is FilterDataProvider and FilterControlProvider, other things you can omit, because the purpose of this sample is to demonstrate a lot of abilities.
You will need a developer account, a network extension capability assigned to an application identity, and proper network extension entitlement file a to run things up.
There is a way to sign it manually for development without account&capability, but to distribute you will need it anyway.
For some restrictions you may be needed to install MDM profile on the device.
Until recently, I used Google Assistant Library’s hotword Assistant to embed it into a raspberry Pi, mostly due to it’s hotword capabilities. I've done quite a few tweaks to make it work in a bigger project and add some functionalities to it.
Since now deprecated, I checked through the Service part of the actions SDK to make something similar, but ended up not finding what I wanted : the hotword part. I tried with the pushtotalk.py code but it seems way more complicated than the hotword.py, and of course does not have hotword capabilities on its own.
I tried snowboy, but for other reasons not related this is not a possibility.
Also, I tried to contact the support concerning the deprecation (how long will they support it/is there an alternative), but they sent me here.
So here is my question : is there a way to trigger the pushtotalk.py with a hotword/programmatically with an event ? (Ideally I would like to trigger it via a WebSocket event)
Also, is there any information concerning the deprecation of the Google Assistant Library part that I did not find on the Internet ?
I need a way to have an iOS application that can accept a message on a device connected via USB, query a bunch of data about the device and return a response with this data.
I am brand new to iOS and swift development so I need something that is;
Simple
Uses CocoaPods (due to lack of ios support in Swift Package Manager)
NOT require distribution via the App Store (which I believe rules out using APN)
I have tried the following:
BlueSocket: https://github.com/IBM-Swift/BlueSocket
This can probably do the job but is very low level and require lots of work around handling buffer sizes, etc. So a REST solution might be a better
Kitura: https://www.kitura.io/
This seems ideal. However, it only appears to support Swift Package Manager which makes it a big PITA to implement currently (reminder; swift/ios newb here)
CoacoaHttpServer: https://github.com/robbiehanson/CocoaHTTPServer
This looks ok, however I can only find Objective-C examples. Would prefer to have something that includes solid Swift examples (also, the repo doesn't look like it's been updated since 2015)
Are there any other approaches I should consider that I haven't listed here?
You may want to check https://github.com/IBM-Swift/Kitura-HelloWorld-iOS.
I wrote a couple of blog posts about it https://developer.ibm.com/swift/2017/03/13/kitura-ios/, https://developer.ibm.com/swift/2017/12/08/kitura-ios-part2/.
Note that it is a demo repository, I do not know if IBM will support Kitura on iOS (it is supported on Linux).
I am currently using Crashlytics in my app and it's working well. However, we are thinking of using NewRelic on the backend to better be able to pinpoint issues in our platform. The NewRelic mobile library has a crash reporter built into it as well (that can be opted out of).
I am assuming you don't want to use two crash reporters considering one will trump the other, however, I haven't seen any information on this anywhere and would just like to confirm.
Additionally if you could explain why along with the answer that would be very helpful.
You can only have one signal handler installed. The last one that registers "wins".
All,
Apologies in advance - this question might be too open-ended for SO.
Anyway... A friend of mine (an engineer and entrepreneur) is in the process of building a high-tech piece of lab equipment. He's asked me about the feasibility of building an iPhone/iPad/iPod application that would allow users to control the device via Bluetooth, so I'm helping him gather some information. I'm hoping to get a few pointers on how to get started. Specifically:
Would this require a native app, or could this be accomplished with HTML5 (with or without something like PhoneGap?)
Can you point me to a good primer on bluetooth networking? Everything I've found assumed a VERY high level of pre-existing knowledge.
What are the basics on how something like this is accomplished? Is there a single, established protocol for how one device "controls" another, or is bluetooth more like SSL - just a pipe that allows you to convey any type of message?
I realize this question is incredibly broad and detailed - so I'm not really looking for specifics. But obvious Google searches don't turn up much, and I'm otherwise having a hard time finding a good starting point.
Thanks in advance.
You can communicate via bluetooth in two ways: One is using the Low Energy Bluetooth capabilities of iOS 5 and newer iPhone/ipads.
https://developer.apple.com/library/ios/#documentation/CoreBluetooth/Reference/CoreBluetooth_Framework/_index.html#//apple_ref/doc/uid/TP40011295
Unfortunately the documentation is sparse and will require some hacking away. If you choose this route I would consider starting here and learning as much as you can about how the protocols work before hacking into the framework:
http://developer.bluetooth.org/gatt/services/Pages/ServicesHome.aspx
The limitations of this route are that it might not be best for sending a lot of data. I have only built stuff that sent simple commands which it does work great for.
The other option is the external accessory framework. This will require you to get an mfi license from apple (not fun). You will also need to pay royalties. But it will do what you want. You won't need to concern yourself much with underlying protocols if you use this, the framework provides a friendly api for processing streams.
http://developer.apple.com/library/ios/#documentation/ExternalAccessory/Reference/ExternalAccessoryFrameworkReference/_index.html