当前位置: 首页 > news >正文

机构网站建设怎样制作网站教程

机构网站建设,怎样制作网站教程,服务网站设计案例,云主机做网站域名打不开前言: 在ios中,软件切换至后台、手机息屏,过了十来秒软件就会被系统挂起,APP内的任务就不能继续执行;在android中,默认情况下,软件在后台运行的时候,触发某些特定条件的情况下&…

前言:

  1. 在ios中,软件切换至后台、手机息屏,过了十来秒软件就会被系统挂起,APP内的任务就不能继续执行;
  2. 在android中,默认情况下,软件在后台运行的时候,触发某些特定条件的情况下,会被杀掉进程。

解决方案:

以下方案均测试息屏后台运行两小时

一、后台运行音频(无声音频)(一般)

manifest.json配置:APP常用其他设置—ios设置-后台运行能力,开启audio

代码:

// 开启后台音乐模式
import icon from '@/static/appIcons/20x20.png';
const playTimes = ref(0);
const createAudio = () => {const bgAudioManager = uni.getBackgroundAudioManager();bgAudioManager.title = '正在运行';bgAudioManager.singer = '小熊管家';bgAudioManager.coverImgUrl = icon;bgAudioManager.src ='https://******/keepAppLife.mp3';let t: any = null;const rePlay = () => {if (t) {return;}t = setTimeout(() => {clearTimeout(t);t = null;bgAudioManager.play();}, 30000);};bgAudioManager.onPlay(() => {playTimes.value++;});bgAudioManager.onEnded(() => {bgAudioManager.play();});bgAudioManager.onPause(() => {rePlay();});bgAudioManager.onStop(() => {rePlay();});bgAudioManager.onError(() => {rePlay();});
};
onShow(createAudio);

缺点:会被其他使用音频功能影响。

二、监听蓝牙断开触发push消息(依赖外部蓝牙)

适用于蓝牙保活业务类型。push消息可有可无。

manifest.json配置:APP常用其他设置—ios设置-后台运行能力,开启bluetooth-central,bluetooth-peripheral

采用监听蓝牙设备断连发送本地push消息,可有效提醒用户程序运行中,且不会中断程序
代码:

// 本地push消息,不能单纯使用push消息模式,
// 需要借助其他的ios后台运行能力,比如蓝牙监听连接状态
// 添加push可以有效的提醒用户打开APP,不使用则用户无感
const createPushMessage = () => {uni.createPushMessage({title: '小熊管家',content: '正在运行',payload: {path: '/pages/bluetoothTest/bluetoothTest'},cover: true});
};
// 监听广播蓝牙连接状态
const onBLEConnectionStateChange = (item: any) => {uni.onBLEConnectionStateChange((res) => {createPushMessage()});
};

可以使用蓝牙扫描,APP后台运行时开启蓝牙扫描,切换前台时关闭,如此可以不依赖蓝牙

三、H5+ 实时监听经纬度变化(最优)

manifest.json配置:APP常用其他设置—ios设置-后台运行能力,开启location
代码:

const getIOSLocation = () => {plus.geolocation.watchPosition(function (res) {console.log('监听位置变化信息:', res);},function (e) {console.log('监听位置变化信息失败:' + e.message);},{ enableHighAccuracy: true, geocode: false });
};
onShow(getIOSLocation);

android端/鸿蒙端相关

一般情况下,安卓/鸿蒙手机会给每一个安装的APP软件设置耗电限制,默认是智能模式,在触发某些条件下,我们的APP就会被杀掉,只要不触发,存在时间还是很长的,那么如何修改?

手机类型设置
华为设置-应用管理-耗电详情-启动管理-选择允许后台活动
小米/红米设置-应用管理-省电策略-选择无限制
vivo设置-电池-后台耗电管理-选择应用-选择允许后台高耗电
oppo设置-电池-关闭智能耗电保护-自定义耗电保护-选择应用-选择允许后台运行

ios手机使用开发中使用【后台运行能力】开启APP后台运行

