I ran into a problem while using the "close screen with value" block on iOS devices. Some of my students were trying to develop an App where you can switch to a second screen to draw a picture and when you go back to the first screen the picture is passed to that screen. On Android devices everything works fine. On iOS devices the combination of the "close screen with value" block and the "when other screen closed" event is not working properly.
I wrote a little test app to figure out how opening and closing of screens is working in iOS apps. The app should work like this: When you switch to screen2 using the button on screen1 the actual value of label1 is passed to screen2. This value is shown on screen2. When you switch back from screen2 to screen1 the value is increased by 1 and passed to screen1 using the "close screen with value" block. The new value should be shown on screen1. So anytime you go to screen2 and then back to screen1 the value should be increased by 1.
On an android 10 device running the companion app version 2.63 the app works as intended. Using an iPad Air (4th generation) with iOS v15.4.1 and the companion app version 2.60 (build 8) two problems occur:
The "when other screen closed" event is not fired when I return to screen1. It seems to be totally ignored.
The "when Screen1.Initialize" event is fired when I switched to screen2 and then return to screen1. But this event should only be fired once when the screen is intialized the first time and not again when you return to this screen. It seems like screen1 is not running in the background when screen2 is opened but closed and then reopened which means that I can't pass a result to screen1 when leaving screen2. When I come back to screen1 I can see "Text for Label1" and "Text for Label2" for a short time and then "0" and "Init" are shown.
My question is: Is this behavior intended on iOS or is there a bug in the implementation of these blocks?