Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIActivityViewController to share any content in ios9 , is not working as expected in case of saving notes

UIActivityViewController to share content is not working as expected in case of saving notes in ios9. Here is my piece of code :

title,description,url are contains different contents to share.//

NSArray *dataToShare= @[title,description,url];
    UIActivityViewController* activityViewController =
    [[UIActivityViewController alloc] initWithActivityItems:dataToShare
                                      applicationActivities:nil];
    [self presentViewController:activityViewController animated:YES completion:^{}];

Thanks for any input very much in advance.

like image 400
ajay_nasa Avatar asked Dec 18 '22 23:12

ajay_nasa


1 Answers

I have solved this problem by Concatenate the different string to one for saving all content in NOTES.

NSString *url=@"http://itunes.apple.com/us/app/APPNAME/idXXXXXXXXX";
NSString * title =[NSString stringWithFormat:@"Download ECG app %@ and get free reward points!",url];
NSArray* dataToShare = @[title];
UIActivityViewController* activityViewController =[[UIActivityViewController alloc] initWithActivityItems:dataToShare applicationActivities:nil];
activityViewController.excludedActivityTypes = @[UIActivityTypeAirDrop];
[self presentViewController:activityViewController animated:YES completion:^{}];
like image 124
ajay_nasa Avatar answered Jan 25 '23 02:01

ajay_nasa