GLBasic forum

Main forum => GLBasic - en => Topic started by: msx on 2011-May-24

Title: Help! Problems with NETWEBGET command and review of Apple
Post by: msx on 2011-May-24
Apple phoned me :S because I have had problems several times in the process of reviewing my application, it appears that the problem comes from the line:

LEE$=NETWEBGET$("www.google.com", "/", 80, 512)

This makes the application crashes.

Does anyone know what I'm doing wrong?
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: MrTAToad on 2011-May-25
Should work fine.  It returns :

Code (glbasic) Select
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="http://www.google.co.uk/">here</A>.
</BODY></HTML>


You will to put in debug statements after each command just before and after that, as I suspect the crash is elsewhere.
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: msx on 2011-May-25
The rest are simple commands such as IF, ALPHAMODE, DRAWSPRITE ...

That is why I am sure that the bug comes from NETWEBGET$
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: MrTAToad on 2011-May-25
Will need to see if another iPhone user can try it...

It might be worth trying it on its own (and in debug mode) and see what XCode says.
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: msx on 2011-May-25
Tested on my iPhone with Development Certificate and it works correctly but when I upload to iTunes, they reject it because it crashes.
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: MrTAToad on 2011-May-25
Sounds like iTunes does something to the Application...
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: Kitty Hello on 2011-May-25
do you get a log of the output form apple?
Then, you could put a lot of STDOUT calls in between to see where it crashes.

They "Called" you!?
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: msx on 2011-May-25
This is the reason why my application was rejected.:

Quote2.2: Apps that exhibit bugs will be rejected

May 11, 2011 11:55 AM. From Apple.

2.2

We found that your app failed to launch on iPhone 4 running iOS 4.3.3, on an unsecured Wi-Fi network.

We encountered the issue when selecting the application on the Home screen - the app displayed a launch image then quit unexpectedly. This may be because iOS 4 uses a watchdog timer for applications; if an application takes too long to complete its initial startup, the operating system terminates the application.

For information about the watchdog timer, please see Technical Q&A: Application does not crash when launched from debugger but crashes when launched by user..

Another possibility could be a missing entitlement. For more information, please see the Technical Note: Resolving "0x800003A", applications not launching and "missing entitlement".

For discrete code-level questions, you may wish to consult with Apple Developer Technical Support. Please be sure to include any symbolicated crash logs, screenshots, or steps to reproduce the issues when you submit your request. For information on how to symbolicate and read a crash log, please see Tech Note TN2151 Understanding and Analyzing iPhone OS Application Crash Reports.

To appeal this review, please submit a request to the App Review Board

I could use STDOUT as you advise me, but the problem is that it works for me correctly the app so that I would be useless, unless they notify me, that I do not think because they are very brief.

Yes, really they called me personally to my phone  :S and not only that, I have the phone number, email from Apple Developer Technical Support and the email from application review department.

Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: Kitty Hello on 2011-May-25
Quote from: msx on 2011-May-25
This is the reason why my application was rejected.:
...I have the phone number, email from Apple Developer Technical Support and the email from application review department.

Sell that, then. XD

I "think" - it's the entitlement.plist. Are you very sure you have that in your XCode project and filled in properly?
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: msx on 2011-May-25
I do not use Ad-Hoc distribution so I have no such file.

Apparently, they run my application far as the point where the NETWEBGET$ command appears
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: Kitty Hello on 2011-May-25
You must have such a file. That's what I always implement with distributing.

Trucidare, for the rescue!!
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: msx on 2011-May-25
 :blink:

check the following link:

http://developer.apple.com/ios/manage/distribution/index.action

click on "Building your Application with Xcode for Distribution."

Find point 7 just below the image, you can read "App Store For Distribution, skip to Step 12. For Ad Hoc Distribution, complete the Following:"
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: Qube on 2011-May-25
Probably a silly idea but which version of XCode are you using? - I know there's an issue with XCode 4 iOS 4.3 with apps working fine locally but crash for Apple. This appears to be with GLB and Unity3D - Recommendations until it's sorted out are to use XCode 3.2.5 and iOS 4.2 SDK.

