gpt4 book ai didi

ios - 如何在iOS中集成whatsapp

转载 作者:行者123 更新时间:2023-12-01 17:25:44 25 4
gpt4 key购买 nike

嗨,现在我正在尝试在我们的应用程序中集成什么是应用程序

我已经完成整合推文

:-在这个程序中我创建两个按钮
一个(chooseImagePressed)按钮是选择图像形式的本地文件,然后
然后第二个(tweetButtonPressed)这是将图像发布到Tweeter

- (IBAction)tweetButtonPressed:(id)sender
{
if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter])
{
SLComposeViewController *tweetSheet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
[tweetSheet setInitialText:@"Look at this nice picture!"];

[tweetSheet addImage:self.imageView.image];

[self presentViewController:tweetSheet animated:YES completion:nil];
}
else
{
UIAlertView *alertView = [[UIAlertView alloc]
initWithTitle:@"Error"
message:@"please setup Twitter"
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alertView show];
}
}

- (IBAction)chooseImagePressed:(id)sender
{
self.pickerController = [[UIImagePickerController alloc] init];

self.pickerController.delegate = self;
self.pickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;

[self presentViewController:self.pickerController animated:YES completion:nil];
}

#pragma mark

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info;
{
self.imageView.image = [info objectForKey:UIImagePickerControllerOriginalImage];

[self dismissViewControllerAnimated:YES completion:nil];
}

请给我有关如何将什么应用程序集成到我们的应用程序中的任何想法

请告诉我这可能与否

谢谢

最佳答案

,不可能as like tweeter and Facebook api。但是,如果已经安装了whatsapp,则可以将消息从应用程序发送到whatsapp,如下所示

NSURL *whatsappURL = [NSURL URLWithString:@"whatsapp://send?text=Hello%2C%20World!"];//use this method stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding to convert it with escape char
if ([[UIApplication sharedApplication] canOpenURL: whatsappURL]) {
[[UIApplication sharedApplication] openURL: whatsappURL];
}

但是,如果您想共享文件,图像,视频之类的文档,则必须通过 UIDocumentInteractionController.发送

注意:应为以上两个安装 whatsapp,否则您将无法执行任何操作。 See this for current whatsApp doc.

关于ios - 如何在iOS中集成whatsapp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22503190/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com