2

I'm trying to open a prezi.com presentation from my app.

NSURL *url = [ [ NSURL alloc ] initWithString: @"prezi://open?oid=ftv9hvziwqi2" ];
[[UIApplication sharedApplication] openURL:url];

This piece of code opens the app, but not the presentation. When you visit this link on your ipad you get a page with a link the open the presentation.

http://prezi.com/ftv9hvziwqi2/coca-cola-companya/

But I can figure out the correct URL for opening a presentation in the prezi app. And i cant find any documentation from this either on the prezi site.

Melvin
  • 3,421
  • 2
  • 37
  • 41

2 Answers2

2

I too, was interested in this so I had a little look into it.

If you visit the hyperlink (http://prezi.com/ftv9hvziwqi2/coca-cola-companya/) on an iPad, it gives you the link required to open the presentation in the Prezi app.

This is it:-

prezi://open?oid=ftv9hvziwqi2&details=eyJzaXplIjogMTIzMTE2MywgInRva2VuIjogIiIsICJ0aHVtYl91cmwiOiAiaHR0cDovLzA0MDEuc3RhdGljLnByZXppLmNvbS9wcmV2aWV3LzgvOS83L2M3M2U3NTU5YTE3ZjdkMjgyMjc1NGIwOWVkNmY2ZDJhNjNkZmFfMV92OTkucG5nIiwgImF1dGhvciI6ICJBbm5pZSBOYW0iLCAidGl0bGUiOiAiQ29jYSBDb2xhIENvbXBhbnkuQSIsICJsYXN0bW9kIjogIjA4IEFwcmlsIDIwMTIiLCAib2lkIjogImZ0djlodnppd3FpMiIsICJkZXNjIjogIkludGVybmF0aW9uYWwgbWFuYWdlbWVudCBwbGFuIn0=

It turns out there is a second parameter called 'details', which is base64 encoded. When I decoded it, the details look like this:-

{"size": 1231163, "token": "", "thumb_url": "http://0401.static.prezi.com/preview/8/9/7/c73e7559a17f7d2822754b09ed6f6d2a63dfa_1_v99.png", "author": "Annie Nam", "title": "Coca Cola Company.A", "lastmod": "08 April 2012", "oid": "ftv9hvziwqi2", "desc": "International management plan"}

I'm guessing this 'details' parameter is required, so try creating your own and base64 encoding it. Good luck!

Edit: A much simpler possibility is to direct the user to safari. That way they can still open the Prezi app, and you don't have to create any weird details yourself.

NSURL *url = [ [ NSURL alloc ] initWithString: @"http://prezi.com/ftv9hvziwqi2/coca-cola-companya/" ];
[[UIApplication sharedApplication] openURL:url];
Liam George Betsworth
  • 18,373
  • 5
  • 39
  • 42
  • Thanks for the first part. Since prezi doesn't have an api i have to figure out which paramters are required in the json object. Your second option to open the url works indeed, but not when youre offline. – Melvin May 08 '12 at 10:14
  • If you only specify the oid paramters it works, but you wont see any title, description or image in the app. The presentations starts okey. But when you leave all the parameters emtpy you wont see any title, description or image in the app. So without an api we can not create the object dynamically I guess. – Melvin May 08 '12 at 10:26
  • Without an api it's difficult to do it dynamically, but there are ways. **Static:** If you have an iPad, visit the http URL for your presentation, copy the prezi:// url and use it in your app. If you only ever want to display the same 1 or 2 presentations, the json objects will always be the same for each one. **Dynamic:** If you will be directing users to new presentations all the time, create a php script online that visits the ipad http URL and then scrapes the page for the prezi:// URL. That would be a fully dynamic solution. – Liam George Betsworth May 08 '12 at 12:15
2

It looks like the prezi app doesn't have a publicly accessible url scheme (that's the prezi:// url):

http://community.prezi.com/prezi/topics/does_ipad_prezi_viewer_have_a_url_scheme_so_other_apps_can_launch_it_and_open_a_specific_prezi_via

If you look at the structure of the web link (that does indeed open the presentation properly) it's got "&details=XYZ=" field at the end, where XYZ is a few hundred random characters.

You could try putting that full url in, but I suspect that would be a fragile solution as it's probably a nonce based on your user account and/or the time you accessed it.

Best thing to do is probably put another request out on that community board linked above.

Freney
  • 1,174
  • 1
  • 11
  • 26