Another possible solution (again, assuming it's an XCode iOS 4.3 issue) is detailed here http://forum.unity3d.com/threads/83076-iOS-4.3-App-Rejected?p=578829&viewfull=1#post578829

Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: msx on 2011-May-25
Some time ago I use XCode 3.2.5 SDK 4.2 because later versions give me many errors.
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: msx on 2011-May-26
Quote from: Kitty Hello on 2011-May-25
You must have such a file. That's what I always implement with distributing.

Trucidare, for the rescue!!

Could someone confirm if this is so?
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: msx on 2011-May-26
I answer myself. Not so, entitlement.plist file is only required for Ad-Hoc distribution.

Referring to NETWEBGET$ finally clear to me that is a BUG which makes Apple reject applications that use this command. After 3 months uploading my application, I deleted the NETWEBGET$ command and I changed it to NETWEBGET and socket and the application has finally been approved.
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: Kitty Hello on 2011-May-26
Can you send me the code where you use NETWEBGET$? I can't believe there's a bug, but I'm wiling to take a peek.
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: msx on 2011-May-26
I haven't it here, but the problem was this:

LEE$=NETWEBGET$("www.google.com", "/", 80, 512)

Replaced by NETWEBGET and running.

I uploaded my application to 8 times, so I can assure you that the problem was this.
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: MrTAToad on 2011-May-26
I don't see it being a bug as it works okay without sending to Apple.  What could be happening is the time-out value is too long and their machine thinks its crashing - essentially testing it as if there is a poor (or no) connection.
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: msx on 2011-May-26
It is very strange that in the same conditions NETWEBGET works and NETWEBGET$ does not work.
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: Moebius on 2011-May-26
What were you using NETWEBGET$ for?  Checking for an internet connection?
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: msx on 2011-May-26
I used to check the internet and read a text file hosted on my server. Finally eliminated and my application appears in the App Store.
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: MrTAToad on 2011-May-26
I would be interesting to see if they would accept Spots in that case - I do the same thing (but call up to 4 different websites)...
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: msx on 2011-May-26
Be careful, I would not use it. (I mean NETWEBGET$)
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: MrTAToad on 2011-May-26
What version of GLBasic are you using, by the way ?  There was a problem with truncation.
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: msx on 2011-May-26
The last version, naturally.
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: MrTAToad on 2011-May-26
With the hotfix ?
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: msx on 2011-May-26
there is a hotfix?  :blink:
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: Kitty Hello on 2011-May-26
for the BETA, yes. The release might have the bug, still.
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: msx on 2011-May-26
I use the official version, yet. Is the Beta version which adds the Android SDK?
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: MrTAToad on 2011-May-26
Thats right
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: msx on 2011-May-26
If Spots game is "in review" and use the NETWEBGET$ command would confirm that this is a bug.  :whistle:
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: Moebius on 2011-May-26
Considering that no one has had these problems before, is there anything in your "check for internet connection" code that could cause problems?  It seems strange that it would a GLB thing if it works in some instances but not others...
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: msx on 2011-May-26
I searched in the forum and it is curious that the NETWEBGET command with the $ does not appear, so this would explain why no one has had any problems yet.

Anyway I'd like to meet someone who use this command and has a published application in App Store.
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: Kitty Hello on 2011-May-26
Quote
// 9.040
   // Kern:
   //    NETWEBGET$ returned nothing when the buffer was too small.

I think that was already fixed. But wasn't there a bug where it crashed, that you sent me as an email MrTaToad?
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: Omadan on 2011-May-26
MSX my friend, Ill help you in any way I can. I have 2-3 apps in the itunes store which use Netwebget$.
Approved and no problems in any manner :P
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: Millerszone on 2011-May-26
I'm using NETWEBGET$ and NETWEBGET in HTD Baseball iphone/ipad for the leaderboards
and don't have a problem, but it was compiled with version 9.040

I'm going to be sending an update tomorrow using the latest beta with the latest hotfix, does that
mean I now could have a problem with the NETWEBGET$ command?


Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: msx on 2011-May-26
Thank you Omadan. My application was working normally until it ran that command. Could prove that NETWEBGET$ is working properly?.

P.D.: Millerszone, don't worry, I used oficial versión and not Beta.
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: Millerszone on 2011-May-26
Just to be safe I removed NETWEBGET$ and used NETWEBGET for everything.
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: MrTAToad on 2011-May-26
Quote from: Kitty Hello on 2011-May-26
Quote
// 9.040
   // Kern:
   //    NETWEBGET$ returned nothing when the buffer was too small.

I think that was already fixed. But wasn't there a bug where it crashed, that you sent me as an email MrTaToad?
There was I believe - I cant remember when though...  :S

QuoteIf Spots game is "in review" and use the NETWEBGET$ command would confirm that this is a bug
I dont develop for iPhone - I prefer the much more programmer friendly webOS :)

Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: Slydog on 2011-May-26
QuoteJust to be safe I removed NETWEBGET$ and used NETWEBGET for everything.

I've never used either command, but aren't they used two different ways?

NETWEBGET%() is to return a web page to a local file, which the name is specified in the call, and it returns an 'ok' status to the left variable if it succeeded (and you have to manually open the file if you want the text data)

NETWEBGET$() returns the web page string directly to the left variable

[Edit] Ha, or did you mean you also recoded the routine to expect the results in a file?
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: Millerszone on 2011-May-26
Quote from: Slydog on 2011-May-26
QuoteJust to be safe I removed NETWEBGET$ and used NETWEBGET for everything.

I've never used either command, but aren't they used two different ways?

NETWEBGET%() is to return a web page to a local file, which the name is specified in the call, and it returns an 'ok' status to the left variable if it succeeded (and you have to manually open the file if you want the text data)

NETWEBGET$() returns the web page string directly to the left variable

[Edit] Ha, or did you mean you also recoded the routine to expect the results in a file?

To send leaderboard scores:
NETWEBGET("www.smashedfly.com", str$, 80, 0)

To receive leaderboard scores:
NETWEBGET("www.smashedfly.com", str$, 80, globalLeaderboardFile$)

Works on PC, should work on all platforms?

Using this to check internet connection:
Code (glbasic) Select

FUNCTION checkInternetConnection:

internetConnectionGood = FALSE

SOCK_INIT()
sock% = SOCK_TCPCONNECT("www.smashedfly.com", 80, 5000)
// if sock -1 then no connection to leaderboard server, if sock = 0 then leaderboard is connected
IF sock >= 0 THEN internetConnectionGood = TRUE
SOCK_CLOSE(sock)
SOCK_SHUTDOWN

ENDFUNCTION
Title: Re: Help! Problems with NETWEBGET command and review of Apple
Post by: msx on 2011-May-26
Ok, so I did it and works correctly at least on the iPhone and Windows.

I note that you used sock > = 0, it took me a while to find out why it did not work.

I too use the NETWEBGET command and works perfectly.