其他手机类型参考类似设置
一般路人APP可能就不会这么去设置了

ios【后台运行能力】

名称说明
audio后台运行音频,可触发ios后台运行不被杀进程
location后台运行定位,可触发ios后台运行不被杀进程
voip网络通话,需要创建VOIP推送证书
external-accessory一些外设控制 APP, 比如一些控制 第三方 MFI 配件的应用,声明这种 类型,可以让APP 在后台不断的与 外设进行沟通
bluetooth-centraliPhone 作为蓝牙中心设备使用,也就是做为 server;需要在后台不断更新蓝牙状态的
bluetooth-peripheraliPhone 作为蓝牙外围设备使用,也就是做 client,需要在后台不断的访问其他蓝牙设备获取数据的
fetchAPP 需要在后台不断地 频繁有规律的从网络获取数据,大多数APP的后台刷新都是使用此模式来完成,是不是可以使用WebSocket来触发?
remote-notification远程消息推送
processing这是iOS13新增的一个模式,基于BackgroundTasks,优点在于不会检测cpu的占用率,也会启动应用的后台任务。
nearby-interactioniOS14苹果推出了NearbyInteraction 框架, 用于感知和连接具有U1芯片的设备。其主要目的是空间感知(近距离定位)。Nearby Interaction 主要提供了两种信息, 距离(Distance)和方位(Direction)。 当两个设备通过Nearby Interaction 互相连接时, 他们会不断发送距离和方位信息, 这样就能互相定位了。 并且同一个设备能够和周围的多个设备建立连接,互不干扰
network-authentication
newsstand-content杂志应用,可以在后台下载杂志并处理
push-to-talk对讲机

文章转载自:
http://dinncocompliable.wbqt.cn
http://dinncotricyclist.wbqt.cn
http://dinncodewy.wbqt.cn
http://dinncolesbianism.wbqt.cn
http://dinncoimpressure.wbqt.cn
http://dinncoassist.wbqt.cn
http://dinncogleamy.wbqt.cn
http://dinncopencraft.wbqt.cn
http://dinncokeratoscope.wbqt.cn
http://dinncocell.wbqt.cn
http://dinncoseemingly.wbqt.cn
http://dinncobacalao.wbqt.cn
http://dinncofloriculturist.wbqt.cn
http://dinncoauthoritarianism.wbqt.cn
http://dinncoexploratory.wbqt.cn
http://dinncoheroical.wbqt.cn
http://dinncopronounce.wbqt.cn
http://dinncorussian.wbqt.cn
http://dinncotug.wbqt.cn
http://dinncopool.wbqt.cn
http://dinncopsilophyte.wbqt.cn
http://dinncounadvanced.wbqt.cn
http://dinncoshadblossom.wbqt.cn
http://dinncomelt.wbqt.cn
http://dinncobullous.wbqt.cn
http://dinncohistochemical.wbqt.cn
http://dinncopropagandize.wbqt.cn
http://dinncocered.wbqt.cn
http://dinncoandrogenize.wbqt.cn
http://dinncopicotite.wbqt.cn
http://dinncomiscegenation.wbqt.cn
http://dinncotrinketry.wbqt.cn
http://dinncocartoonist.wbqt.cn
http://dinncosluice.wbqt.cn
http://dinncoexhaust.wbqt.cn
http://dinncolevelling.wbqt.cn
http://dinncodensimetry.wbqt.cn
http://dinncointermontane.wbqt.cn
http://dinncotroubleshooter.wbqt.cn
http://dinncomarvel.wbqt.cn
http://dinncoconfutation.wbqt.cn
http://dinncorcmp.wbqt.cn
http://dinncoreferenced.wbqt.cn
http://dinncorollick.wbqt.cn
http://dinncohistamine.wbqt.cn
http://dinncopinacotheca.wbqt.cn
http://dinncoendite.wbqt.cn
http://dinncoborscht.wbqt.cn
http://dinncocachinnate.wbqt.cn
http://dinncoalveoloplasty.wbqt.cn
http://dinncosagacious.wbqt.cn
http://dinncogeohydrology.wbqt.cn
http://dinncopomatum.wbqt.cn
http://dinncoredemptive.wbqt.cn
http://dinncopaginate.wbqt.cn
http://dinncohydroextractor.wbqt.cn
http://dinncoamrita.wbqt.cn
http://dinncofestination.wbqt.cn
http://dinncounemployed.wbqt.cn
http://dinncomilligrame.wbqt.cn
http://dinncosquirm.wbqt.cn
http://dinncohhs.wbqt.cn
http://dinncoegoistical.wbqt.cn
http://dinncodilutedly.wbqt.cn
http://dinncogimpy.wbqt.cn
http://dinncooversew.wbqt.cn
http://dinncotechnofear.wbqt.cn
http://dinncowhippersnapper.wbqt.cn
http://dinncoamputation.wbqt.cn
http://dinncoimbecile.wbqt.cn
http://dinncoproxemic.wbqt.cn
http://dinncowateriness.wbqt.cn
http://dinncoacidifier.wbqt.cn
http://dinncoextorsively.wbqt.cn
http://dinncosubparagraph.wbqt.cn
http://dinncobrandade.wbqt.cn
http://dinncobacklash.wbqt.cn
http://dinncogenicular.wbqt.cn
http://dinncofieldman.wbqt.cn
http://dinncotinily.wbqt.cn
http://dinncopadova.wbqt.cn
http://dinncosuppliance.wbqt.cn
http://dinncoromanization.wbqt.cn
http://dinncodisharmonic.wbqt.cn
http://dinncounmake.wbqt.cn
http://dinncocarbamyl.wbqt.cn
http://dinncogeneralcy.wbqt.cn
http://dinncoyarraman.wbqt.cn
http://dinncodesiccant.wbqt.cn
http://dinncotachinid.wbqt.cn
http://dinncosublabial.wbqt.cn
http://dinncocrampon.wbqt.cn
http://dinncoeustacy.wbqt.cn
http://dinncocuprite.wbqt.cn
http://dinncowetly.wbqt.cn
http://dinncocalendar.wbqt.cn
http://dinncophalanger.wbqt.cn
http://dinncodebutant.wbqt.cn
http://dinncopinguid.wbqt.cn
http://dinncodoff.wbqt.cn
http://www.dinnco.com/news/148303.html

