同一公司间的app,想通过共享内存通信,我的实现思路是这样的:
1)app间能否共享文件:
调查结果:使用相同证书的app间能够共享文件,比如迅雷
2)使用mmap函数进行内存映射:
调查结果:ios中可以使用mmap系统调用
将共享的文件分别映射到各个app的物理内存中,按道理讲以上两个步骤就能实现内存共享了,请问我的方案是否可行?
天蓬老师2017-04-17 17:30:31
First you need shared files, but does the sandbox allow you to share files?
ringa_lee2017-04-17 17:30:31
I have never used shared memory, so I won’t comment.
Regarding file sharing, I have some suggestions:
Files can be shared using App Group
App Group is stored in an independent space outside the sandbox
If there are multiple apps using the same App Group space, the space content will be cleared only when the last one is deleted
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 Extension
和Containing App
communication in the title, it is actually used for communication between APPs.
Wish you good luck