MSGreg
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2012
03:11 PM
SetCertificatesDepth and avoid calling non-existent methods
I've used ifUrlTransfer.SetCertificatesDepth(3) in Version 4.7/4.8. It was required for communicating successfully to Dropbox over https.
A customer is reporting that my https communication is crashing my app on a Roku box running version 3.1.
What version(s) of BrightScript supports the ifUrlTransfer.SetCertificatesDepth(Integer) method?
Is there a way to verify the function exists before calling it?
Perhaps:
A customer is reporting that my https communication is crashing my app on a Roku box running version 3.1.
What version(s) of BrightScript supports the ifUrlTransfer.SetCertificatesDepth(Integer) method?
Is there a way to verify the function exists before calling it?
Perhaps:
http = CreateObject("roUrlTransfer")
if http.DoesExist("SetCertificatesDepth") then http.SetCertificatesDepth(3) ' Does this work to prevent calling non-existent methods?
3 REPLIES 3

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2012
03:45 PM
Re: SetCertificatesDepth and avoid calling non-existent meth
SetCertificatesDepth is only available in 4.x, so you could just check the firmware version in your code to avoid calling it if the major version is less than 4.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
MSGreg
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2012
03:27 AM
Re: SetCertificatesDepth and avoid calling non-existent meth
Thanks, TheEndless
For the benefit of others reading this, DoesExist() method does not work to determine whether a method exists or not. (On further review after I posted, "DoesExist()" would have to be an implemented method on an interface to be usable, like it is on roAssociativeArray objects.
Here's the snippet that worked, based on TheEndless's suggestion. Version
For the benefit of others reading this, DoesExist() method does not work to determine whether a method exists or not. (On further review after I posted, "DoesExist()" would have to be an implemented method on an interface to be usable, like it is on roAssociativeArray objects.
Here's the snippet that worked, based on TheEndless's suggestion. Version
' Example Version values are "4.08" and "4.07", NOT "4.8" and "4.7"!!
Version = Val(CreateObject("roDeviceInfo").GetVersion().Mid(2,4))
if Version >= 4 then print "Major Version 4 or above"

OddScott
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2012
07:05 PM
Re: SetCertificatesDepth and avoid calling non-existent meth
Just a point of interest... I can confirm that SetCertificatesDepth() does exist in 3.1.1017 with roVideoScreen. Had the same problem with Dropbox, adding SetCertificatesDepth(3) corrected it. Was the first time I actually saw SetCertificatesDepth() actually do anything.
www.InstantTvChannel.com / www.InstantSubtitles.com - 717-441-4386 - Build a Roku SDK channel in 15 minutes! Easily and inexpensively generate subtitles!