我想创建一个应用程序,当从该应用程序内部执行某个代码块时,该应用程序将打开并呈现给用户。 有可能吗?
另一个解决方案是显示本地警报通知,该通知将打开应用程序。 但是没有通知可以这样做吗?
I would like to make an app, that opens and present itself to a user when a certain block of code is executed from inside that app. Is it possible like that?
Another solution would be to display a local alert notification, that would open the app on tap. But is it possible to do that without the notification?
最满意答案
不,你不能直接打开另一个应用程序。
如果您想使用您的应用程序打开另一个应用程序,以实现URL方案。
以下是Objective-C中打开谷歌地图的基本示例
-(IBAction) openMaps:(id)sender { // Opens a map containing Envato's Headquarters UIApplication *ourApplication = [UIApplication sharedApplication]; NSString *ourPath = @"http://maps.google.com/maps?ll=-37.812022,144.969277"; NSURL *ourURL = [NSURL URLWithString:ourPath]; [ourApplication openURL:ourURL]; }以下是在Objective-C中创建自定义URL方案的最佳教程。
Nope,You can't directly open the another app.
If you want to open another app using you app for that need to implement URL Schemes.
Here is basic example for open google map in Objective-C
-(IBAction) openMaps:(id)sender { // Opens a map containing Envato's Headquarters UIApplication *ourApplication = [UIApplication sharedApplication]; NSString *ourPath = @"http://maps.google.com/maps?ll=-37.812022,144.969277"; NSURL *ourURL = [NSURL URLWithString:ourPath]; [ourApplication openURL:ourURL]; }And Here is best tutorial for create custom URL Schemes in Objective-C.
更多推荐
发布评论