I need to know if user has certain apps on his iphone device
I have this code
BOOL isInstalled = [[LSApplicationWorkspace defaultWorkspace] applicationIsInstalled:#"com.app.identifier"];
if (isInstalled) {
// app is installed }
else {
// app is not installed
}
which in theory does the job
the question is in practice, does it pass the app store?
can i use the "LSApplicationWorkspace" class ?
No.
All applications referencing private APIs and even undocumented APIs are not allowed.
Related
I know this is a common question but since there are lots of things changing with each ios update , curious to ask this again.
I have a requirement in iOS app (implemented using ionic framework) , where there must be an option to go to Bluetooth settings of the iphone from within the app so that the user can turn it on/off.
I have read several articles saying that Apple may reject apps trying to access phone settings and it is not advisable to access phone settings through app. Can someone clarify if this still holds true with latest iOS versions and should I never try to do this in future?
You cannot open the Bluetooth settings by using
App-Prefs:root=Bluetooth
The issue is that Apple does not allow us to use non-public APIs anymore and you maybe at risk of getting your developer program cancelled if you try to do so.
All you can do is open the iPhone settings in general by using this code:
extension UIApplication {
static func openAppSettings(completion: #escaping (_ isSuccess: Bool) -> ()) {
guard let url = URL(string: UIApplication.openSettingsURLString) else {
completion(false)
return
}
UIApplication.shared.open(url) { isSuccess in
completion(isSuccess)
}
}
}
Usage:
UIApplication.openAppSettings { isSuccess in
if isSuccess == false {
//Display error
}
}
Our service endpoints are currently hard coded in our app. We have multiple environments, dev-test, UAT and Live.
We want to leverage TestFlight for our UAT stage, however this would not be the version we can push live, as the service endpoint within the app would need to be swapped for the Live endpoint.
Is there anyway to provide configuration for your app that can be set to one value in TestFlight, and another in Live?
Actually, there seems to be a way to actually differ Testflight from App Store, at least for the moment:
func isTestflight() -> Bool {
guard let receiptURL = Bundle.main.appStoreReceiptURL else {
return false
}
return receiptURL.lastPathComponent == "sandboxReceipt"
}
Source: https://mobile.twitter.com/kraustifer/status/1090773523860058112
Using SKStoreReviewController for inAppReview takes time until the prompt appears, is there any way to make it show faster ?
Also, submit button is always dimmed, not allowing me to rate, is this because i didn't upload app to appstore yet?
import StoreKit
protocol InAppReviewProtocol {
func requestInAppReview()
}
extension InAppReviewProtocol {
func requestInAppReview() {
if #available(iOS 10.3, *) {
SKStoreReviewController.requestReview()
} else {
// Fallback on earlier versions
if let appStoreLink = URL(string: Constants.shareApp.url) {
UIApplication.shared.openURL(appStoreLink)
}
}
}
}
No, you can not make is faster, the system decides when to show the alert.
Read apple documentation on SKStoreReviewController.requestReview() for more details.
The submit button is disabled as long as you run your app via XCode to prevent you from giving yourself lots of 5-star votings ;)
See below from the apple docs of requestReview method:-
Although you should call this method when it makes sense in the user
experience flow of your app, the actual display of a rating/review
request view is governed by App Store policy. Because this method may or may not present an alert, it's not appropriate to call it in response to a button tap or other user action.
For more details,
go to
this link
So you got the answer for your first question. Your second question is just simple, in development mode you cannot give rating as it makes sense also. You have to publish your app to appStore first and download app from there and can give a review.
Hope it helps you..
I would like to know if a user has previously had the app installed on the same device. Is there some sort of unique id I can check?
You can use shared Keychain to store your AppId and other sensitive informations and fetch on app launch. Deleting the app will not remove/clear data from keychain. You will save and clear data programmatically. Also Apps from same family(developed by same team) only can read data from a shared keychain and data is kept in encrypted form so this is fully secured. You can follow bellow link.
http://evgenii.com/blog/sharing-keychain-in-ios/
User can change identifierForAdvertising any time in Settings, identifierForVendor changes after reinstall app, if no more apps on device from this vendor.
Here is alternative and the best solution for get or persistent, cross-install Device Identifier:
description: https://blog.onliquid.com/persistent-device-unique-identifier-ios-keychain/
code: https://gist.github.com/miguelcma/e8f291e54b025815ca46
You can check that the app is currently available in the iPhone or not from the below code. Here instead of the string "yourappname://", you have to specify the url scheme of that app. You can find the tutorial of the URL Scheme from this link.
Swift code
let appInstalled = UIApplication.shared.canOpenURL(URL(string: "yourappname://"))
if(appInstalled) {
print("It is installed")
}
else
{
print("It is not installed")
}
Objective-C code
BOOL isInstalled = [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:#"yourappname://"]];
if(isInstalled){
NSLog#("It is installed");
}
else{
NSLog#("It is not installed");
}
I am developing a kind of gaming application where I need to handle the following:
`if(user used siri app)
{
// Send notification:1 to server
}
elseif(user attended a call)
{
// Send notification:2 to server
}`
Does it possible to handle above cases inside my app ? Please guide me.
Thanks in Advance.
I am aware of applicationDidEnterBackground which can be used when app is sent to backgound.
But it will be great if I can find abouve cases.
No. This information is not available to an app.