美文网首页
如何获取iOS的App安装时间

如何获取iOS的App安装时间

作者: Codepgq | 来源:发表于2020-08-03 15:43 被阅读0次
      NSURL* urlToDocumentsFolder = [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];
        __autoreleasing NSError *error;
        NSDate *installDate = [[[NSFileManager defaultManager] attributesOfItemAtPath:urlToDocumentsFolder.path error:&error] objectForKey:NSFileCreationDate];
    
        NSLog(@"This app was installed by the user on %@ %f", installDate, [installDate timeIntervalSince1970]);
    

    相关文章

      网友评论

          本文标题:如何获取iOS的App安装时间

          本文链接:https://www.haomeiwen.com/subject/dkxbrktx.html