Bluetooth beacon launch app or generate push notification - ios

Is it possible to achieve something like geofenced launching of an application, but using bluetooth beacons instead of GPS? I.e. when the phone gets a close to a device with a particular id it will launch the app (or somehow generate a push notification which could in turn launch the app)?

No, not in iOS 6 or 5. You would be interested to look at the docs for the upcoming release however. You might find something in there to be pleasantly surprising.

Related

How to detect launch app via MFi device on iPhone

Could someone tell me "How to detect launch app via MFi device on iPhone"?
Apple announced several major changes for a new Location Permission Flow on iOS 13.
(https://gimbal.com/ios-13-location-permissions/)
If want to get the GPS signal, the user need to select while in using or always.
And set up showsBackgroundLocationIndicator = YES, the app could get the GPS in the background.
It works well on the normal case(Launch with press the icon on the mobile screen).
But I figure out it could not receive the GPS if launch app via MFi device.
I also report it on the Apple bug report(https://feedbackassistant.apple.com/feedback/7537501)
I got a workaround but the first one is how to detect launch app via MFi device on iPhone.
By the way, I also check the argument of UIApplicationMain, but no use.
Please help or try to give some ideas about how to achieve this. Thanks!
Test Steps
1. First launch & user accept the location permission
2. Confirm the GPS could be used & check the setting page
3. Force close the app
4. Plug with the lighting and launch via MFi device
Answer my final solution.
I figure out if the app launch via the MFi device, the initial flow will enter applicationDidEnterBackground and not run to applicationDidBecomeActive. So, I just add a flag to record that and detect the EAAccessory status.
Share for who guys have a same problem. Hope this could be helped.
iOS 15 can use CLLocation's sourceInfo(CLLocationSourceInformation) to determine location information is from Xcode or MFI.

Understanding interaction between Apple Watch and iPhone device

I am a bit confused as when I run the Apple Watch extension App schema on the simulator I see only that the Apple Watch app gets lunched. However I am not sure what will happen with real hardware once we get our hands on the Apple Watch.
I'd like to understand the following:
Do I need to start the corresponding iPhone App on the phone before
starting the App on the Apple Watch?
If the answer to 1 is no then, can I
start an iPhone App from the App on the Apple Watch? If the answer to 2
is yes then how can I start the iPhone App in a way that is not in
the background? (I found handleWatchKitExtensionRequest can trigger
background tasks but I haven't found any documentation yet for
that - I also found the Handoff Api which allows you to resume a task on the device but I don't like that it requires an iCloud account and I am not sure how to structure an App/watch interaction without forcing the user to adopt iCloud).
Given that the Apple Watch App extension resides on the iPhone App
bundle does this mean that when you start the Apple Watch App it needs a
connection and proximity with the iPhone device? I assume that there will
be a bluetooth connection and that it won't be possible to start
some apps if the user and its watch are away from the Iphone (what's
the range?)
Many Thanks
No.
No.
Unless you are on a Wifi network recognized by both your Watch and your iPhone, they'll need to be relatively close to each other. Guessing at range is useless – a number of factors can impact the useable distance of BTLE.

ios simulator - where is settings>notifications>appname?

I built a VOIP app for iphone where if you receive a call, you will hear a telephone ring tone. Some users have complained that they don't hear any ringtone. I discovered later that on the physical device, you can go to Settings>Notifications>TheAppName, and adjust your notification settings. One of htese settings is to disable sounds or allow sound, which corresponds to whether you get the ringtone or not when receiving a call. However, some users still don't seem to hear the ringtone at all despite having the most permissive sound settings.
I wanted to reproduce their issues in the iOS simulator. But I can't seem to find the Settings>NOtifications in the simulator. How do I locate this?
You cannot test push notification services on the simulator. You have to use a device to test it.

iOS Private API: lock device and power off the screen

I'm making an app for jailbreak that lock the device when the user launch the app. I've tried GSEventLockDevice(); from GraphicsServices.framework but this does not work properly because it locks the screen but does not power off the screen. Is there another way to lock the screen without MobileSubstrate?
Just as another alternative, check out this answer, which uses SBDimScreen(). You could use that in conjunction with GSEventLockDevice().
It appears that you may now (iOS 5+) need to add an entitlement to your app to use this call successfully. If you haven't done that before, here is an example of how to do so. Obviously, in this case, the entitlement in question must be changed to com.apple.backboard.client.
You also might see if #VictorRonin has experimented with this, as he commented on the question I linked to. I tested SBDimScreen() on a jailbroken iOS 4.2.1 device, but my newer devices are currently unavailable to run this test. I'll try it later on iOS 5.x and post an update.
Note: the answer I linked to from Elias has a different call altogether for iOS 6.
Look at these several questions:
Simulating System Wide Touch Events on iOS
Simulating System Wide Touch Events in iOS without jailbreaking the device
How to send a touch event to iPhone OS?
The idea is that you can simulate system wide events. One of events is power down event. If you simulate it, it will turn off device and will lock it.
BTW. You may be interested to google more on GSEvent which is the key for even simulation.
Here are couple of useful links:
http://iphonedevwiki.net/index.php/GSEvent
http://networkpx.blogspot.com/2009/08/gsevent-recording-and-playback-in-30.html
Also, this approach isn't limited to jailbroken phones. It works on jailed phone too (however, you won't be able to post it to AppStore).

Toggle iPhone Charging through OS X or XCode

I'm currently writing an iOS application and am receiving battery status change notifications. Of course, when I'm debugging my app it would be nice if I could toggle the battery status without unplugging my phone. Is there any way to do this via OS X or XCode, that is, while having the phone plugged in tell it to stop charging so I can test my notifications and actions?
Due to Apple's sandboxing regulations and firmware, you can not tell the phone to stop charging. This is a service extremely close to the core of the phone, and it can not be programmatically accessed.
Of course, when I'm debugging my app it would be nice if I could toggle the battery status without unplugging my phone.
Since you can't do that (per the accepted answer), an alternative that will help you debug is to create and send your own battery status notifications. The notifications are regular old NSNotification objects, and you can create and send your own with the name set to UIDeviceBatteryLevelDidChangeNotification or UIDeviceBatteryStateDidChangeNotification. That should let you trace through any code that would normally run when your app receives those notifications.

Resources