17 Replies Latest reply on Jan 30, 2015 9:11 AM by Vishal Bhatia

    iphone simulator8.1 start page goes to a /404

    Vishal Bhatia

      Hi

       

      I created a fresh app with rhomobile using the command line(rhodes app myapp) and changed the start_path in rhoconfig.txt to point to an external url. When I try to run that for iPhone simulator using rake run:iPhone, the app loads and I get something like

       

      404 Not Found

      "The file /system/http://..... was not found"

      where http://...... is the url I am using.

       

      Tried running that in rhosimulator and it doesn't even work there. Doesn't give me any errors but just gets stuck in Loading mode and remains stuck there.

       

      If i change the start_path to default(/app), it works fine in both rhosimulator and iPhone simulator.

       

      I am using Xcode 6.1.1

       

      Any help appreciated.

       

      Thanks

      Vishal

        • Re: iphone simulator8.1 start page goes to a /404
          Jon Tara

          Why would you set the start page to an external URL? I doubt that's expected. It looks for a file in the applications's filesystem.

            • Re: iphone simulator8.1 start page goes to a /404
              Vishal Bhatia

              I just want to serve my own content inside the rhomobile shell and the docs say that any url can be specified for the start_path. I tried several urls on my windows machine on android emulator and it works, I am just having issues with getting that to work on mac for iPhone

                • Re: iphone simulator8.1 start page goes to a /404
                  Pietro Francesco Maggi

                  Just curious Vishal,

                  if you try to navigate to the same URL from the mobileSafari inside the emulator you can reach the page?

                   

                  is it an HTTPS URL? if yes what about the security certificates?

                    • Re: iphone simulator8.1 start page goes to a /404
                      Vishal Bhatia

                      Hi Pietro

                       

                      The problem is that once I get the 404 page, it won't even let me go to other apps or safari at that point. The only option I have after that is to close the emulator, so I can't really verify what you mentioned above. Also, it is not a secure url(no https), so that shouldn't be a problem.

                        • Re: iphone simulator8.1 start page goes to a /404
                          Vishal Bhatia

                          Here is the snapshot of the screen I get

                           

                          Screen%20Shot%202015-01-29%20at%2012.43.28%20PM.png

                            • Re: iphone simulator8.1 start page goes to a /404
                              Vishal Bhatia

                              There are some issues with this editor, I wanted to paste as text what I have attached as a picture, but it won't let me do it, but nonetheless, there is some more info in the screenshot. Please advice

                              Screen Shot 2015-01-29 at 1.22.22 PM.png

                                • Re: iphone simulator8.1 start page goes to a /404
                                  Pietro Francesco Maggi

                                  Hi Vishal,

                                  usually you can have a better support to cut&paste code or logs using the advanced editor (link in the upper right corner of the editing area).

                                  Another option is to attach the log files to the post.

                                   

                                  Second point, would be interesting to see your rhoconfig.txt file, because from the 404 error you get it seems that your app is trying to load more or less the file "/system'http://.....'".

                                  Probably not what you wanted.

                                  If I've to bet a couple of Euros, I'll probably look into the character you used as string delimiter for the URL you passed to the start path.

                                   

                                  ~Pietro

                                    • Re: Re: iphone simulator8.1 start page goes to a /404
                                      Vishal Bhatia

                                      Hi Pietro

                                      Thanks for quick replied=s. I really appreciate that.

                                      Please find attached rhoconfig.txt file. As you would notice, the only thing I have changed in there is the start_path. I was also able to go to the home(through Hardware->Home) and then opened Safari inside simulator(as you suggested) and was able to go to my site with no problems.

                                        • Re: Re: Re: iphone simulator8.1 start page goes to a /404
                                          Pietro Francesco Maggi

                                          Hi Vishal,

                                          as I wrote before, I think the problem is character you used a string delimeter for the start_path. Seems like an unicode char instead of the hex: 0x27 ascii code you've for example in the option_path settings.

                                           

                                          Try using the attached rhoconfig.txt, it's using the correct delimiter.

                                          Let us know if it works.

                                           

                                          Best regards

                                          ~Pietro

                                          • Re: iphone simulator8.1 start page goes to a /404
                                            Jon Tara

                                            Is that a real URL in your rhoconfig.txt, or did you dummy it up for us? If you are dummying-up a URL for illustrative purposes, BTW, it is conventional to use example.com, which has been set-up for that specific purpose.

                                             

                                            If this is a real URL, and that is your domain, then you have set-up a DNS record on the public Internet that directs to a non-routable, private address. (10. prefix).

                                             

                                            Is your desktop computer (if running on a simulator) or device (if on a real device) on the same local network as that site?

                                             

                                            You really should not set public DNS target to a non-routable address. It makes no sense, though, it will "work" so long as you access it from a computer/device that actually can route to that address on your local network.

                                             

                                            Try as below from a console window on your Mac.

                                             

                                            ☺ ➜  ~ ping p-11.civicplus.com

                                            PING p-11.civicplus.com (10.1.18.102): 56 data bytes

                                            Request timeout for icmp_seq 0

                                            Request timeout for icmp_seq 1

                                            Request timeout for icmp_seq 2

                                            ^C

                                            --- p-11.civicplus.com ping statistics ---

                                            4 packets transmitted, 0 packets received, 100.0% packet loss

                                            ☹ ➜  ~ traceroute p-11.civicplus.com

                                            traceroute to p-11.civicplus.com (10.1.18.102), 64 hops max, 52 byte packets

                                            1  10.0.1.1 (10.0.1.1)  0.522 ms  0.283 ms  0.210 ms

                                            2  * * *

                                            3  * * *

                                            4  * * *

                                            5  * * *

                                            6  * * *

                                            7  * * *

                                            8  * *^C

                                             

                                            Frankly, if you are just using Rhodes as a convenient wrapper for a website, you might be better-served by a more basic tool such as PhoneGap/Cordova. Even that might be overkill, there are simple native wrappers that do nothing more than just plop a WebView on the screen.

                                             

                                            If this is meant to be placed in the Apple App Store, Apple will summarily reject any such app, with a comment similar to  "we do not approve apps that are just a wrapper for a website.". If you do provide some native functionality, then you will not get that rejection, but a different one: "you must provide an offline experience".

                                             

                                            That is, if the user must be online in order for the app to function, that is a non-starter for Apple App Store. They won't accept apps like that.

                                             

                                            If it is an internal app that you are deploying through the Enterprise Program, Apple does not pass any judgement on your app and, in fact, never even sees or reviews it, and then you are free to do this.

                                            • Re: iphone simulator8.1 start page goes to a /404
                                              Jon Tara

                                              Did you use RhoSimulator, or the Apple simulator?

                                               

                                              This might be a limitation of RhoSimulator. I think it may not be expecting the start URL to be outside of the app's filesystem, and doesn't parse the http prefix.


                                              It's not a common scenario, and so I would not be surprised if that is the case.


                                              Even if you use RhoElements, where pages are often read off of a server, it's not usual for the start page to be outside of the app itself.