Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

network.request error in tvOS device
Started by ifunsoft0 Jan 10 2016 05:36 PM

8 replies to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

ifunsoft0

[GLOBAL: userInfoPane.html]
ifunsoft0
  • Observer

  • 13 posts
  • Corona SDK

I using network.request to get data from my sever, on Apple TV return value =-1. I using Daily Builds 2016.2830

Please help me



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,913 posts
  • Enterprise

Can you post your build.settings please?

 

Rob



[TOPIC: post.html]
#3

ifunsoft0

[GLOBAL: userInfoPane.html]
ifunsoft0
  • Observer

  • 13 posts
  • Corona SDK

Can you post your build.settings please?

 

Rob

settings = {
    orientation = {
        default = "landscapeRight",   --landscapeRight, landscapeLeft, portrait, portraitUpsideDown
        supported = {"landscapeRight", "landscapeLeft"}
    },

     tvos =
    {
        icon =
        {
            small =
            {
               -- "Icon-tvOS-Small-Top.png",
                "Icon-tvOS-Small-Middle.png",
                "Icon-tvOS-Small-Bottom.png",
            },
            large =
            {
               -- "Icon-tvOS-Large-Top.png",
                "Icon-tvOS-Large-Middle.png",
                "Icon-tvOS-Large-Bottom.png",
            }
        },

        -- Top Shelf image; a 1920x720 image file
        topShelfImage = "Icon-tvOS-TopShelf.png",

        -- Launch image; a 1920x1080 image file
        launchImage = "Icon-tvOS-Launch.png",


         plist = {
            GCSupportedGameControllers = {
                { ProfileName = "ExtendedGamepad" },
                { ProfileName = "Gamepad" },
                { ProfileName = "MicroGamepad" },
            },
            GCSupportsControllerUserInteraction = true,
        }
    },
}
Please help me!


[TOPIC: post.html]
#4

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,913 posts
  • Enterprise

iOS 9 (and tvOS) require you to access all network services through https instead of http.  Please see:
 

https://coronalabs.com/blog/2015/09/17/about-app-transport-security-ats/

 

You just need to add the appropriate plist block to your tvos table with the right ATS commands in it.

 

Rob



[TOPIC: post.html]
#5

Mike Hempfling

[GLOBAL: userInfoPane.html]
Mike Hempfling
  • Contributor

  • 253 posts
  • Corona SDK

Does the tvOS support "NSAppTransportSecurity = { NSAllowsArbitraryLoads = true }," because it is not working for me?



[TOPIC: post.html]
#6

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,913 posts
  • Enterprise

Yes it does. Can you post your build.settings?

 

Rob



[TOPIC: post.html]
#7

Trung Kien Tran

[GLOBAL: userInfoPane.html]
Trung Kien Tran
  • Enthusiast

  • 61 posts
  • Corona SDK

iOS 9 (and tvOS) require you to access all network services through https instead of http.  Please see:
 

https://coronalabs.com/blog/2015/09/17/about-app-transport-security-ats/

 

You just need to add the appropriate plist block to your tvos table with the right ATS commands in it.

 

Rob

It worked fine. Thanks Rob!



[TOPIC: post.html]
#8

Mike Hempfling

[GLOBAL: userInfoPane.html]
Mike Hempfling
  • Contributor

  • 253 posts
  • Corona SDK

It is now working since I put inside a plist block. You might want to add that tid-bit of info about the plist in the documentation for tvOS. Thanks for your help.



[TOPIC: post.html]
#9

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,913 posts
  • Enterprise

I've suggested that we add something there.

 

Rob




[topic_controls]
[/topic_controls]