iOS locationsensor background run

Source: Internet
Author: User

Set, Locationsensor.active: = True.

When you press the home key or the black screen, the program hangs immediately. The Locationsensorlocationchanged event also does not respond.

Some people say it takes two or three seconds to hang up, to me this is immediately, I do not know why.

solutions that you know on the Internet: http://www.fmxexpress.com/ learn-to-use-the-location-sensor-in-the-background-with-firemonkey-in-delphi-10-berlin-on-ios/

After testing, it is found that it does not fully operate in the background. The general operation was stopped 10 minutes.

Specific solutions: On the above web site basis (flocater. Setallowsbackgroundlocationupdates(True); ), you also need to add

Flocater.setpauseslocationupdatesautomatically (False);

That is

If tosversion. Check(9) and (flocater <> nil) Then

begin     {$ if defined (backgroundupdates) and< Span class= "crayon-h" > defined (CPUARM64< Span class= "Crayon-sy" >) } //for some reason, This function crashes in 32-bit flocater.requestalwaysauthorization; flocater. Setallowsbackgroundlocationupdates(True); flocater.setpauseslocationupdatesautomatically (False); {$ENDIF} end;

iOS locationsensor background run

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.