Using PHP in a packaged app, or someway like iframe.

53 views
Skip to first unread message

blynn

unread,
Jan 6, 2011, 2:13:56 PM1/6/11
to Chromium Apps
I'm trying to add the ability to save to google docs, dropbox, or
s3.

I have a packaged web app which is completely offline.

I'm trying to figure out the best way to allow the app to sync when
online to backup information by user account.

I do know Google does this on some of there apps in the web store.

It's challenging because I can't put PHP inside a packaged app, but I
might be able to get an iframe to work.

I don't want to make it a hosted app because I can't seem to grasp the
concept of the licencing api.

Does anyway have a possible solution?

Thanks.

Arne Roomann-Kurrik

unread,
Jan 6, 2011, 2:32:09 PM1/6/11
to blynn, Chromium Apps
You can't run PHP inside of a packaged app, although it is possible to talk to a third party service for sync completely through JavaScript.

You would use a cross-domain ajax request and some sort of authorization to connect to the service.  Many services support OAuth, and there's a library for Chrome extensions (should work for Packaged apps, let me know if it doesn't) documented here: http://code.google.com/chrome/extensions/trunk/tut_oauth.html

There are a few sample extensions (very similar to packaged apps) that cover using OAuth to connect to various services.  Here's a list: http://code.google.com/chrome/extensions/trunk/samples.html#oauth

Once you've authorized, you would use ajax calls to the service's API to store/fetch data for the current user.

~Arne
Reply all
Reply to author
Forward
0 new messages