我正在使用UIActivityViewController
并在通过Whatsapp发送图片后,我在控制台收到此消息 -
plugin net.whatsapp.WhatsApp.ShareExtension invalidated
为什么此消息会显示在日志中?
jaba编辑 -
我使用的是iOS 9.2,Swift,Xcode 7.2。
但我(oz)正在使用Xcode 6.4,objective-c,iOS 8
答案 0 :(得分:0)
WhatsApp已更新政策,不允许与图片,网址或文档共享简单文字。
您可以这样发送图片:
NSMutableArray *activityItems= [NSMutableArray arrayWithObjects:img, nil];
UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:nil];
activityViewController.excludedActivityTypes = @[UIActivityTypePostToWeibo,UIActivityTypePrint, UIActivityTypeCopyToPasteboard,UIActivityTypeAssignToContact, UIActivityTypeSaveToCameraRoll,UIActivityTypeAddToReadingList, UIActivityTypePostToFlickr,UIActivityTypePostToVimeo, UIActivityTypePostToTencentWeibo,UIActivityTypeAirDrop];
[self presentViewController:activityViewController animated:YES completion:nil];
您还需要在iOS9的Plist文件中设置权限
<key>LSApplicationQueriesSchemes</key>
<array>
<string>whatsapp</string>
</array>