BlackBerry HttpConnection Cookies - blackberry

Another BlackBerry httpconnection problem.
I'm writing an app that gets a cookie and then uses it for auth purposes using REST via a HttpConnection.
This works perfectly via Eclipse and device emulators however it fails on the device itself.
The offending line of code is:
_connection.setRequestProperty("Cookie",loginDetails.getCookie().trim());
Now, from past experience, I'm guessing that there must be some bad characters in the cookie on the actual device and that the development PC (on which the emulators are running) is doing the filtering/character replacement for me.
Any pointers/suggestions anyone?

Related

Iphone build not connecting to Mobile First Server after Migration to 7.1 from 6.1

I migrated Worklight 6.1 project to Mobile First 7.1
In 6.1 all builds(Android, Iphone and Windows) working fine but in 7.1 Iphone build is not working.
I given connectOnStartup : true to check connection with server.
Whenever I am going to launch Iphone build its giving error "The sever was unable to process the request from the application. Please try again later".
But for Android build is working smoothly. Observed migrated Iphone build not getting internet access(Slider images on landing page are not loading even though their path given as url) but device has full high speed internet access.
Below things taken care:
There is no internet problem
Both iphone and server reside in same wifi network
Tried with making Customize URL in iphone
I given connectOnStartup : true to check connection with server.
This is a deprecated API and you should stop using it... Instead use the WL.Client.connect API if you really need to connect to the server on startup...
As for the connectivity issue, I suggest that you will check for the following:
You say you're making a "customized URL". I suggest that you will confirm you're actually using the correct URL for your server
Verify that in wlclient.plist you indeed have the correct server settings
If you are testing on iOS 9 or above, make sure your server is TL2 1.2-ready and your iOS application is configured for ATS: https://mobilefirstplatform.ibmcloud.com/blog/2015/09/09/mobilefirst-platform-support-for-ios-9/

Unable to access server on physical iOS device

I recently set up a provisioning account for my iOS device for my Xamarin project.
The app launches fine and shows to first screen well, but when I attempt to perform an action like Logging in which requires hitting a local database I have in the office, I get nothing on the console output on my server I am hitting (I'm never reaching the server from my app). My code works fine (hits the server and provides output) when running on the iOS simulator, the Android simulator and a physical android device.
I believe this is probably a simple setting, or something of the like (some type of permission for iOS devices?) but I'm not sure where exactly my problem lies.
I'm an idiot. My device was not connected to my office's WIFI so I was unable to hit the server. Leaving this posted incase anyone makes the same mistake as me in the future!

How to view xcode log file on Windows?

I'm a Microsoft developer who has written a Web API (using .NET) for a multi-platform mobile project (native versions to be written for iPhone, Android, and Windows).
The backend is in SQL Server, and the idea is that the mobile apps will make calls to the API to retrieve/update data. I have tested the API and believe it is fit for purpose.
The iOS developer (located in India) is adamant that the API is slow, unstable and causing errors. We're currently in a bit of a deadlock about the issue and not making much progress.
He hasn't asked for anything specific to be changed, only general complaints about slowness/instability, which he says is causing the iPhone app to crash.
However after some time, he's sent through what he says is an xcode log file which contains errors. Is there any easy way I can view this log file on a Windows computer?
Screen capture in Notepad++

Phonegap has recently stopped working?

I haven't used it in a while until now but I cannot get it to work anymore even with a new, generated and unchanged, project. It worked perfectly fine before. It's been updated and the mobile app has been updated.. I've tried the desktop and CLI version.
Details:
Using Windows 10. Desktop App or CLI Phonegap.
Using iPhone iOS 9.0.2 mobile Phonegap app.
Using the basic, generated Phonegap Hello World.
What happens:
1. I serve the application.
2. I open the mobile app and enter credentials.
3. It sits on "Downloading" indefinitely
Note: If I open the URL in a browser on the serving machine it WILL open. If I open it on any other machine it will not.. This confuses me because they're on the same WiFi network so that has nothing to do with it. I even tried turning off my firewall in case the port was being blocked or something. I've tried 3000 and 8080.
Has anyone else experienced this?
I've uninstalled, re-reinstalled, used different versions, etc...
EDIT: I've found a solution, kind of.. If I use the --localtunnel flag it will work. I'm not sure why given that they ARE on the same network. Of course this also means that every single time I serve it is a different address which is quite a hassle. But at least I can test now.

Linea Pro Barcode Scanner iPhone Issues

I downloaded the iOS SDK for the Linea Pro device from their website and have successfully implemented some of it in my App - but I noticed the device never seems to work while its connected to the Mac via the USB cable. I've verified this 100% because as soon as I disconnect the LineaPro sled from the USB cable and run their Apps, it finds the Scanner and works. Otherwise, nothing.
This of course makes debugging near impossible because if you're not connected to Xcode you obviously can't see any output the App may have in Xcode's Console. You can't NSLog anything to the console, you can't put Breakpoints, you can't step-through your code - you pretty much can't do any of the things you'd normally do when developing an App.
I've actually had to resort to creating UITextViews and outputting everything I can to them during runtime ( which of course clutters up the interface big time) but even with that, if the App crashes, you never get to see your TextViews: you're thrown out and back to the iOS home screen, staring at all your little icons.
I've got some other ideas regarding work-arounds - but that's just it: they're all work-arounds. Does anyone out there know if there's any way to use the Linea Pro while its still connected to Xcode?
I don't think this is possible. For some reason lightning devices and USB don't seem to work together well.
I would suggest a combination of https://github.com/fpillet/NSLogger for logging and https://github.com/Shopify/superdb for sending messages to your app. You won't get breakpoints but you will have a few more tools at your disposal.
If you are using a device running iOS11 and you are using XCode 9, you no longer need to connect via lightning cable to debug your runtime build. XCode 9 introduced wireless debugging via a network connection:
Wireless Device Pairing Apple Documentation
Facing the same problem. I've resorted to using UIAlertViews instead of UITextFields to log messages on screen, but still its a huge pain the the buttocks.
You can also fire up a local server and hit it via localhost:8001?logmessage=myLogMessageWhichCanBeVeryVeryLong
and just print these GET requests to the terminal. Not pretty at all but its a workaround that could be of use if you want to get real creative...
Usually if you have a bug or error in your code it's going to be YOUR code, not the actual scanner or scanner input. So what I do while the app is in testing mode, is to have a button or other UIcontrol wired up to run an action AS IF there was scanner input, and I'll provide a mock string of input in a string (different inputs by incrementing a counter if needed). That way I can test away in the debugger for as long as necessary. Once my code works for me & I'm satisfied, I paste the same code into the scanner function and make the switch to the actual scanner. A little pain but not a big deal.

Resources