Unable to access server on physical iOS device - ios

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!

Related

fcm onMessage works on simulator but does not work in physical device

I am a web developer trying to build a simple hybrid webview app with push notification. So I used flutter and firebase-cloud-messaging. The android side works fine in both emulator and on a physical android phone.
But for ios I have a problem. The onMessage callback works in the simulator and generates a AlertDialog. But when I test it on a physical iphone, it doesnt work. Nothing pops up. The other callbacks do work(onLaunch, onResume). Another weird part, is that as soon as the test app is installed on the physical device, the terminal loses connection to the device. So I cannot even see the error logs.
For me, It depends on version of
implementation 'com.google.firebase:firebase-messaging:20.1.0'
on build.gradle

Testing React Native via iPhone IOS

This may be a bit of a silly question but i haven't found a solid answer.
I have created a React Native app which includes making http requests to an external server (https://example.com).
When i plug my iPhone in, connect to wifi and deploy to device it works great. (All certificate signing etc is fine).
Should this app still work on my phone once I have disconnected it from my macbook and/or disconnected it from the same wifi.
It worked initially but then eventually kept crashing on load.
As soon as i plugged it back in and tested it works. Is there a way to keep this app on my device permanently?
No, it won't work. While you're testing it, the application on your phone is loading your React Native JS code bundle from a server running on your computer, normally on http://localhost:8081.
Once the phone loses access to that server, the app on the phone will lose access to that JS bundle and it will crash.
You have to install the app on your phone by creating an IPA (which requires an Apple Developer account), so that the app can be used anytime.

Bluetooth Transmitting Legacy Name

I am working on an mbed powered Bluetooth Low Energy project. I have been developing various GATT services, however, I have now found my project has got "stuck" on a previous service. What ever program I download onto the device, a Service is broadcast with the name "HRM_SEC". I have repeatedly changed the name from this.
I have installed known working examples of default Heart Rate Monitor Example. I have installed blank programs without bluetooth service definition etc.
However, the name of this prior service is persisting.
I have reinstalled my ios app - LightBlue - incase it was a casheing thing. By reinstalled I mean deleted and then downloaded from app store.
I can't connect to these services. New programs are being installed, as I am getting the expected serial feedback.
Why is this happening and What can I do?
I have just tried using the LightBlue app on a different iPhone and I am getting the expected behaviour. How can I purge the stored data from the LightBlue app. I have tried deleting it, then doing a reset (holing lock and home button), then when it has rebooted I re-downloaded the app from the app store. What else can I do to clear which ever info is being stored by LightBlue?
This seems to be an underlying iOS issue, as my other apps are also now using this legacy name. I have tried disabling and then enabling Bluetooth, but this hasn't worked. Any other ideas?
I have submitted an iOS bug report. This is really annoying, as I cannot use my iPhone to test an app I am working on. Any ideas for workarounds?

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.

How do I get my iphone to connect to local Xampp server on my mac while testing an xcode app

I am doing a Ray Wenderlich tutorial how to make an app like "Instagram". It's my first time setting up a database. I am using Xampp and hosting on my mac.
I CAN get the app to run with the xcode simulator and I can log in and it works with the server. However when I run my iphone device it runs the app but when I go to login through the app it says "Could not connect to server".
What am I missing? I think all my permissions are set to anybody etc... But again I'm totally new to using a database. It seems though that if the simulator can do it the phone should be able to. Also it's not a provisioning problem, that profile is valid and it wouldn't run on my app if it wasn't. I just cant get to the database from the device.
Any help would be awesome!
If the app isn't able to connect to the server, there might be an issue with the server address.
When running on the simulator, you're still on your mac, so something like http://localhost/DATABASE_ALIAS is enough. But when running on a different device, that is no longer true.
To keep things simple, you should make sure the iPhone is connected to same network as your Mac and then replace localhost with either the Mac local IP or its Bonjour address, for instance: http://YOUR_MAC_NAME.local/DATABASE_ALIAS.
To find out the Bonjour address, open System Settings and find the machine name under Sharing. As an example, if it is called "Herbie MacBook", the address would be "Herbie-MacBook.local".

Resources