Barcode Scanner for Rails App - ruby-on-rails

So I'm building a Rails App for a client where they'll be receiving inbound shipments from customers. In order to streamline the process, the client would like to have a barcode system where they can just scan the incoming shipments that will automatically update statuses on a specific order within my app.
Here is my question. What I'd like to see happen is for the user to scan a barcode (using whatever hardware available) and that in turn populates an input field in my rails app. Ultimately, this would be a form and when submitted it will auto update a specific order.
Is there specific hardware that I'd need to get? Any kind of ruby gems that would be good for this?

Your usual bar code scanner acts as a keyboard. It reads the code and sends it to the computer followed by an enter. Maybe you want mobile devices to do the scanning, which might be a bit more involved.

Related

MAP bluetooth profile to transfer data

​
I'm looking into MAP profile (on iOS) because is under standard profiles and you don't need MFi to use it.​
My question: is it possible to use MAP profile to transfer data (in messages)? or are you restricted to just messages, calls and emails? In other words - when I send data to phone over MAP profile is data accepted by any application or specifically my messages application (or phone application, or email application).
I hope I was clear :) thx​
My own replay for purposes of "closing" the question.
I couldn't find the way of sending data over MAP - at least on iOS and event if I would manage to send it I'm almost certain that only specific application would be able to accept the data. So for example mail would be accepted by Mail application.

IOS Simple Messaging client, presence and typing

I'm considering adding a messaging feature to an iphone app. The idea being that given a user-based IOS app, a user may have a list of other users. He may then want to send one a message. A straight network call could accomplish this, but it misses a couple pieces:
1) The ability for a logged in user to "listen" for incoming messages without necessarily polling the server every few seconds. Does IOS support an open socket connection for listening somehow?
2) The ability for the server to detect presence of users (when they are logged in, active and listening; and immediately if they connect/disconnect)
3) the ability to detect typing, if possible
I've heard this can be achieved in javascript apps with socket.io libs, and wondering what equivalent tools exist in IOS natively? Or should a webview with JS be attempted?
EDIT:
Push notifications will likely be leveraged for offline use, but am not sure they can be a substitute for all the real time interaction.
EDIT2:
Found this SocketIO tool for IOS, but have no experience with this. It is a possibility though.
https://github.com/pkyeck/socket.IO-objc
For number one you should look at this tutorial:
http://www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1
It uses pushnotifications to detect incoming messages.
the other two parts are probably timing, just say a user is active for 2 min since their last activity. And every time they use something in the app or poll the server you update the time and make them active for another two minutes or so.
And you can detect typing if something is typed into the textfield. UITextField has a onChanged method. You could also start a timer to detect changes between a certain amount of time. So it doesn't say typing if someone just left their textfield filled but didn't send the message.
Hope this helps.

CFUUIDCreate, iOS version usage statistics and User Permission

I'm considering using the CFUUIDCreate API to build a database in my server to measure what percentage of users of each of my apps are running which version of iOS (to help me make a decision on iOS minimum supported version for future development).
My question is: Should I ask the user for permission to send the (anonymous) UUID / iOS version data pair to my server, or is it OK to do it automatically?
I ask because I could bet on the safe side and ask anyway, but most users would feel intimidated by the technical details and most likely decline. Also, the longer the text in an UIAlertView, the more likely the user won't read it.
Will Apple reject my app if I don't ask? Even if they don't, do you think I should always ask the user for permission to send this anonymous data?
What's everyone's experience implementing this kind of functionality?
OK, this is what I'm going to do, based on Nikolai Ruhe's answer but improving on a pitfall I just discovered.
Suppose user John Doe installed my app on his iPhone running iOS 5.0.
On the first launch, the app sends an anonymous request to my server that effectively increases by one the counter for 'Devices running iOS 5.0'. The app records this event and the iOS version (in User Defaults or Keychain) and does not send any further requests as long as the locally stored OS version string and the current one (returned by the system) are equal.
The next week, John upgrades to iOS 5.1 and launches my app. The app detects the OS version discrepancy and sends a new request to my server.
But if this only adds one device to the 'iOS 5.1' population, John's iPhone is now being counted twice: once as "Devices running 5.0" and once as "Devices running 5.1".
So to fix this, my HTTP request should look like this:
http://myserver.com/my_stats_scripts/index.php?app_id=com.myCompany.myApp&new_os_ver=5.1&old_os_ver=5.0
So my database can increase the number of 5.1 devices and decrease the number of 5.0 devices by one.
Of course, on the first request, the HTTP parameter old_os_ver is set to empty, and the server treats it like a new device.
If I pull this right, I no longer need UUIDs. But I am still sending system info covertly to my server. I think I'll also disclose this on the Terms of Use.
You should definitely ask for permission. The crucial bit here is that your data collecting might be anonymous, yet it can be used it to track individual users.
Web browsers send a user-agent string with every request. The difference is that they do not send a universally trackable id that would never change.
So the problematic piece in your proposal is the UUID. Why not just leaving it out? Your app would send an anonymous request once and locally store the transmitted iOS version. When the user upgrades the OS, you send another request with the new iOS version and an update count.
Using this scheme you would not transmit trackable data and still get a proper usage-by-os statistic.

