简体   繁体   English

如何通过本机iOS应用在SnapChat上共享图像?

[英]How to share image at SnapChat from my native iOS app?

I want to share image at SnapChat from my native iOS app. 我想通过本机iOS应用程序在SnapChat上共享图像。 I have tried to search for integration process but not able to find any way so I can integrate logic for sharing image from my app in SnapChat. 我试图搜索集成过程,但找不到任何方法,因此我可以在SnapChat中集成用于共享应用程序中图像的逻辑。 Please help. 请帮忙。 If possible, please share any example? 如果可能,请分享任何示例?

u tried .. when u click non the share button in our app : u can pass image or text or data 您尝试了..当您在我们的应用中单击非共享按钮时:您可以传递图像,文本或数据

check the code: 检查代码:

 NSArray *objectsToShare = @[your text or image objects..];  


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];

inside u can chose snapchat or Facebook or WhatsApp... all sharing enabled applications. 在您内部,您可以选择snapchat或Facebook或WhatsApp ...所有已启用共享的应用程序。

Try this it'll work 试试这个就可以了

NSString *urlstring = [NSString stringWithFormat:@"Your Share URL"];

    NSURL *myurl = [NSURL URLWithString:urlstring];
    NSArray *myarray = @[myurl];
    NSLog(@"%@",myarray);
    UIActivityViewController *controller = [[UIActivityViewController alloc] initWithActivityItems:myarray applicationActivities:nil];

incase using iPod Share by using this condition 在这种情况下使用iPod Share

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
    [self presentViewController:controller animated:YES completion:nil];
}else {
    UIPopoverController *popup = [[UIPopoverController alloc] initWithContentViewController:controller];
    [popup presentPopoverFromRect:CGRectMake(self.view.frame.size.width/2, self.view.frame.size.height/4, 0, 0)inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从我的 iOS 应用程序在 SnapChat 上分享图像/视频? - How to share image/video on SnapChat from my iOS app? 从我的应用程序打开本机 Snapchat 应用程序 - Open native Snapchat App from my Application 如何从我的iOS应用程序将图像和文本共享到Facebook。 - How to share an image & text to Facebook from my iOS App. 在Twitter上分享图片并从iOS原生应用程序获取收藏列表 - share image on twitter and get favourites list from iOS native app 当我尝试从React Native iOS应用程序共享我的应用程序URL时,应用程序变得无响应 - App becomes unresponsive when I tried to share my app url from react native iOS app 如何从 iOS(swiftui)中的应用程序共享我的应用程序的链接? - How to share a link of my app from app in iOS(swiftui)? 如何将文本或图像从ios应用共享到Yammer - How to share text or image from ios app to Yammer 如何使用Swift从iOS应用程序分享音频/图像到whatsapp - How to share an Audio/Image to whatsapp from an iOS app using Swift 如何将 url 从浏览器共享到 iOS 中的应用程序? - How can I share a url from a browser to my app in iOS? 如何将我的应用中的帖子分享到 Twitter iOS - How to share a post from my app to twitter iOS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM