uniapp-开发APP端(踩坑、调试打包)

创建项目

【HBuilderX】-【文件】-【新建】-【项目】

运行调试

真机运行

https://uniapp.dcloud.net.cn/tutorial/run/run-app.html

模拟器运行

https://uniapp.dcloud.net.cn/tutorial/run/installSimulator.html

APK打包

说明

离线打包参考官网,以下仅说明云打包

【发行】-【原生APP-云打包】
无证书:使用公共测试证书进行打包
有证书:填入包名、别名、密钥、证书文件

生成证书

Andriod: https://ask.dcloud.net.cn/article/35777
IOS:https://ask.dcloud.net.cn/article/152

多端登录授权

说明

网址详见:https://uniapp.dcloud.net.cn/tutorial/app-oauth.html
HTML5的API详见:https://www.html5plus.org/doc/zh_cn/oauth.html#plus.oauth.AuthOptions

微信授权流程

准备:微信开放平台账号、应用运行流程图、icon(2828、108108)、获取安卓签名(需要有证书,APK打包安装到手机,在网页最下方解压文件,安装到手机,输入包名,获取签名)
网址详见:https://uniapp.dcloud.net.cn/tutorial/app-oauth-weixin.html

微信开发文档:https://developers.weixin.qq.com/doc/oplatform/Mobile_App/WeChat_Login/Development_Guide.html

UNIAPP踩坑指南

  1. 安卓uni.showModal模态弹窗样式难看?
    解决:手撕一个插件https://ext.dcloud.net.cn/plugin?id=17678

    拓展问题:

    • 内容自适应高度?
    • 路由跳转自动关闭弹窗?
      解决:安卓监听返回plus.key.addEventListener('backbutton', this.handleBackButton)
    • ios侧滑关闭弹窗不会自动关闭?
      解决:添加ios侧滑监听事件currentPage.addEventListener('popGesture', this.handleBackButton)currentPage获取参考文档事件监听参考文档
  2. 使用uni.scanCode时发现无法限制条码类型,使用scanType实际还是能扫出来其他的码?
    解决:手撕一个插件https://ext.dcloud.net.cn/plugin?id=17679

    拓展问题:

    • 使用plus.webview.create创建webview,使用plus.barcode.create创建barcode后,点击扫码将卡顿1s后再进入?
      解决: 可以用setTimeout异步调用创建barcode
    • ios点击返回按钮会返回上上层?
      解决:将titleNView中的autoBackButton设为false,再在buttons中添加返回按钮,自定义事件
    • ios关闭webview时,上层页面会跳转两次?
      解决:在扫码关闭后先不调用webview.close()事件,改为调用webview.hide()事件,同时监听hide事件,参考如下:
    webView.addEventListener('hide', () => {
    		// 此处异步,避免快速连续跳转,可能会页面白屏
    		setTimeout(() => {
    			this.webView.close()
    		}, 80)
    	})
    

IOS踩坑指南

  1. scroll-view滑动时,页面短暂白屏,经查看应该设置scroll-into-view这个属性导致的
    解决:动态绑定scroll-Y,在设置前禁止滚动,设置后再开启滚动,类似如下:
scrollY.value = false;
nextTick(() => {
	scrollIntoView.value = `...`;
	scrollY.value = true;
});

2. scroll-view中使用fixed布局无法穿透的问题,在H5和安卓都是正常的,但是在ios真机中,嵌套的fixed组件会被父组件遮挡,且设置z-index无效。
解决:在社区能看到开发者说因为scroll-view设置了-webkit-overflow-scrolling: touch,那么设置如下即可:

.uni-scroll-view {
	-webkit-overflow-scrolling: auto;
}

IOS 发布

登录

https://appstoreconnect.apple.com/

准备(以下为必填项)

  • iosApp
    1. 各个尺寸屏幕图(可以是示例图,而非真实截图)

      • 生成ios各个尺寸图可以用uniapp先运行到浏览器,f12打开控制台,改成移动端模式,并调整上方尺寸。(5.5英寸为310*552、6.5英寸为310*672
        此时,在控制台ctrl+shift+p,输入capture,点击capture full size screenshot
        在这里插入图片描述
        截图成功后,用windows画图工具打开,调整大小。
        在这里插入图片描述
        此时看下面的尺寸对不对,高度稍高就裁剪一下即可。
        在这里插入图片描述
    2. 描述、 关键词、技术支持网址、版本、版权

    3. 如果需要登录则提供登录信息、联系信息

  • App信息
    1. 名称
    2. 类别、内容版权、年龄分级
  • App隐私
    1. 隐私政策网址
    2. 如果使用uniapp并勾选了IDFA,需设置产品隐私,参考https://uniapp.dcloud.net.cn/tutorial/app-ios-idfa.html
  • 价格与销售范围
    1. 设置价格

分发TestFlight

TestFlight测试分为两种形式:内部测试外部测试
建立群组后可以添加构建版本,添加测试员。

内部群组

这里建议对内部人员勾选自动分发。
在这里插入图片描述
测试员必须为团队人员,如果非团队人员,要在【用户和访问】中进行添加。添加后团队成员会受到邮箱,接受邀请后即成为团队成员。此时再回到这里邀请即可。

外部群组

建立群组后,添加构建版本,此时构建版本需要审核(一天左右),审核通过以后会有公开链接,再设置下测试员数量。
在这里插入图片描述
添加新测试员可以不为团队成员,直接填写电子邮件即可,或者直接将公开链接发送给测试人。测试者将会收到邀请,并在TestFlight获取该测试版本。
之后每次在这个群组增加新的构建版本时,他们都会再次收到消息,不需要再手动分发。

审核被拒参考原因

2.1.0 Performance: App Completeness

Issue Description

The app exhibited one or more bugs that would negatively impact App Store users.

Bug description: error message showing after tap on photo.


Review device details:

- Device type: iPad (8th generation) 
- OS version: iOS 17.4.1

Next Steps

Test the app on supported devices to identify and resolve bugs and stability issues before submitting for review.

If you are unable to reproduce the bug, try the following:

- For new apps, uninstall all previous versions of your app from a device, then install and follow the steps to reproduce.
- For app updates, install the new version as an update to the previous version, then follow the steps to reproduce.

此处是因为使用了相册模块,但打包并未勾选。可在manifest.json里调整
在这里插入图片描述

5.1.1 - Legal - Privacy - Data Collection and Storage

Issue Description

One or more purpose strings in the app do not sufficiently explain the use of protected resources. Purpose strings must clearly and completely describe the app's use of data and, in most cases, provide an example of how the data will be used.

Examples of unclear purpose strings:

- "App would like to access your Contacts"
- "App needs microphone access"

Next Steps

Update the camera purpose string to explain how the app will use the requested information and provide an example of how the data will be used. See the attached screenshot.

此处是因为未明确写明各个隐私权限使用原因,可在manifest.json里调整。
在这里插入图片描述

  • 3
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值