4

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.

ajay_nasa
  • 2,278
  • 2
  • 28
  • 45
  • You left out the important information. What behavior are you seeing and what behavior were you expecting? – rmaddy Sep 28 '15 at 14:23
  • Before, ios9 same code share every object in NSArray *dataToShare= @[title,description,url]; but now only first object is showing while saving content in NOTES(one of the option showed by share screen). – ajay_nasa Sep 28 '15 at 15:30
  • 1
    Sorry, for bad explanation. I have solved my problem by contantinate the string.. – ajay_nasa Sep 28 '15 at 15:35

1 Answers1

11

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:^{}];
ajay_nasa
  • 2,278
  • 2
  • 28
  • 45