Browser Widget in IOS not working

Getting into LiveCode for iOS? Ask your questions here.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Browser Widget in IOS not working

Postby Batninja » Thu Nov 10, 2016 2:58 pm

Hi

Hope someone can assist me.

I cannot get the browser widget to work in the iPhone simulator, it just shows as a blank white screen.
The stack works fine on my mac displaying the web page and other stacks run fine in the iPhone simulator and the simulator will display a page using the mobile safari browser so I'm not clear what I'm doing wrong.

I used a test stack, added the browser widget, set the url to a working http:// address in the properties and specified the browser widget be included in the application settings.

Any thoughts ideas gratefully accepted. What I'm trying to do is add a local help page for a mobile app I'm working on.

Roger
Batninja
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 23
Joined: Sat Oct 15, 2011 9:43 am

Re: Browser Widget in IOS not working

Postby LiveCode_Panos » Thu Nov 10, 2016 3:10 pm

Hi Roger,

Here are some things to check:

1. In case you have selected to manually add any inclusions to the standalone, make sure you add the Browser Widget Inclusion (in "Inclusions" pane in the Standalone Application Settings)
2. If you are using a http URL, iOS will block it for security reasons. To cope with that:
- Use a https URL instead (recommended) OR
- Disable ATS (App Transport Security) in the Standalone Application Settings for iOS (not recommended)

Best regards,
Panos
--
LiveCode_Panos
 
Posts: 274
Joined: Fri Feb 06, 2015 4:03 pm

Re: Browser Widget in IOS not working

Postby Batninja » Thu Nov 10, 2016 6:33 pm

Thanks Panos

It was the ATS setting that was stopping the browser widget display the site.
Once I disabled it the widget sprung into action.

I expect disabling the ATS is not a good thing so I'll have to author the help pages with standard live code controls rather than just use a web page.

Thanks again.

Roger
Batninja
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 23
Joined: Sat Oct 15, 2011 9:43 am

Re: Browser Widget in IOS not working

Postby peter-b » Mon Nov 14, 2016 12:00 pm

I believe there's a way to enable ATS, but to add specific websites that normal HTTP should be used for to your application's plist. This will allow you to use a browser widget to display your help docs over HTTP, but still leave ATS enabled. This blog has some detailed information: https://ste.vn/2015/06/10/configuring-a ... osx-10-11/
LiveCode Open Source Team — @PeterTBBrett — peter.brett@livecode.com
peter-b
 
Posts: 182
Joined: Thu Nov 20, 2014 2:14 pm
Location: LiveCode Ltd.

Re: Browser Widget in IOS not working

Postby trevix » Fri Dec 16, 2016 5:29 pm

I tried to modify the info.plist (LC8,1,2RC3 on OS X) inside the bundle with this, as suggested:
Code: Select all
<key>NSAppTransportSecurity</key>
<dict>
  <key>NSExceptionDomains</key>
  <dict>
    <key>mywebsite.it</key>
    <dict>
      <!--Include to allow subdomains-->
      <key>NSIncludesSubdomains</key>
      <true/>
      <!--Include to allow HTTP requests-->
      <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
      <true/>
      <!--Include to specify minimum TLS version-->
      <key>NSTemporaryExceptionMinimumTLSVersion</key>
      <string>TLSv1.1</string>
    </dict>
  </dict>
</dict>

but it does not work.
Any suggestions?
Trevix
Trevix
trevix
 
Posts: 308
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy

Re: Browser Widget in IOS not working

Postby LiveCode_Panos » Fri Dec 16, 2016 10:08 pm

Hi Trevix,

Editing the info.plist *in the ios_standalone.app* bundle will not work. You have to either

1. edit the template plist in LiveCode Indy.app to include those changes and then create your ios standalone.

OR

2. create a info.plist file that has those changes and add it to the "Copy Files" section, and then create the ios standalone

================================
To do option (1):

1. Open a terminal
2. Type:
sudo nano path/to/LC Application Folder/Contents/Tools/Runtime/iOS/Device-10_1/Settings.plist

3. Add those key-value pairs

4. Press Ctrl + O, then Enter and then Ctrl + X to exit

5. Your changes should now be saved. You don't need to add anything in the Copy Files section
=================================
To do option (2):

1. Navigate to LC Application Folder / Contents / Tools / Runtime / iOS / Device-10_1
2. Copy the Settings.plist file, and paste it to your desktop
3. Open Desktop / Settings.plist with e.g. TextWrangler editor (The file should be read-only. Make sure you add write permissions first)
4. Add those key-value pairs into Settings.plist
5. Save
6. Rename Settings.plist to Info.plist
7. LC > Myapp > Standalone App Settings - add the desktop Info.plist file into the Copy Files
8. LC > Myapp > Build Standalone Application
9. *Remove existing Myapp from your iOS device
10. Install new Myapp to your iOS device

Best,
Panos
--

Note: The */Device-10_1/* in the paths I described should be used in case you test on a device, and use Xcode 8.1 to build the standalone.
If you want to test in the simulator, replace */Device-10_1/* with */Simulator-10_1/*
LiveCode_Panos
 
Posts: 274
Joined: Fri Feb 06, 2015 4:03 pm

Re: Browser Widget in IOS not working

Postby trevix » Mon Dec 19, 2016 12:10 pm

The first option seems to be the best (once for all).
But my ignorance on the use of the Terminal is evident:

- I replaced the path with:
sudo nano /Applications/LiveCode Indy 8.1.2 (rc 3).app/Contents/Tools/Runtime/iOS/Device-10_1

but the terminal considers "(" as an unexpected token. Should I rename the LC App?

- In order to verify the above, I tried with another path (just to see what's happening):
sudo nano /Applications/LiveCode 5.5.5.app/Contents/Tools/Runtime/iOS/Device-6_1/Settings.plist

The Terminal dose not show the content as expected, only "File: /Applications/Livecode" on the top of the window and "[ New File ]" in the bottom. Is this correct?

- I also don't understand why is it different to use the terminal or to copy the settings.plist to the desktop, open it with BBedit, modify it,save it and copy it back.

Thanks
Trevix
Trevix
trevix
 
Posts: 308
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy

Re: Browser Widget in IOS not working

Postby LiveCode_Panos » Mon Dec 19, 2016 1:05 pm

Hi Trevix,

You are having those problems in the Terminal because the path contains spaces. So when the first space is met, the Terminal thinks this is the end of the command, and interprets everything after the space as arguments to this command. You have to escape the spaces, so you should type something like:

Code: Select all
sudo nano /Applications/LiveCode\ Indy\ 8.1.2\ \(rc\ 3\).app/Contents/Tools/Runtime/iOS/Device-10_1/Settings.plist


- I also don't understand why is it different to use the terminal or to copy the settings.plist to the desktop, open it with BBedit, modify it,save it and copy it back.

I have not used BBEdit and I am not sure how flexible it is with changing permissions. But what you suggest will probably work. I just personally find it easier to do that via Terminal, since it is a one-step process.

Best,
Panos
--
LiveCode_Panos
 
Posts: 274
Joined: Fri Feb 06, 2015 4:03 pm

Re: Browser Widget in IOS not working

Postby dbeugeling » Wed Mar 15, 2017 10:37 pm

Please see my post in Re: Loading Local Files with Browser Widget on Android

dbeugeling
Attachments
Browsertest2.livecode.zip
(1.24 KiB) Downloaded 41 times
dbeugeling
 
Posts: 2
Joined: Thu Feb 12, 2015 12:22 pm


Return to iOS Deployment

Who is online

Users browsing this forum: Google [Bot] and 1 guest