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

asp影楼网站设计怎么找专业的营销团队

asp影楼网站设计,怎么找专业的营销团队,北京上海网站建设,wordpress微信付款后查看意图通知 获取router事件中传递参数并跳转 目前点击通知消息打开应用的指定页面,通过为通知添加行为意图的方式。也就是在wants的parameters中设置自定义参数,然后在UIAbility的onNewWant或者onCreate方法中 解析配置的自定义参数信息判断跳转不同页面&a…

意图通知
获取router事件中传递参数并跳转
目前点击通知消息打开应用的指定页面,通过为通知添加行为意图的方式。也就是在wants的parameters中设置自定义参数,然后在UIAbility的onNewWant或者onCreate方法中 解析配置的自定义参数信息判断跳转不同页面,参考文档:
https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/notification-with-wantagent-V5
在UIAbility根据传递的params不同,选择拉起不同的页面可参考:
https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/arkts-ui-widget-event-router-V5

import { NavBar } from '../component/NavBar';
import { notificationManager } from '@kit.NotificationKit';
import { common, wantAgent } from '@kit.AbilityKit';
import { hilog } from '@kit.PerformanceAnalysisKit';
import { BusinessError } from '@kit.BasicServicesKit';@Component
@Entry
struct DemoNotification {@State TAG: string = '[PublishOperation]';@State DOMAIN_NUMBER: number = 0xFF00;@State wantAgentInfo: wantAgent.WantAgentInfo = {wants: [{bundleName: "com.example.yumi",abilityName: "EntryAbility"}],operationType: wantAgent.OperationType.START_ABILITY,requestCode: 100};onPageShow(): void {// 请求通知授权let context = getContext(this) as common.UIAbilityContext;notificationManager.isNotificationEnabled().then((data: boolean) => {hilog.info(this.DOMAIN_NUMBER, this.TAG, "isNotificationEnabled success, data: " + JSON.stringify(data));if (!data) {notificationManager.requestEnableNotification(context).then(() => {hilog.info(this.DOMAIN_NUMBER, this.TAG, `[ANS] requestEnableNotification success`);}).catch((err: BusinessError) => {if (1600004 == err.code) {hilog.error(this.DOMAIN_NUMBER, this.TAG,`[ANS] requestEnableNotification refused, code is ${err.code}, message is ${err.message}`);} else {hilog.error(this.DOMAIN_NUMBER, this.TAG,`[ANS] requestEnableNotification failed, code is ${err.code}, message is ${err.message}`);}});}}).catch((err: BusinessError) => {hilog.error(this.DOMAIN_NUMBER, this.TAG,`isNotificationEnabled fail, code is ${err.code}, message is ${err.message}`);});// 通知角标let badgeNumber: number = 10;notificationManager.setBadgeNumber(badgeNumber).then(() => {hilog.info(this.DOMAIN_NUMBER, this.TAG, `setBadgeNumber 10 success.`);badgeNumber = 11;notificationManager.setBadgeNumber(badgeNumber).then(() => {hilog.info(this.DOMAIN_NUMBER, this.TAG, `setBadgeNumber 11 success.`);});});}publishNotification() {let notificationRequest: notificationManager.NotificationRequest = {// 描述通知的请求id: 1, // 通知IDcontent: {// 通知内容notificationContentType: notificationManager.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, // 普通文本类型通知normal: {// 基本类型通知内容title: '通知内容标题',text: '通知内容详情'}}}// addslot回调let addSlotCallBack = (err: BusinessError): void => {if (err) {hilog.info(this.DOMAIN_NUMBER, this.TAG, `addSlot failed, code is ${err.code}, message is ${err.message}`);} else {hilog.info(this.DOMAIN_NUMBER, this.TAG, `addSlot success`);}}notificationManager.addSlot(notificationManager.SlotType.SOCIAL_COMMUNICATION, addSlotCallBack);notificationManager.publish(notificationRequest).then(() => { // 发布通知console.info('publish success');}).catch((err: Error) => {console.error(`publish failed,message is ${err}`);});}async publishNotificationWant() {let wantAgentInfo: wantAgent.WantAgentInfo = {wants: [{bundleName: "com.example.yumi", // 自己应用的bundleNameabilityName: "EntryAbility",parameters: { page: 'view/Car' } // 自己点击通知需要跳转的页面}],operationType: wantAgent.OperationType.START_ABILITIES,requestCode: 1,}const wantAgentObj = await wantAgent.getWantAgent(wantAgentInfo)await notificationManager.publish({content: {notificationContentType: notificationManager.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,normal: {title: "测试标题",text: "测试内容",}},id: 1,wantAgent: wantAgentObj})}build() {Column() {NavBar({ title: '通知' })Button('发送文本类型通知').onClick(() => {this.publishNotification()})Button('发送通知-为通知添加行为意图').onClick(() => {this.publishNotificationWant()})}}
}
import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit';
import { hilog } from '@kit.PerformanceAnalysisKit';
import { router, Router, window } from '@kit.ArkUI';
import { DialogHelper } from '@pura/harmony-dialog';
import { AppUtil } from '@pura/harmony-utils'export default class EntryAbility extends UIAbility {onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate');AppUtil.init(this.context)}onDestroy(): void {hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy');}onWindowStageCreate(windowStage: window.WindowStage): void {// Main window is created, set main page for this abilityhilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate');windowStage.loadContent('pages/Splash')}onWindowStageDestroy(): void {// Main window is destroyed, release UI related resourceshilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy');}onForeground(): void {// Ability has brought to foregroundhilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground');}onBackground(): void {// Ability has back to backgroundhilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground');}onNewWant(want: Want, launchParam: AbilityConstant.LaunchParam): void {hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onNewWant');//点击Notification通知并打开App的具体页面let page = want?.parameters?.page  as stringrouter.pushUrl({url: page})console.log('want参数'+want?.parameters?.page)}
}
http://www.dinnco.com/news/62699.html

相关文章:

  • 网站开发的项目开发宁波seo公司
  • 网站flash banner中国职业培训在线
  • 山东做网站找谁手机网站seo免费软件
  • 网站建好了怎么做淘宝客基本seo
  • 大丰建站谷歌排名算法
  • 百色网站优化短视频搜索优化
  • 企业建设网站好吗搜索引擎优化seo应用
  • 怎么开一个做网站的工作室品牌服务推广
  • 中国建设银行网站-诚聘英才seo网站优化方法
  • 代理注册公司行情上海做seo的公司
  • 电商公司做网站网站优化的方法与技巧
  • 网上赚钱的门路石家庄seo优化公司
  • 域名网站空间友链交换不限内容
  • 最火的网页游戏排行榜西安网络推广seo0515
  • 大连云建站模板登封搜索引擎优化
  • html购物网站模板怎么制作网站
  • 做ppt音乐模板下载网站建网站需要多少钱
  • 做网站的公司多吗怎么做好seo内容优化
  • wordpress 切换语言seo推广思路
  • 保山企业网站建设国内网络营销公司排名
  • 代网站备案费用吗每日英语新闻
  • 承德很好的网络建站凡科网免费建站
  • 河北网站建设与管理网站搭建需要多少钱
  • 品质好的女装品牌seo技巧seo排名优化
  • 上海做网站那家公司好关键词如何优化排名
  • 蔬菜派送网站怎么做分销系统
  • 沈阳工程信息招标网北京seo外包公司要靠谱的
  • 党支部网站建设制度平面设计培训班学费一般多少
  • 网站开发 公司简介黄页88网推广服务
  • 奶茶加盟 技术支持 东莞网站建设超级软文