3

Hello I'm creating an app in Rubymotion, one of the feature is to open another application but I realized that target app do not use URL Scheme model into the info.plist

Do you know how I should hack this ?

I think this is possible cause the website for the app promotion embed a Smart App Banner... how the os done this ?

Thanks

  • The smart banner requires a URL scheme to open the target app as well (`app-argument: (Optional.) A URL that provides context to your native app. If you include this, and the user has your app installed, she can jump from your website to the corresponding position in your iOS app`). If there is no registered URL scheme for the app, you will be unable to launch it. – thegrinner Mar 31 '14 at 15:44
  • Maybe it's semantics, but a smart banner does not ***require*** a URL scheme. – Adam Jenkins Mar 31 '14 at 15:51
  • Unfortunatly I want to jump in an app that it's not mine... I can't modifing it.. I was thinking to load an webview and hack a script to launch it.. what do you think about it ? – Benjamin Athlan Mar 31 '14 at 17:40

2 Answers2

0

What app are you opening?

You could look into using a UIDocumentInteractionController, but then you need a file to open...

Documentation: UIDocumentInteractionController

Example, relying heavily on SugarCube helpers:

file = "instagram.igo".document_path
image.nsdata(:jpg, 1.0).write_to(file)
@interaction_controller = UIDocumentInteractionController.interactionControllerWithURL(file.fileurl)
@interaction_controller.delegate = self
@interaction_controller.UTI = "com.instagram.exclusivegram"
@interaction_controller.annotation = {"InstagramCaption" => status}
@interaction_controller.presentOpenInMenuFromRect([[0, 0], [0, 0]], inView: self.view, animated: true)
colinta
  • 3,536
  • 1
  • 28
  • 18
0

No you cannot launch another iOS application without an URL. Once you have know the URL, you don't need load a UIWebView and hack a script to launch it.

From Apple Docs, Advanced App Tricks - Communicating with Other Apps:

NSURL *myURL = [NSURL URLWithString:@"todolist://www.acme.com?Quarterly%20Report#200806231300"];
[[UIApplication sharedApplication] openURL:myURL]; 
Black Frog
  • 11,595
  • 1
  • 35
  • 66
  • Did you add todolist to your info.plist as your URL Schemes? Will this work without adding it to info.plist? – Vidhya Sri Sep 11 '18 at 05:39