Communication beetween two phonegap app on the same device ?

39 views
Skip to first unread message

Jean-Baptiste Perrin

unread,
Apr 17, 2014, 6:02:24 AM4/17/14
to mobile-c...@googlegroups.com
Hello,

It's possible to make 2 phonegap apps on the same device communicate? Or I will need a background service?

Thanks

Jean-Baptiste Perrin

J. Chris Anderson

unread,
Apr 17, 2014, 7:07:03 PM4/17/14
to mobile-c...@googlegroups.com
Just easier to have the sync with the same sync gateway, all though I'm sure it's possible to set up a secure channel among apps and try to keep it alive in background services...

If you can do a shared file on the filesystem that might be the way to go. If it was me I'd just sync the two apps via Sync Gateway in the cloud somewhere.

Chris

Jens Alfke

unread,
Apr 17, 2014, 11:45:58 PM4/17/14
to mobile-c...@googlegroups.com

On Apr 17, 2014, at 3:02 AM, Jean-Baptiste Perrin <jeanbaptis...@gmail.com> wrote:

It's possible to make 2 phonegap apps on the same device communicate? Or I will need a background service?

I think it’s possible, but it’s probably difficult. The issue is that one app needs to keep its listener socket alive while it’s in the background (hard to do on iOS) and the other app has to somehow know what port the first one is listening on so it can connect to it.

I know Android is a lot better about letting apps communicate with each other than iOS is, but I know little about Android. Maybe it’s easier over there. Maybe Apple will relent and let apps communicate more easily in iOS 8; I hope so. I get to go to WWDC this year (yay!) so I’ll be up there hoping for an announcement like that.

—Jens

Jean-Baptiste Perrin

unread,
Apr 18, 2014, 5:02:43 AM4/18/14
to mobile-c...@googlegroups.com
Ok, thanks for the answer.

I will think about it.
Reply all
Reply to author
Forward
0 new messages