How to implement an iOS app personalized start page?

I'm developing my first iOS app and I'm facing a challenge.
I'd like to present new users a personalized screen when the app starts at the first time. Let me explain more.
The flow should be more or less like this:
My app isn't installed on the user's device.
Then the user gets an SMS on his iPhone with a short message and a link to install my app. The message is part of a conversation. Another user of this app had sent this message (through my backend) in order to join this user to the conversation.
This install URL doesn't necesarrily link directly to the itunes store, it can link to a conversations specific link such as myapp.com/conv/12345
The page at myapp.com/conv/* will detect the device and if it's an iPhone would redirect the user to the appstore to install myapp.
The user then installs myapp and launches it.
Now I'd like to present the same conversation 12345 to the user, before he even needs to login, register or what have you. That's the difficult part... I don't want the user to start an a blank page, I'd like to take it right to the conversation 12345 page.
I assume steps 1-5 are easy, but I can't think of a way to implement 6. I admit that I'm not familiar enough with the intrinsic of the appstore but as far as my understanding goes, "all apps are made equal", I mean the app itself when it gets installed it has no context, it doesn't know what "caused" it to be installed, it isn't aware of the click on myapp.com/conv/12345. Is this correct?
If there was a way for an app to know something like a referrer URL for the instllation or something along these lines that would be awesome.
If there was a way for app to query the device for its phone number
then I could make this work (b/c the SMS was sent to a specific phone
number, so I can track the most recent conversation sent to this
number on my backend). But since apps are sandboxed, accessing the phone
number is off limit.
Well, I suppose I could ask the user to type a unique code from the SMS when the
app starts, say 12345 and then I'd be able to display the
conversation to him. But that's problematic in two ways, first,
security - the user can join a conversation not meant
for him, and second, that's less than optimal
user experience, I want this to work like magic, I don't want to make
users memorize and type strings into my app the first time they
install, I'm sure they won't appreciate it... (they could
copy-paste, but still...)
Another option is asking the user to type his phone number. But that
again has a few drawbacks, one is that again it's less than optimal
UX, I'm asking a user to type his phone number to an app he doesn't
yet know or trust, second I'll need to verify (authenticate) the
phone number, I mean what prevents that user from typing a phone
number that doesn't belong to him?
If I had access to the SMSs then I could dig up that code, but I find
it hard to believe that apps get access to SMSs, it's just sounds
like another reasonable sandbox restriction. Of course I'm not
speaking of jailbroken devices.
BTW, if the user just went over to the appstore to install my app (and didn't go through a conversation SMS) that's fine, in this case I'll just present a normal register/login page. The interesting case is where the user was already part of the conversation when receiving the SMS and now I want him to (effortlessly) become part of the same conversation through my app.
To sum up - is there a trick to present "personalized" pages the first time an app is installed and launched that would get that user right into the context of the conversation sent to him over SMS without having to request additional input?
Thanks!
It's impossible to do. Your application is installed without the knowledge you need whatsoever. As you pointed out, it's a reasonable sandboxing restriction.
What you could do is a challenge-response based system, but it would be about as intrusive to the user as is registering/login in.
Ran, you can keep a flag in NSUserDefaults (equivalent to Android's SharedPreferences)
http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/Reference/Reference.html

NotesUIDocument and NotesDocument Send - one works, one doesn't but, never both

I am working with a calendar and scheduling application. The requirements are to work in Notes and on Blackberry devices. Currently when I do a send using a NotesDocument, it works fine for the first meeting send on all. However, if you update the meeting, it only sends a correct message to the Notes client. The Blackberry will receive a rich text only e-mail. All MIMEs are correct in sending as well.
Changing this to send using NotesUIDocument will work fine for all instances on the Blackberry but, in Notes gives the error:
Part or all of this meeting is already on your calendar. You must decline those entries first before processing this notice.
I'm kind of at a loss here because what works in one won't work in the other. I am using Notes 8.5.1 and BES 5.0.2. Any help is really appreciated.
Have you considered using a MailOptions field (computed to itself and set via code) to control a send on UI save? That's how mailing works reliably with web apps -- it seems to invoke some voodoo to which I am not privy to add all of the jots and tittles to the right messages to the right parts of the system.

Resources