سؤال

I am creating a private distribution app and I am wondering if it is possible, using any methods or private API's, to open my app when a bluetooth connection has been made.

What I have discovered so far is that with iOS 7 and the ability to use iBeacons you can enter into bluetooth proximity and you can have your app send a notification to allow the user to then open the app.

What I am hoping to do then is have the app running in the background and listen for an iBeacon connection and, if one has been made, actually launch the app without the users control instead of just sending a notification.

I realize this would never be allowed publically, however is there anything private I can look at to achieve this without jailbreaking? I know to launch some apps you can do [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]]; however I want my app to listen for an iBeacon and then open itself up.

Is there any way or work around to achieve this?

هل كانت مفيدة؟

المحلول

Moving app from background to foreground without user interaction is pain in the ass. Sorry, don't have a solution, just want to share some information:

I asked the same question here and posted a bounty on it and got no good response: Show some UI from background in audio player or VOIP app on iOS

At some moment I found a solution with the help of another person. It was based on usage of GSEvent (sending clicks to UI). You can look following questions. However, as I know, in iOS 7 these API became protected by entitlement. So, this method is dead (most likely).

Using GraphicsServices.h/GSEvent as well as compiling CLI iPhone tools with Xcode

Use GSEvent to send touch event,but it's invalid.

Simulating System Wide Touch Events on iOS

iPhone, how to fire a button event in programmatically

نصائح أخرى

Apps can use region monitoring to be notified when the user crosses geographic boundaries or when the user enters or exits the vicinity of a beacon. While a beacon is in range of the user’s device, apps can also monitor for the relative distance to the beacon.

In iOS, regions associated with your app are tracked at all times, including when your app is not running. If a region boundary is crossed while an app is not running, that app is relaunched into the background to handle the event. Similarly, if the app is suspended when the event occurs, it is woken up and given a short amount of time (around 10 seconds) to handle the event. When necessary, an app can request more background execution time.

For detailed info: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/LocationAwarenessPG/RegionMonitoring/RegionMonitoring.html#//apple_ref/doc/uid/TP40009497-CH9-SW1

There are two scenarios: you either want users to be able to do something with your device other then use your app, or you want them to always be locked into your app.

In the former case you should trust user. Just show the push, timer or location notification and let them decide to launch the app or not.

In the latter case just lock the device using guided access mode.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top