ios – UIActivityViewController setCompletionWithItemsHandler未调用whatsapp活动

ios – UIActivityViewController setCompletionWithItemsHandler未调用whatsapp活动,第1张

概述UIActivityViewController setCompletionWithItemsHandler未调用whatsapp活动. 有人遇到过同样的问题吗?请分享解决方案. NSArray *applicationActivities = @[[[JBWhatsAppActivity alloc] init]];UIActivityViewController* activityView UIActivityVIEwController setCompletionWithItemsHandler未调用whatsapp活动.

有人遇到过同样的问题吗?请分享解决方案.

NSArray *applicationActivitIEs = @[[[JBWhatsAppActivity alloc] init]];UIActivityVIEwController* activityVIEwController = nil;if(installed)    activityVIEwController = [[UIActivityVIEwController alloc] initWithActivityItems:dataToShare applicationActivitIEs:nil];else    activityVIEwController = [[UIActivityVIEwController alloc] initWithActivityItems:dataToShare applicationActivitIEs:applicationActivitIEs];// Setting subject fIEld while sharing app with email[activityVIEwController setValue:@"Check out this Site !" forKey:@"subject"];NSArray *excludedActivitIEs = @[UIActivityTypePostToWeibo,UIActivityTypePrint,UIActivityTypecopytopasteboard,UIActivityTypeAssignToContact,UIActivityTypeSavetoCameraRoll,UIActivityTypeAddToReadingList,UIActivityTypePostToFlickr,UIActivityTypePostToVimeo,UIActivityTypePostToTencentWeibo,UIActivityTypeAirDrop                                ];activityVIEwController.excludedActivityTypes = excludedActivitIEs;[activityVIEwController setCompletionWithItemsHandler:^(Nsstring * __nullable activityType,BOol completed,NSArray * __nullable returnedItems,NSError * __nullable activityError) { } ];[self presentVIEwController:activityVIEwController animated:YES completion:^{}];
解决方法
NSMutableArray *sharingItems = [NSMutableArray new];if (text) {    [sharingItems addobject:text]; // text to share}if (image) {    [sharingItems addobject:image]; // UIImage to share}if (url) {    [sharingItems addobject:url]; // url to share}UIActivityVIEwController *activityController = [[UIActivityVIEwController alloc] initWithActivityItems:sharingItems applicationActivitIEs:nil];if ( [activityController respondsToSelector:@selector(popoverPresentationController)] ) {    // iOS8    activityController.popoverPresentationController.sourceVIEw =    sourceVIEw;    activityController.popoverPresentationController.sourceRect = CGRectMake(CGRectGetMIDX(self.vIEw.bounds),CGRectGetMIDY(self.vIEw.bounds),0);}[activityController setCompletionWithItemsHandler:^(Nsstring * __nullable activityType,NSError * __nullable activityError){     //Your Code goes here}];[self presentVIEwController:activityController animated:YES completion:^{}];
总结

以上是内存溢出为你收集整理的ios – UIActivityViewController setCompletionWithItemsHandler未调用whatsapp活动全部内容,希望文章能够帮你解决ios – UIActivityViewController setCompletionWithItemsHandler未调用whatsapp活动所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1105106.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-28
下一篇 2022-05-28

发表评论

登录后才能评论

评论列表(0条)

保存