ios - 确定以前安装的应用程序

标签 ios xamarin.ios app-store auto-update

我在 App Store 上有一个应用程序,我想做一些不会影响以前下载我的应用程序的用户的更改。

有没有办法确定用户之前是否下载过我的应用?

最佳答案

万一有人还在想,这个问题的一个很好的解决方案(假设您还没有)是使用钥匙串(keychain),它会在应用程序安装/卸载过程中持续存在。该库允许您使用类似 NSDictionary 的语法访问钥匙串(keychain)。

https://github.com/nicklockwood/FXKeychain

所以你可以实现这样的功能:

-(BOOL)alreadyInstalled
{
NSString *installDate = [[FXKeychain defaultKeychain] objectForKey:@"InstallDate"];
if (!installDate)
{
    NSString *newInstallDate = [NSString stringWithFormat:@"%i", [[NSDate date] timeIntervalSince1970]];
    [[FXKeychain defaultKeychain] setObject:newInstallDate forKey:@"InstallDate"]
    return NO;
}
return YES;
}

关于ios - 确定以前安装的应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9323068/

相关文章:

ios - 如何从 Xamarin IOS 获取唯一的 DeviceID

ios - iTunesConnect中已经有Pending Developer Release版本时,如何提交新版本?

所有国家/语言的 ios 本地化?

c# - 在 MonoTouch 中获取没有 UI 的 iOS 屏幕分辨率

ios - Swift - 如何获取 UITableview 中选定行的数值

ios - UITextView 提前断线

ios - 在 iOS SDK (Swift 3.0) 中,使用 "queryOrdered/queryEqual"的 Firebase 数据库查询未按预期工作

uiwebview - monotouch uiwebview 找不到本地 html

ios - ITMS-90809 : Deprecated API Usage - existing app that use UIWebView are no longer accepted

ios - 更新 UILabel 值作为 CAShapeLayer 动画