美文网首页
iOS应用版本更新(自动提醒用户更新代码)

iOS应用版本更新(自动提醒用户更新代码)

作者: Mn_Su | 来源:发表于2016-09-23 13:28 被阅读0次

不建议使用,使用应用版本更新功能提交App Store会被拒!

一.在#import "AppDelegate.h" 文件中的application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 方法中调用检测结果


Enter your image description here:

二. 获得发布版本的Version


Enter your image description here:

三.比较当前版本与新上线版本做比较


Enter your image description here:

四.UIAlertView代理方法


Enter your image description here:

获取设备或APP信息

    //返回应用程序名称
    +(NSString *) getAppName{
        NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
        return [infoDictionary objectForKey:@"CFBundleDisplayName"];
    }
    //返回应用版本号
    +(NSString *) getAppVersion{
        NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
        return [infoDictionary objectForKey:@"CFBundleShortVersionString"];
    }
    +(NSString *) getAppBundleVersion{
        NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
        return [infoDictionary objectForKey:@"CFBundleVersion"];
    }
    //设备型号
    +(NSString *) getSystemName{
        return [[UIDevice currentDevice] systemName];
    }
    //设备版本号
    +(NSString *) getSystemVersion{
        return [[UIDevice currentDevice] systemVersion];
    }

相关文章

网友评论

      本文标题:iOS应用版本更新(自动提醒用户更新代码)

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