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

10,127

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:^{}];
Share:
10,127
ajay_nasa
Author by

ajay_nasa

Enthusiast iOS developer, who loves to explore the programming. I am a conscientious person who works hard and pays attention to detail. I'm flexible, quick to pick up new skills and eager to learn. Over the time I've developed a wide range of projects (15+ Live Applications) and gained a lot of experience in creating quality applications.

Updated on June 09, 2022

Comments

  • ajay_nasa
    ajay_nasa almost 2 years

    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.