Recent

Author Topic: App Store rejection :-(  (Read 20368 times)

Clover

  • New Member
  • *
  • Posts: 46
App Store rejection :-(
« on: March 29, 2011, 05:39:41 pm »
My first Lazarus application (a port of my Windows Delphi game) just got rejected by the Apple App Store review process for use of a non-public API call, namely _NSGetCarbonMenu

Naturally I'm not using this in my code so it's used in Lazarus's Carbon based code I guess. The app was built with lazarus 0.9.29 and fpc 2.5.1. I've since updated to the new 0.9.30 and 2.4.2 today but the app they reviewed was submitted about two weeks ago.

Here is what they said:

2.5 Apps that use non-public APIs will be rejected

Mar 28, 2011 06:34 PM. From Apple.
2.5

The use of non-public APIs can lead to a poor user experience should these APIs change in the future, and is therefore not permitted. The app includes '_NSGetCarbonMenu' from the framework .

If you have defined a method in your source code with the same name as this API, we suggest altering your method name so that it no longer collides with Apple's private API to avoid your application being flagged in future submissions.

Alternatively, this API may reside in a library included with your application. If you do not have access to the library's source, you may be able to search the compiled binary using “strings" or “otool" command line tools. The “strings" tool can output a list of the methods that the library calls and “otool -ov" will output the Objective-C class structures and their defined methods. These techniques can help you narrow down where the problematic code resides.

Anybody got any thoughts on this?

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: App Store rejection :-(
« Reply #1 on: March 29, 2011, 07:04:23 pm »
It's used in Laz carbontrayicon.inc.

Not sure what framework that's in.

Thanks.

-Phil

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: App Store rejection :-(
« Reply #2 on: March 29, 2011, 07:23:44 pm »
_NSGetCarbonMenu has been flagged since at least 2004 as something that should not be used since it was undocumented.

http://lists.apple.com/archives/cocoa-dev/2004/Mar/msg00093.html

http://www.cocoabuilder.com/archive/cocoa/134887-nsgetcarbonmenu-useage.html

I suggest that you file a bug report with Lazarus (see Bugtracker at left).

Are you using TTrayIcon?

Thanks.

-Phil

Clover

  • New Member
  • *
  • Posts: 46
Re: App Store rejection :-(
« Reply #3 on: March 29, 2011, 07:43:08 pm »
Hi Phil

Thanks for looking. No, I'm not using TTrayIcon.

I see that carbontrayicon.inc is included at the bottom of carbonwsextctrls.pp written by dmitry. I wonder if it's needed.

I will write a bug report, thanks for the background info.


Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: App Store rejection :-(
« Reply #4 on: March 29, 2011, 07:50:34 pm »
I guess it's still getting linked in even though you're not using it.

You could probably just comments out this in carbontrayicon.inc for now:

function _NSGetCarbonMenu(AMenu: lobjc.id {NSMenu}): MenuRef; cdecl; external name '_NSGetCarbonMenu';

And also comment out the one place a few lines down that calls this external function.

I don't see any other things like this in the Carbon widgetset.

Thanks.

-Phil

Clover

  • New Member
  • *
  • Posts: 46
Re: App Store rejection :-(
« Reply #5 on: March 29, 2011, 07:55:32 pm »
I think you are right Phil

I just grepped PrivateCocoaCarbonTrayIcon , which is the one class that refers to NSGetCarbonMenu and got no references to PrivateCocoaCarbonTrayIcon at all. So I think maybe Apple just found NSGetCarbonMenu in the symbol file even though it's not being used.

I'll try and do what you said and let you know.

Clover

  • New Member
  • *
  • Posts: 46
Re: App Store rejection :-(
« Reply #6 on: March 29, 2011, 08:18:01 pm »
Bingo!

I had to comment out some more lines in the function IsTrayIconMenuVisible so that it just returns False, then rebuilt Lazarus and that did the trick.

_NSGetCarbonMenu can no longer be found in my binary.

Now I can re-submit my app. Many thanks indeed for your help, Phil.

David.

JimBeam

  • New Member
  • *
  • Posts: 36
Re: App Store rejection :-(
« Reply #7 on: March 29, 2011, 08:52:34 pm »
David,

Pardon me if I'm a bit rude, but if you have not yet done so, could you please file a bug report so future appstore devs (possibly me  ;) can avoid your problems?

Thanks!

Clover

  • New Member
  • *
  • Posts: 46
Re: App Store rejection :-(
« Reply #8 on: March 29, 2011, 09:38:24 pm »
Not rude at all, Jim, I was definitely going to as I think any other Lazarus app would also get rejected.

I have now submitted a bug report.

By the way my app also got rejected for a second reason. It turns out you can resize the main window down to nothing so the app completely vanishes into thin air. Windows won't let you do that and none of my testers noticed or mentioned it. So I need to set a minimum size or something.

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: App Store rejection :-(
« Reply #9 on: March 29, 2011, 09:45:04 pm »
Probably setting your main form's Constraints.MinHeight/MinWidth would work. I see I have that set in one of my apps and I can't shrink the size of the form below that on OS X.

Thanks.

-Phil

Clover

  • New Member
  • *
  • Posts: 46
Re: App Store rejection :-(
« Reply #10 on: March 29, 2011, 10:26:26 pm »
Perfect, thanks.

LazaruX

  • Hero Member
  • *****
  • Posts: 597
  • Lazarus original cheetah.The cheetah doesn't cheat
Re: App Store rejection :-(
« Reply #11 on: March 29, 2011, 11:51:55 pm »
O though only things written in Objective-C where allowed in the Apple App Store. Nice to know also other programming languages are allowed.

Clover

  • New Member
  • *
  • Posts: 46
Re: App Store rejection :-(
« Reply #12 on: March 30, 2011, 12:32:41 am »
Ryan Joseph of thealchemistguild.com already has an app accepted into the store and I believe he used free pascal (without lazarus) so wouldn't have run into this problem. He posted some great info on preparing the app outside of XCode on his site and I used his helpful php script which automates the codesigning and packaging of the bundle prior to submission to Apple.

My app is now "In review" again, I'll post on this thread if it is accepted.

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: App Store rejection :-(
« Reply #13 on: March 30, 2011, 01:32:41 am »
Yes, Ryan used Carbon in his app (no Cocoa), so Carbon is still an acceptable framework to use for the UI.

Note that with Xcode 4 and the Objective Pascal "dialect" of FPC 2.5.1, you can also develop entirely within Xcode 4, using Cocoa, integrated Interface Builder, code signing, etc.

Here's the start of a new series:

http://web.me.com/macpgmr/ObjP/Xcode4/ObjP_Part1.html

Thanks.

-Phil

Clover

  • New Member
  • *
  • Posts: 46
Re: App Store rejection :-(
« Reply #14 on: March 30, 2011, 09:34:46 am »
I'm pleased to report that Jigsaws Galore for Mac has been accepted into the App Store  :D

That's a very interesting article on Objective Pascal, Phil. I'm considering porting to iPad/iPhone next. It sounds like that's the direction I should go rather than try to coerce the lazarus app into it.

If I'd started from scratch I would have naturally gone straight to Cocoa/XCode/Objective C but the game has 30,000 lines of Delphi code from many years of development and Lazarus was a good solution for creating a cross platform solution. I thought about waiting for Delphi 2011 but apparently it is still not out yet so Lazarus was a good decision, I feel. Yes, it was somewhat painful and I nearly had a change of heart when I saw that TBitmap.Scanline was not supported (which I rely on heavily) but in the end it turned out fine and both Mac and Windows versions run just as fast and smoothly as the original Delphi game.

Dave

 

TinyPortal © 2005-2018