Home › Forums › Ask the Flomies › SDK issue
Tagged: FloBLE EMV, FloJack MSR, Flomio SDK
-
AuthorPosts
-
November 23, 2016 at 1:50 am #57447
We are following instructions in read file (attached sdk folder)
1. Unzip FlomioSDK.zip.
Comments: Ok
2. Create new or open your iOS project in Xcode and select the root project file from the navigator.Comments: NOT FOUND (BUT UISING IOS COMPLETE FOLDER)
3. Drag+drop the unzipped FlomioSDK folder on project in Xcode navigator. Click “Create groups” and “Finish” in dialog.
Comments: Ok4. In Targets -> YourAppTarget -> Build Settings -> Linking -> Other Linker Flags add ‘-lc++’ and ’-ObjC’
In Targets -> YourAppTarget -> Build Options -> Enable Bitcode set to ‘No’
(optional) In Target-> Build Settings-> Apple LLVM 7.0-Preprocessing -> Preprocessor Macros add ‘DEBUGLOG’
In Targets -> YourAppTarget -> General -> Link Binary with Libraries, add MediaPlayer.Framework
Comments: Ok
5. Include the FlomioSDK header files in your view controller and implement the delegate protocols.
Comments: We dont have any class with this namePlease check and suggest the steps required to complete the operation.
November 23, 2016 at 2:47 am #57450Hi Gaurav, not sure I understand the issues that you’re pointing out. Here’s a video tutorial that may help you overcome your challenges:
It would also help if you could record a video of the blocking issues you’re encountering.
best,
RichardNovember 23, 2016 at 8:59 am #57451Richard, I have checked the Video, In video there are references to FMSessionManagerDelegate
I am using the sdk shared by you, or please suggest which sdk I have to used for same.
Thanks
November 28, 2016 at 12:38 am #57484Hi,
Please let me know if there is any updates regarding it.Thanks
November 28, 2016 at 2:23 am #57485Hi Gaurav, I’m not sure what your issue is. You need to implement the
FmSessionManagerDelegate
methods in order to get callbacks from the Flomio SDK into your application. What exactly are you having trouble with?November 28, 2016 at 2:38 am #57486Richard, The problem is we dont have any references for FmSessionManagerDelegate in the provided sdk hence cannot implement this otherwise it is throwing errors, Please suggest how can I get the latest sdk.
November 28, 2016 at 2:59 am #57487Looking at the README.md file included in the latest SDK, step 8 lists the delegate methods you need to implement to follow the
FmSessionManagerDelegate
interface. In particular, you will be interested in implementing the following method:- (void)didFindATagUuid:(NSString *)UUID fromDevice:(NSString *)deviceId withATR:(NSString *)detectedATR withError:(NSError *)error{ dispatch_async(dispatch_get_main_queue(), ^{ //Use the main queue if the UI must be updated with the tag UUID or the deviceId NSLog(@"Found tag UUID: %@ from device:%@",UUID,deviceId); }); }
What error are you getting? Can you cut/paste here? What experience do you have building iOS apps in the past? This will give me some perspective to better help you along.
best,
RichardNovember 28, 2016 at 7:59 am #57497Ok I have successfully integrated the sdk,
Please answer the following queries
- (void)didFindATagUuid:(NSString )UUID fromDevice:(NSString )deviceId withATR:(NSString )detectedATR withError:(NSError )error{ dispatch_async(dispatch_get_main_queue(), ^{ //Use the main queue if the UI must be updated with the tag UUID or the deviceId NSLog(@"Found tag UUID: %@ from device:%@",UUID,deviceId); }); }
This delegate method is not called if card present, I got no information in log.
Also I have tried following method when is present and trying to read the card getting following message
self.readerManager.startReader(device) start scanning is not supported for FloBLE EMV
Please suggest on same.
November 28, 2016 at 11:54 pm #57501Any update on this!
November 29, 2016 at 12:28 am #57504I have followed steps give in readme file, kindly check the source code and let me know the issue in same. For your information delegate method is not called in the attached sample code.
https://www.dropbox.com/s/wlkhem2t5uope5h/FlomioExample.zip?dl=1
November 29, 2016 at 1:32 pm #57512Hi Gaurav,
Please retry with this updated version of the SDK. Flomio SDK v2.2 beta
We have added an updated driver for the EMV and it should now work fine.Kind Regards,
ScottNovember 30, 2016 at 1:51 am #57525Richard and Scott I have followed each step exactly same as give in README.md even tried by creating 2-3 projects, still not getting any response in delegate methods. however testflight build working fine, It would be great help if you can share an example code that is already build.
Sharing my latest code as well
November 30, 2016 at 7:35 am #57528Hey,
I have added a fix to the SDK linked above (and here).
In the project you sent me, your device type was set to FloBLE Plus, not FloBLE EMV. Even so, there was a small problem with an implementation in Swift however, it was only tested using Objective-C.
Other than that, your project was configured correctly. Hopefully it will start working for you now, thank you for your patience!
ViewController.swift for those arriving to this thread
import UIKit class ViewController: UIViewController, FmSessionManagerDelegate { let readerManager : FmSessionManager = FmSessionManager() override func viewDidLoad() { super.viewDidLoad() readerManager.selectedDeviceType = DeviceType.floBleEmv readerManager.delegate = self // Do any additional setup after loading the view, typically from a nib. let configurationDictionary : [String : Any] = ["Scan Sound" : 1, "Scan Period" : 1000, "Reader State" : ReaderStateType.readUuid.rawValue, //readData for NDEF "Power Operation" : PowerOperation.autoPollingControl.rawValue, //bluetoothConnectionControl low power usage "Allow Multiconnect" : false] readerManager.setConfiguration(configurationDictionary) readerManager.createReaders() NotificationCenter.default.addObserver( self, selector: #selector(inactive), name: NSNotification.Name.UIApplicationDidEnterBackground, object: nil) NotificationCenter.default.addObserver( self, selector: #selector(active), name: NSNotification.Name.UIApplicationDidBecomeActive, object: nil) } func inactive() { print("App Inactive") } func active() { print("App Activated") } func didFindTag(withUuid Uuid: String!, fromDevice deviceId: String!, withAtr Atr: String!, withError error: Error!) { DispatchQueue.main.async { if let thisUuid = Uuid, let thisDeviceId = deviceId { print("Did find UUID: \(thisUuid) from Device: \(thisDeviceId)") } else { print(error) } } } func didFindTag(withData payload: [AnyHashable : Any]!, fromDevice deviceId: String!, withAtr Atr: String!, withError error: Error!) { DispatchQueue.main.async { let thisDeviceId = deviceId if let thisPayload = payload["Raw Data"] { print("Did find payload: \(thisPayload) from Device: \(thisDeviceId)") } else if let ndef = payload["Ndef"] { print("Did find payload: \(ndef) from Device: \(thisDeviceId)") } } } func didUpdateConnectedDevices(_ devices: [Any]!) { //The list of connected devices was updated } func didChange(_ status: CardStatus, fromDevice device: String!) { print(status) DispatchQueue.main.async { //The card status has entered or left the scan range of the reader // Cardstatus: // 0:CardStatus.notPresent // 1:CardStatus.present // 2:CardStatus.readingData } } func didReceiveReaderError(_ error: Error!) { DispatchQueue.main.async { print("Error: \(error)") } } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }
December 6, 2016 at 9:26 pm #57626That tutorial is suitable for FloJack MSR?
I have followed the steps of that tutorial. However, nothing can be shown in the iOS application. Can you provide a very simple demo to show how to read the UID of contactless card.
December 6, 2016 at 9:47 pm #57628The light is also unable to show green.
December 6, 2016 at 10:18 pm #57630Yes, the video tutorial should work for the the FloJack MSR. As a sanity check please install the Flomio Test app that I have sent you via TestFlight. Make sure volume on your phone is maxed out. Make sure the FloJack is full charged (plug into USB power until red LED goes out). Make sure you have no other audio apps running while trying to connect to the FloJack. Sometimes it’s necessary to power cycle your phone to get the FloJack to connect the first time.
Search around the Forums for other relevant posts as the FloJack MSR is well covered.
best,
RichardDecember 7, 2016 at 2:15 am #57633May I have the source code of that testFlight project? By the way, an event, I turn “scan sound” is on, it still have no sound after the tag is detected.
- This reply was modified 8 years ago by David.
December 7, 2016 at 5:46 am #57635Sure, the source code to the TestFlight project is included in the Readme.md file included with the Flomio SDK.
best,
RichardDecember 8, 2016 at 8:51 am #57645Hi Richard,
Did the testFLight application handle sound response?
I had turned on the option “Scan Sound” and the light is green.
I had also ensured that no other audio apps were running and the volume on my phone was maxed out. I have tested the reader using ASC Mobile, it had no sound response. Are the problem causes by the device?December 8, 2016 at 12:18 pm #57647Hi Wing, the FloJack MSR doens’t have beep hardware so the “Scan Sound” option is to make a sound on your iOS device. Sometimes the Test app misbehaves though and the scan sound isn’t played. I would recommend killing the app and perhaps rebooting your handset to try and get that feature to work. Either way it’s not an indication that the hardware is faulty.
best,
RichardDecember 21, 2016 at 10:02 pm #57816Hi Richard,
Is there any method for detecting the reader is plugged in or plugged out?
Also, is there any solution that the mobile application can give a sound response via speaker when the reader(MSR) is plugged in?
Best,
DavidDecember 28, 2016 at 12:48 pm #57845Hi David,
iOS manages routing audio through the headphone jack when there is a headphone connected, which requires quite elaborate routing conflict resolution in the SDK to prevent problems with audio playing and the MSR. I will have to suggest not using a sound to trigger a connect, instead using a visual cue as it can cause issues with the reader.
I have not tested this on Swift so there is no code I can give you to do this but I will suggest a way to try this. To tell developers if a reader is responding, the Flomio SDK didUpdateConnectedDevices delegate returns an of FmDevice. The first element of this array will be your device. The FmDevice will have a property: CommunicationStatus. This will be either Scanning, Connected, or Disconnected. You should get this property, and check if it has changed from Disconnected to Scanning to trigger a notification. I understand that this is not a very clear API to do this, making a simpler API is one of our main priorities at the moment so this is likely to change in the future.
I hope this helps you begin to tackle this issue, please let me know if you have any issues going forward.
Kind Regards,
ScottFebruary 21, 2017 at 8:18 am #58584Dear Richard,
I am trying to build an iOS app using FlomioMsr and I want to show an UIAlertViewController contained an textField in
didFindTag(withUuid Uuid: String!, fromDevice deviceId: String!, withAtr Atr: String!, withError error: Error!)
I tried to get the value of that textField, but sometimes it would return an empty string. I have tried to successfully get value out of didFindTag. Would you please give me some suggestions to fix it?
- This reply was modified 7 years, 10 months ago by David.
February 22, 2017 at 1:31 pm #58762Hi David,
Is it the
Uuid: String!
that you are getting? I would say you are best to test the value using an if statement before presenting the alert, potentially you could prompt the user to retry the scan. You should also look at theerror: Error!
property to see if there is any indication of the issue.A few further questions to help me better understand your issue: what are you reader configuration settings? What tags are you using?
Kind Regards,
Scott -
AuthorPosts
You must be logged in to reply to this topic.