How can I check programmatically that list of applications are installed or not in iPhone

前端 未结 2 908
-上瘾入骨i
-上瘾入骨i 2021-01-29 13:36

In my app I\'m showing list of applications.Is it possible to find that the array of applications are installed or not in iPhone. If any possibility is there anyone please provi

2条回答
  •  不要未来只要你来
    2021-01-29 14:01

    From your sandboxed application

    By default from an Application Layer, you are not allowed to use the private API's to check what other applications are installed on your device.

    Workarounds

    1. If the target third-party app supports URL schemes. You can check the url scheme they implement using [UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"someScheme://randomText"]] .

    2. (Not recommended)Take a look at private frameworks like /System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices LSApplicationWorkspace . There is a method called allInstalledApplications in LSApplicationWorkspace which should work, check runtime headers for more info.

    Off topic ~ For MDM devices

    Using Mobile Device Management (MDM) protocol, you can use InstalledApplicationList command to get the array of installed applications on the target device. The following is the response for the said MDM command.

提交回复
热议问题