如果一个应用程序如何在不使用swiching应用程序的情 [英] How can one app provide data to another without swiching apps?

查看:162
本文介绍了如果一个应用程序如何在不使用swiching应用程序的情的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

场景:


  • 我控制两个不同的应用程序,App A和App B,两者都是用户安装的

  • App A正在运行

  • App A需要获取App B上次运行时由App B设置的字符串。

  • 获取字符串后,App A仍将运行

  • 用户不应收到此通信正在发生的任何反馈。例如。 A或B之间没有切换动画,没有弹出窗口等等。

  • I "control" two different apps, App A and App B, both which the user has installed
  • App A is running
  • App A needs to obtain a string that was set by App B when App B last ran.
  • After obtaining the string, App A will still be running
  • User should not receive any feedback this communication is happening. E.g. no "switching animations" between A or B, no pop-ups, etc.

约束条件:


  • 应用程序在不同供应商下发布

  • 应用已存在于应用商店中;更新版本将具备此通信功能。

  • 可以接受存储在应用B中的数据,以便设备上的其他应用可以访问。

  • 一般第三方可以看到App B中存储的数据是不可接受的(例如,如果使用外部服务器,则需要某种安全方案)。

  • 数据在安装后打开App A时,应该能够立即进行读取。例如,我不能要求App A的用户输入外部通信服务的登录凭据。

  • 必须适用于非越狱设备。

  • Apps are released under different vendors
  • Apps are already in the app store; updated versions will have this communication ability.
  • It is acceptable for the data stored in App B to be accessible to other apps on the device.
  • It is not acceptable for the data stored in App B to be visible to general third parties (e.g. if an external server is used, there needs to be some sort of secured scheme)
  • The data read should be able to occur immediately upon App A being opened after install. For instance, I cannot require the user of App A to enter log in credentials for an external communication service.
  • Must work on non-jailbroken devices.

这似乎很难在iOS7中实现。感谢帮助。

This is seeming rather difficult to pull off in iOS7. Help is appreciated.

推荐答案

棘手的工作。不推荐,但如果您买不起服务器,它将完成工作。

Tricky work around. Not recommended, but it will get the job done if you can't afford servers.

在第一个应用程序中,在用户的通讯录中创建联系人。给它一个通用名称,如000 - NameOfAppB数据 - 不要删除(我以000开头,所以它到用户联系簿的底部,所以他们从来没有看到它,我还添加不要删除因此,如果用户以某种方式找到它,他们不会删除它hahaha)(无论如何谁看着联系人书)。在notes下的联系信息中,以字符串格式添加NSData。

On the first app create a contact in the user's contacts book. Give it a generic name like "000 - NameOfAppB Data - Don't Delete" (I start with "000" so it goes to the bottom of the users contact book so they never see it, I also add "don't delete" so if the user does somehow find it they don't delete it hahaha) (who looks at contact books anyways). In the contact info under notes add your NSData in string format.

然后当打开app A时搜索该联系人,阅读数据,然后删除该联系人。

Then when app A is opened search for that contact, read the data, then delete the contact.

Apple允许您在未经许可的情况下创建和删除用户联系人。 (至少在2011年他们做了,这可能已经改变了。)

Apple does allow you to create and delete users contacts without their permission. (At least in 2011 they did, this may have changed).

这篇关于如果一个应用程序如何在不使用swiching应用程序的情的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