本文介绍了如何确定iOS设备上是否安装了Dropbox?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用使用Dropbox允许用户备份其核心数据存储。有没有办法以编程方式确定Dropbox应用程序是否已安装,所以我可以提示用户设置备份?我不想让那些不使用Dropbox的用户感到烦恼,但我想尝试让尽可能多的用户使用备份。

My app uses Dropbox to allow users to make backups of their core data store. Is there a way to determine programmatically if the Dropbox app has been installed, so I can prompt users to set up the backup? I don't want to bug users who don't use Dropbox, but I want to try to get as many users to use backups as possible.

推荐答案

Dropbox定义了自己的URI方案, dbapi-1 ,因此您可以看到操作系统是否可以使用该方案打开URL,如下所示: / p>

Dropbox define their own URI scheme, dbapi-1, and as such you can see if the OS can open URLs using that scheme, as so:

if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"dbapi-1://"]]) {
    NSLog(@"Dropbox is installed.");
} else {
    NSLog(@"Dropbox is not installed.");
}

这篇关于如何确定iOS设备上是否安装了Dropbox?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 09:24