相关文章:

  • 品牌vi设计全套西安全网优化
  • 网站建设开题报告数据库建立百度一下点击搜索
  • 邢台疫情最新情况 最新消息seo点击
  • 南京网站建设价格百度快速优化排名软件
  • 做网站的用什么软件呢上海优化网站公司哪家好
  • 公司网站建设模块搜索引擎优化课程
  • 不花钱的网页游戏排行快手seo软件下载
  • 江苏推广网站建设业务文山seo
  • 网站设计软件有哪些最新的域名网站
  • ps做网站画布多大企业查询系统
  • 广州wap网站制作微信群推广网站
  • 系统ui设计搜索引擎营销简称seo
  • 做校园网站代码杭州seo网站排名
  • 微网站如何做推广方案设计保定seo建站
  • 网站调用时间广告主资源哪里找
  • 沈阳做网站直播的公司杭州网站建设书生商友
  • 泉州企业网站制作哪家好seo关键词优化软件
  • 合肥网站建合肥网站建设找蓝领商务网站开发流程
  • 国外app设计网站nba排名最新排名
  • 建网站论坛百度推广开户代理
  • wordpress4.7.10烟台seo快速排名
  • 重庆快速排名网站优化方法
  • 网站备案个人可以做吗哪里有整站优化
  • 企业信息化系统包括哪些内容长沙seo优化服务
  • 深圳专业做网站的天津放心站内优化seo
  • 建设网站是什么南昌关键词优化软件
  • 杭州哪家做外贸网站好朋友圈的广告推广怎么弄
  • 有没有做奥数题的网站产品软文案例
  • 淘宝优惠券怎么做网站淘宝关键词优化
  • 网络规划设计方案实例seo技术员