iOS小技能:快速创建OEM项目app

这是我参与11月更文挑战的第29天,活动详情查看:2021最后一次更文挑战

引言

贴牌生产(英语:Original Equipment Manufacturer, OEM)

因采购方可提供品牌和授权,允许制造方生产贴有该品牌的产品,所以俗称“贴牌生产”。

需求背景: SAAS平台级应用系统为一个特大商户,提供专属OEM项目,在原有通用app的基础上进行定制化开发

例如去掉开屏广告,删除部分模块,保留核心模块。更换专属app icon以及主题色

I 上架资料

  1. 用户协议及隐私政策
  2. App版本、 审核测试账号信息
  3. icon、名称、套装 ID(bundle identifier)
  4. 关键词:
  5. app描述:
  6. 技术支持网址使用:

kunnan.blog.csdn.net/article/det…

II 开发小细节

  1. 更换基础配置信息,比如消息推送证书、第三方SDK的ApiKey、启动图、用户协议及隐私政策。
  2. 接口修改:比如登录接口新增SysId请求字段用于区分新旧版、修改域名(备案信息)
  3. 废弃开屏广告pod 'GDTMobSDK' ,'4.13.26'

1.1 更换高德定位SDK的apiKey

    NSString *AMapKey = @"";
    [AMapServices sharedServices].apiKey = AMapKey;

复制代码

1.2 更新消息推送证书和极光的appKey

  1. Mac 上的“钥匙串访问”创建证书签名请求 (CSR)

a. 启动位于 /Applications/Utilities 中的“钥匙串访问”。

b. 选取“钥匙串访问”>“证书助理”>“从证书颁发机构请求证书”。

c. 在“证书助理”对话框中,在“用户电子邮件地址”栏位中输入电子邮件地址。

d. 在“常用名称”栏位中,输入密钥的名称 (例如,Gita Kumar Dev Key)。

e. 将“CA 电子邮件地址”栏位留空。

f. 选取“存储到磁盘”,然后点按“继续”。

help.apple.com/developer-a…

在这里插入图片描述

  1. 从developer.apple.com 后台找到对应的Identifiers创建消息推送证书,并双击aps.cer安装到本地Mac,然后从钥匙串导出P12的正式上传到极光后台。

docs.jiguang.cn//jpush/clie…在这里插入图片描述

  1. 更换appKey(极光平台应用的唯一标识)
        [JPUSHService setupWithOption:launchOptions appKey:@""
                              channel:@"App Store"
                     apsForProduction:YES
                advertisingIdentifier:nil];

复制代码

www.jiguang.cn/accounts/lo…

1.3 更换Bugly的APPId

    [Bugly startWithAppId:@""];//异常上报

复制代码

1.4 app启动的新版本提示

更换appid

    [self checkTheVersionWithappid:@""];

复制代码

检查版本

在这里插入图片描述


- (void)checkTheVersionWithappid:(NSString*)appid{


    [QCTNetworkHelper getWithUrl:[NSString stringWithFormat:@"http://itunes.apple.com/cn/lookup?id=%@",appid] params:nil successBlock:^(NSDictionary *result) {
        if ([[result objectForKey:@"results"] isKindOfClass:[NSArray class]]) {
            NSArray *tempArr = [result objectForKey:@"results"];
            if (tempArr.count) {
                
                
                NSString *versionStr =[[tempArr objectAtIndex:0] valueForKey:@"version"];
                NSString *appStoreVersion = [versionStr stringByReplacingOccurrencesOfString:@"." withString:@""] ;
                if (appStoreVersion.length==2) {
                    appStoreVersion  = [appStoreVersion stringByAppendingString:@"0"];
                }else if (appStoreVersion.length==1){
                    appStoreVersion  = [appStoreVersion stringByAppendingString:@"00"];
                }

                NSDictionary *infoDic=[[NSBundle mainBundle] infoDictionary];
                NSString* currentVersion = [[infoDic valueForKey:@"CFBundleShortVersionString"] stringByReplacingOccurrencesOfString:@"." withString:@""];
                
                currentVersion = [currentVersion stringByReplacingOccurrencesOfString:@"." withString:@""];
                if (currentVersion.length==2) {
                    currentVersion  = [currentVersion stringByAppendingString:@"0"];
                }else if (currentVersion.length==1){
                    currentVersion  = [currentVersion stringByAppendingString:@"00"];
                }



                NSLog(@"currentVersion: %@",currentVersion);
                
                
                if([self compareVesionWithServerVersion:versionStr]){

                
                    
                    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:[NSString stringWithFormat:@"%@%@",QCTLocal(@"Discover_a_new_version"),versionStr] message:QCTLocal(@"Whethertoupdate") preferredStyle:UIAlertControllerStyleAlert];
                    //                "Illtalkaboutitlater"= "稍后再说";
                    //                "Update now" = "立即去更新";
                    //                "Unupdate"= "取消更新";

                    [alertController addAction:[UIAlertAction actionWithTitle:QCTLocal(@"Illtalkaboutitlater") style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
                        NSLog(@"取消更新");
                    }]];
                    [alertController addAction:[UIAlertAction actionWithTitle:QCTLocal(@"Updatenow") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
                        NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"itms-apps://itunes.apple.com/app/id%@",appid]];
                        if (@available(iOS 10.0, *)) {
                            [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:^(BOOL success) {
                            }];
                        } else {
                            // Fallback on earlier vesions
                            [[UIApplication sharedApplication] openURL:url];
                        }
                    }]];
                    [[QCT_Common getCurrentVC] presentViewController:alertController animated:YES completion:nil];
                }
            }
        }
    } failureBlock:^(NSError *error) {
        NSLog(@"检查版本错误: %@",error);
    }];
}

复制代码

see also

更多内容请关注 #小程序:iOS逆向,只为你呈现有价值的信息,专注于移动端技术研究领域;更多服务和咨询请关注#公众号:iOS逆向

猜你喜欢

转载自juejin.im/post/7035926626366029837