gpt4 book ai didi

deep-linking - KaiOS - 使用 WhatsApp 分享

转载 作者:行者123 更新时间:2023-12-03 16:37:20 36 4
gpt4 key购买 nike

我正在尝试为 KaiOS 开发一个应用程序,我想在其中与 WhatsApp 共享文本消息。
我试过 deep-links喜欢:

  • app://whatsapp/send
  • whatsapp://send

  • 两者都不起作用。
    有谁知道如何与 WhatsApp 分享内容?

    最佳答案

    您需要使用 Web Activities API .
    为 WhatsApp 定义的事件
    WhatsApp 暴露了两个主要事件:

  • share
  • view

  • 见WhatsApp的 manifest.webapp :
      "activities": {
    "share": {
    "href": "/notification.html",
    "filters": {
    "type": [
    "video/*",
    "image/*",
    "text/vcard",
    "text/plain"
    ]
    }
    },
    "view": {
    "href": "/notification.html",
    "filters": {
    "type": "url",
    "url": {
    "required": true,
    "pattern": "^https://(?:chat\\.whatsapp\\.com/(?:invite/)?[0-9A-Za-z]+|wa\\.me/[0-9]+(?:\\?text=.*)?)$",
    "patternFlags": "i",
    "regexp": "^https://(?:chat\\.whatsapp\\.com/(?:invite/)?[0-9A-Za-z]+|wa\\.me/[0-9]+(?:\\?text=.*)?)$"
    }
    }
    },
    }
    使用事件分享
    要使用 WhatsApp 分享短信,您可以实例化 MozActivity 使用预定义的事件名称。
    像这样的东西应该可以在应用程序或网络上下文中工作。
    var pick = new MozActivity({
    name: "share",
    data: {
    type: "text/plain",
    blobs: [ "This is a message to share via WhatsApp" ]
    }
    });

    关于deep-linking - KaiOS - 使用 WhatsApp 分享,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59840271/

    36 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com