Post

Replies

Boosts

Views

Activity

Objective-c iOS Unable to Share NSURL and NSString simultaneously to iMessage app
Is it possible to share NSURL and NString at the same time using the UIActivityViewController? I know it's possible using the MFMessageComposeViewController but wanted to use the native UI sheet so the user can select a different app if they wanted. In this example, the filePath variable is a path to a video file saved on the device. NSMutableArray *items = [NSMutableArray new]; [items addObject:[NSURL fileURLWithPath:filePath]]; UIViewController *rootViewController = UnityGetGLViewController(); UIActivityViewController *activity = [[UIActivityViewController alloc] initWithActivityItems:items applicationActivities:nil]; [rootViewController presentViewController:activity animated:YES completion:nil]; Updating the items with an additional string value will result in only the video being shared. NSMutableArray *items = [NSMutableArray new]; [items addObject:[NSURL fileURLWithPath:filePath]]; [items addObject:[NSString stringWithUTF8String:"Check out this video!"]]; UIViewController *rootViewController = UnityGetGLViewController(); UIActivityViewController *activity = [[UIActivityViewController alloc] initWithActivityItems:items applicationActivities:nil]; [rootViewController presentViewController:activity animated:YES completion:nil]; The "Check out this video!" text is never included in the iMessage app. Is this something that is possible? If not It would be nice to see some official Apple documentation about this. Also, this would be quite surprising considering iMessage is a built-in app, you would imagine it would have this capability.
2
0
953
Jun ’23
iOS Unable to Share video and text simultaneously to iMessage
Currently, I'm trying to set up sharing as a feature within an app. The plugin for the app uses the UIActivityViewController class to share on iOS. Currently, when attempting to share to iMessage, we are unable to share a video and text at the same time. When sharing a video to the messaging app, the text is never added to the text message. When sharing an image through the iMessage app, the text is included. Is this something that is possible? If not It would be nice to see some official Apple documentation about this. Also, this would be quite surprising considering iMessage is a built-in app, you would imagine it would have this capability. Here is a link to the plugin class: https://github.com/yasirkula/UnityNativeShare/blob/master/Plugins/NativeShare/iOS/NativeShare.mm Contacting the plugin's developer has not proved insightful, regardless I was hoping to get some proof this is or is not possible. Link to GitHub issue: https://github.com/yasirkula/UnityNativeShare/issues/170
0
0
504
Apr ’23