我有这个共享功能:
NSString *URLEncodedText = [someId stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSString *ourPath = [@"something://" stringByAppendingString:URLEncodedText];
NSString *textToShare = [NSString stringWithFormat:@"My message that I want to have this link %@", someId];
NSArray *objectsToShare = @[textToShare, ourPath];
UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:objectsToShare applicationActivities:nil];
NSArray *excludeActivities = @[UIActivityTypeAirDrop,
UIActivityTypePrint,
UIActivityTypeAssignToContact,
UIActivityTypeSaveToCameraRoll,
UIActivityTypeAddToReadingList,
UIActivityTypePostToFlickr,
UIActivityTypePostToVimeo];
activityVC.excludedActivityTypes = excludeActivities;
[self presentViewController:activityVC animated:YES completion:nil];
有没有办法将共享作为链接发送,而不是向用户显示ourPath
?
这是我得到的最终结果 东西:// XXXXXXX