如何从我的应用程序发送操作到其他应用程序?
问题描述:
我想从我的iOS应用程序从我的应用程序发送动作到其他应用如何从我的应用程序发送操作到其他应用程序?
UIApplication *ourApplication = [UIApplication sharedApplication];
NSString *URLEncodedText = @"...";
NSString *ourPath = [@"...://" stringByAppendingString:URLEncodedText];
NSURL *ourURL = [NSURL URLWithString:ourPath];
if ([ourApplication canOpenURL:ourURL]) {
[ourApplication openURL:ourURL];
}
else {
//Display error
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"..." message:@"..." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
}
现在,打开第二个应用程序,但我想送行动,第二个应用程序。
答
Apple向iOS8添加了操作来管理这类问题。您可以查看文档here。 通过这种方式,您可以将“服务”作为Actions提供给其他应用程序,或者,如果是您的情况,则可以使用由第三方应用程序提供的操作。
+0
谢谢你的回答 –
+0
我想运行你的第二个应用程序的方法 是可能的吗? –
我不明白。请详细解释。 – user3182143
我想运行你的第二个应用程序的方法是可能的? –
传递iTunes网址的第一个应用程序。它会工作。 – user3182143