![](/img/trans.png)
[英]Running an application through xcode on my device while I already have the app downloaded from the AppStore
[英]How do I determine that my app was just downloaded from AppStore the first time?
這是在我的應用程序中完成的方式:
如何確定該應用程序正在運行,但是首次從AppStore下載?
我可以做什么,但我沒有:
由於您沒有非應用程序端來區分用戶,因此您所說的“鑰匙串”是您唯一的應用程序持久性選項,它將在應用程序卸載后繼續存在。 只有將設備重置為出廠設置才能將其刪除。
您可以使用NSUserDefaults。 如果appDelegate.m-> didFinishLaunchingWithOptions使用此代碼:
NSUserDefaults * userDefaults = [NSUserDefaults standardUserDefaults];
if([userDefaults objectForKey:@"first_time"] == nil){
[userDefaults setObject:@"1" forKey:@"first_time"];
//do whatever you need
}
安裝后,此條件只能滿足一次。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.