使用 WhatsApp 共享扩展共享文本和媒体
Share text AND media with WhatApp Share Extension
我正在使用 UIActivityViewController
让用户能够分享使用我的应用创建的照片和视频。我在上面附加了两个 UIActivityItemProviders
:一个用于媒体,一个用于使用默认文本 ("Created with...")。
这适用于我测试的所有共享扩展——WhatsApp 除外。 WhatsApp 仅在消息对话框中显示文本——没有照片或视频。但是,当我将文本留空时,它会显示媒体文件。
有什么方法可以通过 WhatsApp 与默认 text/caption 分享照片或视频?
我面临着同样的挑战。我使用 https://github.com/sascha/SSCWhatsAppActivity. The downside is that you'll get two WhatsApp entries when sharing. WhatsApp's own one, and the custom one. I tried excluding WhatsApp's own extension using UIActivityViewController.excludedActivityTypes
with the activityType net.whatsapp.WhatsApp.ShareExtension
but since iOS 8.1 this is not possible anymore (on purpose or a bug). More on that here: http://johnszumski.com/blog/excluding-third-party-apps-from-ios-8-share-sheet
实现了自己的扩展
我的结论是,无法同时向 WhatApp 自己的共享扩展程序提供文本 + 媒体。我决定保留我的自定义 WhatsApp 共享扩展并将其命名为 "WhatsApp (+Image)",以便用户可以区分两者。
我正在使用 UIActivityViewController
让用户能够分享使用我的应用创建的照片和视频。我在上面附加了两个 UIActivityItemProviders
:一个用于媒体,一个用于使用默认文本 ("Created with...")。
这适用于我测试的所有共享扩展——WhatsApp 除外。 WhatsApp 仅在消息对话框中显示文本——没有照片或视频。但是,当我将文本留空时,它会显示媒体文件。
有什么方法可以通过 WhatsApp 与默认 text/caption 分享照片或视频?
我面临着同样的挑战。我使用 https://github.com/sascha/SSCWhatsAppActivity. The downside is that you'll get two WhatsApp entries when sharing. WhatsApp's own one, and the custom one. I tried excluding WhatsApp's own extension using UIActivityViewController.excludedActivityTypes
with the activityType net.whatsapp.WhatsApp.ShareExtension
but since iOS 8.1 this is not possible anymore (on purpose or a bug). More on that here: http://johnszumski.com/blog/excluding-third-party-apps-from-ios-8-share-sheet
我的结论是,无法同时向 WhatApp 自己的共享扩展程序提供文本 + 媒体。我决定保留我的自定义 WhatsApp 共享扩展并将其命名为 "WhatsApp (+Image)",以便用户可以区分两者。