iOS Question [Solved] Strange behavior of app under IOS 11.2

schimanski

Well-Known Member
Licensed User
Longtime User
I mentioned some strange things under IOS 11 in contrast to IOS 10. Under my device with IOS 10.3.3, my app works fine and all the animations are the same as always. On my iPhone6s with 11.2 (beta), there are strange animations in the customlistview. Sometimes, the app will stop working and I have a simple global boolean-variable, which is not able to hold the entry. I made a test with another global variable and set it to true, if the page3 is open. It will be false, if the page3 disapperars. Than, I read this in Application_remotenotification, but the boolean is always true, even if the the page3 had disappeared. The only position, I set this variable to true is when page3 appears. Without a few things , this version had run normaly on this device with 11.2. before yesterday. When I see the app working, it seems, that more than one variables changes the enties uncontrollably.... Did someone mentioned something similar?
 

schimanski

Well-Known Member
Licensed User
Longtime User
I mentioned also now, that under IOS 11.2. the location-services are no longer available. I can set it manual in the settings to 'always', but after starting the app, it will be replaced in 'never'. Is it possible, that the hosted builder under xcode 9 needs other permissions? In the logs, I get the following message when starting the locmanager. But this message, I had also before with no effect:

This app has attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain both NSLocationAlwaysAndWhenInUseUsageDescription and NSLocationWhenInUseUsageDescription keys with string values explaining to the user how the app uses this data

I use this:

B4X:
    'Kombination der Permission für Hintergrundaktualisierung (fetch) und Teil 1 des Background-Location-Trackings!
    #PlistExtra: <key>UIBackgroundModes</key><array><string>fetch</string><string>location</string></array>
   
    'Permissions für Background-Location-Tracking Teil 2
    #PlistExtra:<key>NSLocationAlwaysUsageDescription</key><string>Track your location in the background for better ad revenue.</string>
    #PlistExtra:<key>NSLocationUsageDescription</key><string>Used to display the current navigation data.</string>

I had account everything here:

https://www.b4x.com/android/forum/threads/xcode-9-ios-11-b4i-versions.85111/
 
Last edited:
Upvote 0

Sandman

Expert
Licensed User
I get the following message when starting the locmanager.
I just wanted to add my voice to this. I noticed yesterday or so that my LocManager didn't produce any events anymore - and that was a part of my project that I hadn't touched in quite a while (including the PlistExtras). I'm getting the exact same error message as @schimanski .

My best guess is that upgrading the hosted builder to XCode 9 perhaps changed this? Before the upgrade, this worked for me:
B4X:
#PlistExtra:<key>NSLocationAlwaysUsageDescription</key><string>Text goes here</string>
#PlistExtra:<key>NSLocationUsageDescription</key><string>Text goes here</string>

Now it seems I need to use this:
B4X:
#PlistExtra:<key>NSLocationAlwaysAndWhenInUseUsageDescription</key><string>Text goes here</string>
#PlistExtra:<key>NSLocationWhenInUseUsageDescription</key><string>Text goes here</string>

I don't really know enough about iOS to know for sure, but I suppose I just use all four of them now? Can't hurt, can it..?
 
Upvote 0

schimanski

Well-Known Member
Licensed User
Longtime User
I have a simple global boolean-variable, which is not able to hold the entry.

I'm not sure, if it helps, but watching the global variable in debug shows, that if the entry should be false, the compiler shows

B4X:
KonferenzAktiv =   Error evaluating expression.
 
Upvote 0

schimanski

Well-Known Member
Licensed User
Longtime User
Now, I think I have an good point of reference:

Under IOS 11.2, after closing a page, the system calls first page_disappaer and after that page_Resize(Width As Int, Height As Int). That is not the case under IOS 10.3.3. So the system calls page_resize if the page opens and closes....:eek: That is the reason, why the global variable always get the wrong entry. Is it a new behavior under xcode9? Than, I have to convert al lot of things...
 
Upvote 0

schimanski

Well-Known Member
Licensed User
Longtime User
I can't help thinking, that xcode 9 does not allow sloppy programming :confused:. The page resize_event is not raised on every page after closing it. It is only one event. It's suspect...
 
Upvote 0

schimanski

Well-Known Member
Licensed User
Longtime User
I have now mentioned, that the page.prompt=" " in page_disappear causes the problem. Up to IOS 11, the system calls page_resize, when the prompt ist changed in the page_disappear-sub. Thats not the case under IOS 10. So that was one reason for the strange behavior of my app because I deleted the promt always in the disappear-subs.
 
Upvote 0

schimanski

Well-Known Member
Licensed User
Longtime User
Now it seems I need to use this:
#PlistExtra:<key>NSLocationAlwaysAndWhenInUseUsageDescription</key><string>Text goes here</string>
#PlistExtra:<key>NSLocationWhenInUseUsageDescription</key><string>Text goes here</string>

That works, thank you!
 
Upvote 0
Top