Page 1 of 1

M1 Monterray: MergNotify unknown command

Posted: Fri Jul 29, 2022 2:47 pm
by trevix
I just passed to a M1 Mac with OSX 12.5 and LC 9.6.8

I have a library stack on my application that uses the MergNotify extension (with is correctly chcked in the standalone settings).
Having found the LC IDE apparently slower, I wend to the LC GetInfo to be sure that LC wasn't loading under Rosetta (not ever checked before, since passing from the iMac to the Macstudio).
It was not checked but, to be sure, I checked Rosetta and then unchecked it.

On the following relaunch of LC, the ID got un error on the command mergNotify "UIApplicationWillResignActiveNotification" under MacOS.
See the script below:

Code: Select all

on libraryStack
     if the short name of this stack = "lib_Analytics" then --AND "lib_AnalyticsFMS_API" is not among the lines of the stacksinuse then
         ...
          switch the Platform
               case "MacOS"
                    mergNotify "UIApplicationWillResignActiveNotification" --THIS LINE TROWS AN ERROR
                    mergNotify "UIApplicationDidBecomeActiveNotification"
                    break
               case "Win32"
                    break
               case "iphone"
                    mergNotify "UIApplicationWillResignActiveNotification"
                    mergNotify "UIApplicationDidBecomeActiveNotification"
                    break
               case "android"
                    StartListener --enable "StackPause" and "StackResumed" on android only (ios use a different system)
                    break
          end switch
                   ...
                   
THE ERROR IS "stack "lib_analytics": execution error at line 32 (Handler: can't find handler) near "mergNotify", char 1

Putting a check on "run under Rosetta", does not trow the error anymore.
Does the Merge extension needs an update?
Thanks
Trevix

Re: M1 Monterray: MergNotify unknown command

Posted: Fri Jul 29, 2022 3:03 pm
by Klaus
Hi Trevix,
trevix wrote:
Fri Jul 29, 2022 2:47 pm
...
Putting a check on "run under Rosetta", does not trow the error anymore.
Does the Merge extension needs an update?
yep, sounds like that, please report it here: https://quality.livecode.com
Thank you!


Best

Klaus

Re: M1 Monterray: MergNotify unknown command

Posted: Fri Jul 29, 2022 4:46 pm
by LCMark
Yes - we need to make sure we compile mergNotify for arm64 on macOS as well it seems :D

However, that being said, I don't think those two lines in 'macos' case actually do anything useful - macOS doesn't have notifications UIApplicationWillResignActiveNotification and UIApplicationDidBecomeActiveNotification - they are specific to iOS.

On desktop the equivalent is the 'suspend' and 'resume' messages (which you can hook into in a frontscript).

Re: M1 Monterray: MergNotify unknown command

Posted: Fri Jul 29, 2022 5:06 pm
by trevix
Correct, even if in the dictionary is not that clear on MacOS and MergeNotify.

So I will have to use "UIApplicationWillResignActiveNotification" and "UIApplicationDidBecomeActiveNotification" on iOS
"StackPaused" and "StackResumed" on Android (using the Android Event Listener library).
"Suspend" and "Resume" on OSX.

Hopefully one day they will be re-united