LC iOS Command 'mergPopActivity'
livfoss at mac.com
Wed Oct 21 11:32:49 EDT 2020
A little progress report.
Elanor has come up with a solid answer to my original question, which was how to use the mergPopActivity command to break out of an iOS app sandbox by offering a file to the external world (such as the “Files” folder) on iOS systems. Basically, if you put a file in say the documents folder within your app and make a path tPath to it, then if the file’s name is in tFileName,
mergPopActivity tFileName,,("file:" & tPath)
will open the model window and allow the user to put the file into “Files” folder, email it etc
So far I have not found out how to invoke another app directly from inside an iOS app, although I think I can invoke a browser using a URL. Perhaps this is easier than I thought. Will report.
> On 19 Oct 2020, at 11:14, Graham Samuel via use-livecode <use-livecode at lists.runrev.com> wrote:
> Thanks very much for that. Sadly on a first look, in this particular case there is little or no additional detail about the command. Nevertheless I think there should be a link to the Merg web site in the LC Dictionary itself.
> I rely heavily on the Dictionary, and only venture elsewhere when I am completely foxed, as with iOS Deployment, for me a nightmare compared with simply coding and debugging.
> It is also true that the Simulator is very limited, in particular in showing what’s happening when things go wrong (silent failure being a factor which has bitten me several times). Under the Simulator, my GPS-related app can only use a couple of limited examples built in to Xcode.
> Probably there is a way to roll your own, but only in the monstrous xCode universe, so very different from the familiar environment of LC. I am really too old to start learning all that stuff. Apart though from my own bruised ego, there is the issue of one of the key USPs of LC - simplicity - being damaged by the difficulty of deployment. I’m ranting, I suppose… will study the Merg info, but sadly still need Elanor to ride to the rescue!
>> On 19 Oct 2020, at 03:23, Andrew at MidWest Coast Media <andrew at midwestcoastmedia.com> wrote:
>> The limited documentation is at http://mergext.com/home/mergpop/ <http://mergext.com/home/mergpop/>
>> Glad to hear that Elanor might be working on some more documentation. This feature (like push notifications and mobile camera) are difficult to test since the emulator either doesn’t work or has extremely limited functionality.
>> I found this code snippet in an old project where I was taking a screenshot of part of the screen and trying to share to Facebook or Twitter.
>> export snapshot from rect tExportRect of this card to file tFilePath as PNG
>> mergPopActivity "Indiana On Tap just hooked me up!",tFilePath,”"
>> —Andrew Bell
>>> Message: 13
>>> Date: Sun, 18 Oct 2020 12:58:50 +0200
>>> From: Graham Samuel <livfoss at mac.com <mailto:livfoss at mac.com>>
>>> To: How to use LiveCode <use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com>>
>>> Subject: LC iOS Command 'mergPopActivity' [was Re: The iOS "Files"
>>> Message-ID: <769B3120-FCF5-4ECB-9683-AC0A303E2A47 at mac.com <mailto:769B3120-FCF5-4ECB-9683-AC0A303E2A47 at mac.com>>
>>> Content-Type: text/plain; charset=utf-8
>>> I have been trying to use this command, initially to allow an iOS app to put something in the ?Files? folder on an iPhone, but I?m now more interested in the whole idea of Activity Views and how to exploit them in an iOS app. I believe that the LC ?mergPopActivity' command is a wrapper for some function in the iOS native universe - connected with ?UIActivityViewController', but so far I haven?t worked out which one, since I don?t really understand much of Apple?s iOS Developer documentation (I always hope that using LC removes the need to do so!).
>>> Elanor Buchanan of the mother ship has been extremely helpful about this, and has said she hopes to improve the almost non-existent documentation of this command, but meanwhile I?m interested if anyone on this list has any insights, as I?m quite stuck and don?t want to bug Elanor too much.
>>> When you invoke the ?mergPopActivity' command in an LC script, it opens a modal window which gives a gateway into services available on your device, like email, printing, saving to ?Files?, sending to social media etc - it depends on what your device is capable of, and the apps it has loaded; so I believe that the LC command essentially implements the ?sharing? activity in iOS, which is usually invoked via an icon consisting of a square with a North-pointing arrow in it.
>>> So far so good, but I?ve only been able to do one thing so far, which is to offer a text string originating in the app to these various services. So far I have not been able to find a way to offer a file (for example, a file containing a text rather than the text itself - easy to generate within an app, but no luck in offering to email it etc). There is a ?URL? parameter but I can?t work out what it does.
>>> Anyone got any clues or shall I apologise (again) to Elanor and ask her for more help?
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the use-livecode