Wenn ich Apples UIActivityViewController
verwenden, um ein paar Bilder zu WeChat (Weixin) zu teilen. Ich finde, dass es manchmal nicht funktioniert. Die meiste Zeit funktioniert es gut, wenn ich nur 1 ~ 3 Bilder wähle, aber wenn ich 9 Bilder teile (größte erlaubte Anzahl von WeChat), wird es sicherlich fehlschlagen, und die Konsole wird druckenUIActivityViewController, um Bilder zu WeChat nicht funktionieren
2016-04- 01 16: 14: 34,258 EverPhoto [5567: 1.981.394] Plugin com.tencent.xin.sharetimeline 2016.04.01 unterbrochen 16: 14: 34,258 EverPhoto [5567: 1.981.394] Plugin com.tencent.xin.sharetimeline entwertet
Hier
ist der Code:
__weak typeof(self) __weakSelf = self;
self.activityViewController = [[UIActivityViewController alloc] initWithActivityItems:self.shareItems applicationActivities:nil];
self.activityViewController.excludedActivityTypes = @[UIActivityTypePostToFacebook,
UIActivityTypePostToTwitter,
UIActivityTypePostToVimeo,
UIActivityTypePostToTencentWeibo,
UIActivityTypePrint,
UIActivityTypeCopyToPasteboard,
UIActivityTypeAssignToContact,
UIActivityTypeSaveToCameraRoll,
UIActivityTypeAddToReadingList,
UIActivityTypePostToFlickr,
];
self.activityViewController.completionWithItemsHandler = ^(NSString * __nullable activityType, BOOL completed, NSArray * __nullable returnedItems, NSError * __nullable activityError){
DLog(@"shareCompleted : %@", completed ? @"YES" : @"NO")
__weakSelf.shareItems = nil;
__weakSelf.activityViewController = nil;
};
[self.containerVc presentViewController:self.activityViewController animated:YES completion:nil];
ShareItems
ist das benutzerdefinierte Objekt, das das Protokoll UIActivityItemSource
implementiert.
P.S. Ich habe APP Google Photo ausprobiert und festgestellt, dass es in seiner Share-Funktion sehr gut funktioniert. Es kann 9 Bilder mit sogar der ursprünglichen HD-Größe des Systemfotos teilen, das WeChat unter Verwendung UIActivityViewController
behauptet. Also, wie soll ich dieses Problem lösen?
Das OP erwähnt, dass die Google Photo App HD-Bilder teilen kann. Was ist der Grund dafür? – Suragch