MacOSLib and App Store

I was playing around with the MacOSLib, with a view to use it in future projects, but I am a little concerned that there may be some aspects of it that could cause any apps to be rejected by the App Store. Does anyone know if this is an issue?

No, it’s not an issue. MacOSLib only gives you access to OS calls that might otherwise be unavailable in pure Xojo code. These are the same calls you’d use if you used Xcode.

Thanks Kem, that is exactly what I wanted to hear. During the period that we couldn’t submit to the app store, I wrote a few small utilities in Objective-C, just to get them up, but I would like the chance to rewrite them in Xojo and resubmit.

If you use some MacOSLib API’s that declare into deprecated API’s like QTKit, which MacOSLib has lots of functionality for, then you can get rejected for using a deprecated API

But if you don’t then any unused functionality is not included in your application - unused items are stripped out.

Thanks Norman, I thought that might be the case. So even though the QTKit classes are in the library, the frameworks are not loaded unless I use them.

If you use something in MacOSLib that depends on deprecated technologies - QTKit is an easy example - then yes you could get rejected for that

If you don’t then you should be fine as unused classes / methods etc get stripped out as a normal part of the compilation process

I think the most important part about your question is this:

Even if there’s a problem within Macoslib, you and anyone else around here can help you fix this quickly because it’s all open source, and it’s all based on documented Apple functions.

Contrary to that, if you rely on functions in the Xojo libraries or in some plugins, you have little control over fixing it yourself. You’ll have to wait for the maker of the lib or plugin to fix it.

You may just have to tear out all the localized strings in MacOSLib (menu string I think) otherwise Apple will list your app as being localized when it might not be or list it as localized into locales its not localized into

This actually burned me a couple of times so I added a build step to just get rid of them (it’s very sloppy, but I wrote it in a pinch in sublimetext and since it worked I didn’t try a more sensible approach, like the shell just getting rid of everything but the correct languages):

[code]dim dest as string
dest = CurrentBuildLocation +"/" + chr(34) + CurrentBuildAppName + chr(34) + “.app/Contents/Resources”

dim cmd as string
cmd = "/bin/rm -rf " + dest + “/”
'print cmd

call doshellcommand(cmd+ “bg.lproj”+"/")
call doshellcommand(cmd+ “bn.lproj”+"/")
call doshellcommand(cmd+ “cs.lproj”+"/")
call doshellcommand(cmd+ “da.lproj”+"/")
call doshellcommand(cmd+ “de.lproj”+"/")
call doshellcommand(cmd+ “el.lproj”+"/")
call doshellcommand(cmd+ “et.lproj”+"/")
call doshellcommand(cmd+ “fi.lproj”+"/")
call doshellcommand(cmd+ “fr.lproj”+"/")
call doshellcommand(cmd+ “he.lproj”+"/")
call doshellcommand(cmd+ “hr.lproj”+"/")
call doshellcommand(cmd+ “hu.lproj”+"/")
call doshellcommand(cmd+ “is.lproj”+"/")
call doshellcommand(cmd+ “it.lproj”+"/")
call doshellcommand(cmd+ “ja.lproj”+"/")
call doshellcommand(cmd+ “nl.lproj”+"/")
call doshellcommand(cmd+ “no.lproj”+"/")
call doshellcommand(cmd+ “pl.lproj”+"/")
call doshellcommand(cmd+ “pt.lproj”+"/")
call doshellcommand(cmd+ “ro.lproj”+"/")
call doshellcommand(cmd+ “sk.lproj”+"/")
call doshellcommand(cmd+ “sl.lproj”+"/")
call doshellcommand(cmd+ “sv.lproj”+"/")
call doshellcommand(cmd+ “tr.lproj”+"/")[/code]

(tried to paste the build step but copying/pasting didn’t work here)

I know this has caught a few people as we had bugs reported about the IDE localizing thing magically
I’d made the suggestion that these strings be pulled out and only “default” values left in and the rest of the localized value put in Lingua files so they could be added if needed

For now you have to know about this & do it yourself

Sorry for the thread necro, but I just experienced what Norman says here (btw, Hi Norman, long time no see, was Maui 2004 i think).
I built an application with no localizations but English, but it was built on a Mac OS with Swedish set as primary language, and all menu items that are added to Application Menu plus “undo” in Edit are in Swedish, even when running on a system with English set as primary language.

This was built with 2018R3.

So, any idea how to strip that away? Eduardos approach?

And building on a system set to English as primary language will have English added menues.
So, I consider this a bug!

Since I use App Wrapper, I do not care to remove these items from MacOsLib. I just remove them in App Wrapper.

By the way, just in case you were not aware, there is a 64bit version at:
https://github.com/vidalvanbergen/macoslib/tree/master-64bit

But I have not sent yet any 64bit app to MAS.

The problem is that MacOSLib has localized values in numerous places. When you build all of those values get put into the various localized strings and when Apple sees your app they may well test it in every localization that exists and find that your localization is incomplete.

As Norm stated some time ago - basically you need to strip out all the localized values you do not support. You could use Eduardo’s method to post process your built app.

Hi,
I just tried this with a plain new application, just create new and build, not using MacOSLib at all unless it’s automatically linked for some reason. I put my results into a PDF.
Link to PDF

[quote=411574:@Totte Alm]Sorry for the thread necro, but I just experienced what Norman says here (btw, Hi Norman, long time no see, was Maui 2004 i think).
I built an application with no localizations but English, but it was built on a Mac OS with Swedish set as primary language, and all menu items that are added to Application Menu plus “undo” in Edit are in Swedish, even when running on a system with English set as primary language.

This was built with 2018R3.

So, any idea how to strip that away? Eduardos approach?[/quote]

If you only want English and building in a non-English system, you can change the Build Settings - Shared - Build - Language to English

Ah, thanks!
Just got that answer another way too. That was hard to find!
And now testing if it works…

and it does!

case closed!