Problem
I'm developing a full stack application and when I try testing on my physical iPhone via Xcode, the iOS app doesn't seem to be connecting to either my development server of my client server.
I'm using React Native for the iOS app and Node as my server
Does anyone know why this might be occurring and how to solve the problem?
Error from React Native Console Log
login error Error: Network Error
at createError (createError.js:16)
at XMLHttpRequest.handleError (xhr.js:87)
at XMLHttpRequest.dispatchEvent (event-target.js:172)
at XMLHttpRequest.setReadyState (XMLHttpRequest.js:580)
at XMLHttpRequest.__didCompleteResponse (XMLHttpRequest.js:394)
at XMLHttpRequest.js:507
at RCTDeviceEventEmitter.emit (EventEmitter.js:190)
at MessageQueue.__callFunction (MessageQueue.js:366)
at MessageQueue.js:106
at MessageQueue.__guard (MessageQueue.js:314)
I figured it out!
Answer
You need to change your server url from 'http://localhost:port' to 'http://computerIPAddress/port'. If you're using .env I suggest changing it where you're actually making the server call because changing the development .env doesn't seem to take effect.
This may not be the best solution, ideally there would be another .env file for this so you don't need to change any code anytime you want to test on a physical phone but at least it works!
If anyone has a cleaner solution I'd love to hear it!
Related
I am using #ionic/storage as it looked quite promising after reading about it in the V2 Docs.
I use Chrome on my Windows 10 laptop so things appeared to be working perfectly fine at first. However, when I tested it on iPad, or even Firefox on my laptop, I was surprised to find out it did not work.
I was able to resolve the issue on Firefox by removing the sqlite plugin (I thought I will add it when I am ready for native testing):
cordova plugin remove cordova-sqlite-storage --save
Sadly, storage still doesn't work on the iPad. I tested it on Safari and Chrome. I am unable to debug this given the lack of developer tools or console.
I am quite frustrated how Apple makes you dependent on using a Mac to develop on their devices.
How do I go about fixing and debugging this?
I first import storage in Ionic 2:
import { Storage } from '#ionic/storage';
Then to save the data, I do this:
this.storage.set(pk, JSON.stringify(reportObj));
Where pk is just a unique key, and reportObj is an object that I stringify before storing. Again, keep in mind this just doesn't work in iOS.
Thanks.
Update:
So I managed to run the app in Safari and found out that .set actually works and the data gets stored in WebSQL. However, the get does not seem to work and I wasn't able to get any useful errors in the console.
OK, so after a lot of trial and error, I found out that the problem is not really with Storage. There appears to be some other issue with my UI, where it doesn't seem to work on iOS.
I decided to answer the part about testing the app on iOS while in development if you are not a Mac user. The best way for this appears to be to use Ionic View. You can use this simply by typing:
ionic upload
Make sure you create your account. In your iPad or iPhone, you can then download Ionic View app from iTune, sign in, and the app will appear there.
As you upload your code, simply upload again and almost instantly the app would upload on the device as you click Sync.
Hope other Windows users benefit from this.
I am new to this site, so bear with me. I just wanted to ask a quick question regarding the iOS Developer Enterprise Program. I am enrolled, and I have made a few apps that are ready for in-house distribution. I have uploaded the .plist and .ipa file to my website in a separate directory. However, whenever anybody tries to download it, they just get the error message "Could not connect to website.com". Then, when I open up Xcode and launch the console when my iPhone is connected and I try to download it, Xcode displays this: "Could not load download manifest with underlying error: (null)". The null part really throws me off. Everyone has iOS 7.1 (or mostly everyone), and the website does have an SSL certificate, so I can't figure out why it is showing that error. Any help with this would be great.
Thanks!
Was ready to give up and change SSL provider, but managed to get the reason for me. Hope this will help for someone:
Problem occurred because my server was responding 403 Forbidden for manifest download request by Safari (because this request does not send cookies required for being authorised).
You need to make sure that the website that hosts the .plist and the .ipa files uses https. This is a requirement in iOS 7.1 and above.
I'm new to iPhone.I'm developing an application which contains video calling facility, For reference I have downloaded sample from
https://github.com/opentok/OpenTok-iOS-Basic-Tutorial
I have added OpenTok framework. I'm running it im simulator but the application crashes with error
Program received signal:SIGABRT.
It is not being able to establish connection
can any one suggest me how can i do this using other framework?
Thanks
Without any logs, I can only guess what the problem might be. It would be more helpful if you posted some logs.
Like 0x7ff... said, OpenTok needs a device to work properly because it needs the camera to be able to publish
invalid credentials should not be causing crashes, but you should still make sure your sessionId and token are valid. Keep in mind that tokens expire after 24 hours unless specified otherwise
Make sure you are deploying to a device that is supported
If you are cloning from the basic tutorial, simply downloading the zip file will not work because the sdk is not downloaded with it. You would have to download the OpenTok SDK and place it in the appropriate folder.
Alternatively, you can run `git clone --recursive https://github.com/opentok/OpenTok-iOS-Basic-Tutorial' in your terminal.
These are all the reasons I can think of
I'm developing an android application using Flex Builder 4.6.
It's fairly complicated app and I'm using HTTPService for communication with the server.
It was working fine until recently it stops working after making the apk file.
So From desktop simulator, in debug-mode in the mobile, the HTTTPService just works fine but when I make a release build and install it in the mobile, it just doesn't work.
I tried to track down the error, it's just simply shows 'HTTP request error'.
For example here is the mxml code I'm using
<s:HTTPService id="sayHi" method="GET" result="sayHi_resultHandler(event)" fault="sayHi_faultHandler(event)"
url="https://zaawi.co.uk/developer/controller.php" useProxy="false">
<s:request xmlns="">
<h>sayHi</h>
</s:request>
</s:HTTPService>
I checked the url https://zaawi.co.uk/developer/controller.php?h=sayHi in the browser which works fine, as well as, in the simulator and debugging mode.
The server(php) sending response in xml format
print '<?xml version="1.0" encoding="UTF-8"?><data><hi>hello world</hi></data>';
It was working fine for almost a year and just stopped working recently.
Please let me know if anybody else had this problem and how can I resolve this.
Many thanks in advance
I had a similar problem a while ago, my HTTPService requests started to fail and i didn't got anything useful in the FaultEvent, but after hours of trying different things i noticed that i had the network monitor enabled in flex, and since i had nothing to loose, i disabled it a voila! The app worked again!
I think when you have the network monitor enabled, the app redirects all requests thru a local proxy or something and that way you can sniff the requests, but this seems to stay when you create a release version and mess all requests.
So if you have network monitor enabled, just disable it, and then try to build your app again.
It appears that it is related to how the captive runtime calls https endpoints. Someone over on this thread Adobe AIR mobile app fails when using HTTPS on Nexus tablet, but works on Kindle figured out that by switching from the captive runtime to using the shared AIR runtime, the error went away. You may also want to try the latest AIR SDK and see if that solves the problem (although I've been seeing issues with the apps working on iOS using the 3.8 beta build, so you may want to try 3.7 first).
Have anyone known of an open source project to implement SSH client on iPHone ?
I actually need a terminal emulation to run a console application I have, I dont even need to get out of my sandbox. But Havent find any terminal emulation that doesnt infringe apple rules. (-MobileTerminal- just works on jailbroken, and does run my console app) and AFAIK its not possible to implement an Appstore valid version of it because of its forkpty() implementation.
still I see lots of SSH clients (terminal like) on the AppStore that send a recieve data. So there has to be a way to emulate a terminal/console thing on iPhone... thats what I need, but I see no one giving out some source code.
A quick google of mine shows this as a possible option:
http://code.google.com/p/mobileterminal/
It's in the Cydia store as well, and should give you general direction. If you want to look at the final implementation, I recommend Panic Software's Prompt - http://www.panic.com/prompt/support.html