OpenHarmony开发者论坛

标题: swiper loop属性如何生效? [打印本页]

作者: 汐之蓝    时间: 2023-9-12 11:06
标题: swiper loop属性如何生效?
[md]【运行环境】

硬件:rk3568;  ROM: 3.2  ;  API 9
[/md]
作者: 星辰大海    时间: 2023-9-13 15:36
[md]通过配置Notification.publish发布通知接口的参数NotificationRequest中wantAgent属性实现

```
import notificationManager from '@ohos.notificationManager';

import WantAgent from '@ohos.app.ability.wantAgent';


async function publishNotification() {

  let wantAgentInfo = {

    wants: [

      {

        bundleName: "com.example.webuseragent", // 自己应用的bundleName

        abilityName: "EntryAbility",

      }

    ],

    operationType: WantAgent.OperationType.START\_ABILITIES,

    requestCode: 1,

  }

  const wantAgent = await WantAgent.getWantAgent(wantAgentInfo)

  let contentType = notificationManager.ContentType.NOTIFICATION\_CONTENT\_BASIC\_TEXT;

  await notificationManager.publish({

    content: {

      contentType: contentType,

      normal: {

        title: "测试标题",

        text: "测试内容",

      }

    },

    id: 1,

    wantAgent: wantAgent

  })

}
```

[/md]




欢迎光临 OpenHarmony开发者论坛 (https://forums.openharmony.cn/) Powered by Discuz! X3.5