app通信 - ios中app间可以用共享内存通信吗?
PHPz
PHPz 2017-04-17 17:28:31
0
3
982

同一公司间的app,想通过共享内存通信,我的实现思路是这样的:
1)app间能否共享文件:
调查结果:使用相同证书的app间能够共享文件,比如迅雷
2)使用mmap函数进行内存映射:
调查结果:ios中可以使用mmap系统调用

将共享的文件分别映射到各个app的物理内存中,按道理讲以上两个步骤就能实现内存共享了,请问我的方案是否可行?

PHPz
PHPz

学习是最好的投资!

reply all(3)
Peter_Zhu

First you need shared files, but does the sandbox allow you to share files?

巴扎黑

Apps can share data through Keychain Sharing.

左手右手慢动作

I have never used shared memory, so I won’t comment.

Regarding file sharing, I have some suggestions:

  1. Files can be shared using App Group

  2. App Group is stored in an independent space outside the sandbox

  3. If there are multiple apps using the same App Group space, the space content will be cleared only when the last one is deleted

  4. Compared with shared memory, shared files should be safer

Finally attached is a comprehensible tutorial on data sharing between Extension and Containing App in iOS 8

Although it is ExtensionContaining Appcommunication in the title, it is actually used for communication between APPs.

Wish you good luck

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!