How can you detect whether an iOS device supports push notifications? - ios

How can I detect whether an iOS device has push notifications capability or not?
[[UIApplication sharedApplication] enabledRemoteNotificationTypes] tells what permissions the user has given. I'm trying to figure out what capabilities the device has.

According to Apple, push notifications was introduced in iOS 3.0.
That means that all i-devices which run iOS 3.0 or newer have that capability.
Both iPhone, iPod Touch, and iPad, support the system because as others have noted, this is an OS feature, not a hardware feature.
So check if iOS is 3.0 or newer, or perhaps your software is targetting newer devices anyway, in which case you don't even have to check.

All iOS Devices have Push Notifications as capability.
iPad
iPhone
iPod Touch
This only relies on OS version and user settings. Not on hardware itself.

From the Apple Doc. you have no need to call a method to figure it out.
Apple Push Notification service (APNs for short) is the centerpiece of the push notifications >feature. It is a robust and highly efficient service for propagating information to devices >such as iPhone, iPad, and iPod touch devices.
http://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ApplePushService/ApplePushService.html

Related

iOS 9 an 10, Bluetooth connection with Bluetooth 3 device

I have a request of implementing an iOS application which will be able to communicate with bluetooth device. The chip on that device has Bluetooth 3. The App will be privately distributed, so we don't need AppStore review and we can use anything - the only requirement is, no iPhone jailbreaking. The purpose of the application in reading diagnostic data from the device and sending a few commands to it - like turn left, turn right, setValue - nothing special (it is a special valve, which can be remotely controlled).
Now if a learned correctly the options with using Bluetooth on iOS are:
CoreBluetooth: library for Bluetooth 4.0 LE devices. It cannot be used, because Bluetooth chip is 3.0
ExternalAccessory: the device must be MFI certified, if this option is about to be used. Quite hard that hardware producer will go into the MFI certification, so at the moment not an options.
Bluetooth.framework: private framework which sounded like a good option (I have managed to make it run on iOS9 and iOS10) but the communication with devices on iOS10 does not work anymore. On iOS 9.3.5 on iPhone5 I made it work, but only iOS9 is not an option
BTStack: available via Cydia, but this packages if I have learned correctly require iPhone jailbreaking. Sadly again not an option
The situation clearly does not look good here. I have also read rumors, that it might be possible to use HID bluetooth profile for communication (anyone tried that). is there any C Bluetooth library which could be run on iOS device and work with iOS10?
Thanks for any iadeas.

iOS iBeacons Not Working on Few Devices

I have been trying to run iBeacon Receiver sample. The code is supposed to detect the devices entry into a region and exit out of region. The iBeacon region is created by a transmitter that is running on another iOS device.
The receiver code works perfectly in one of the devices I have (iOS 7.0.1). It is detecting the entry and exit out of the region. But the same code does not work on couple of other devices with iOS 7.1 [iPad Air] and iOS 8.0 [iPad Mini].
I believe these hardwares support Bluetooth LE.
Will I be missing some configuration on the devices? I am not able to track it down. Could you please suggest?
AFA iOS 8, when you do request permissions, be sure to add the new info.plist entries describing why your app is requesting the specific permission type(s) else it will continue to fail (frustratingly) silently.
See http://nevan.net/2014/09/core-location-manager-changes-in-ios-8/ (which is linked to via SO: iOS: App is not asking user's permission while installing the app. getting kCLAuthorizationStatusNotDetermined every time - Objective-c & Swift ) for more info.
One symptom I've seen to indicate you're in the "don't have the plist entries" state is that when looking at Location Services permissions in Settings, you can manually set the permission to "Always" but when you run the app, the selection clears (that is, you have no selection as to permission for that app for Location Services).
Beacon apps that work on iOS 7 silently fail to detect beacons when built for iOS 8, if they have not requested location permissions. See here for details:
In iOS 8 Beacon not detecting
This would not explain why the code you mention does not work on iOS 7.1, so perhaps that device has a hardware issue (Bluetooth off or Bluetooth LE unsupported.) The first iOS device to support Bluetooth LE is the iPhone 4S so 4 and earlier devices cannot detect beacons.

Connect iOS device to Bluetooth device with SPP

I'm working on one watch which shows iOS device notification like..
Display Installed app notification
Display Call notification
Display Message notification.. etc
I have read some articles and came to know about GATT and ANCS, and this two itself enough to display iOS device notification on other bluetooth device.
Generic Attribute(GATT) Profile : https://developer.bluetooth.org/TechnologyOverview/Pages/GATT.aspx
Apple Notification Center Service(ANCS):
https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/AppleNotificationCenterServiceSpecification/Introduction/Introduction.html
Is that mean I do not need any iOS application to handle iOS device notification?
Currently my watch is built up with SPP, do I need to make any modification in that?
I also came to know that I have to apply for MFi Program(https://developer.apple.com/programs/mfi/).
is MFi necessary for My watch with the idea I have mentioned above?
Any suggestion will be appreciated.
Thanks in advance
SPP is classic BT whereas ANCS uses BTLE.
ANCS is free to use.
https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/AppleNotificationCenterServiceSpecification/Specification/Specification.html#//apple_ref/doc/uid/TP40013460-CH1-SW18

Is UIDevice multitaskingSupported checking necessary nowadays?

I checked this wiki and got to know that from the 3rd-generation iOS device (iPod touch 3 and iPhone 3GS I guess), the multitasking was supported.
So that means all the iOS device nowadays are multitasking supporting since the deployment target is 4.3. And the devices running that version of iOS are newer than "the 3rd-generation".
So no need to check [UIDevice currentDevice].multitaskingSupported , am I right?
You are correct. The last iPhone that didn't support multitasking was the iPhone 3G.
And since new apps these days shouldn't support anything older than iOS 7 (maybe nut rarely, iOS 6), there is no reason to check for multitasking.
And Apple only accepts apps that support iOS 4.3 or later. Any device that didn't support multitasking could never be updated to 4.3.
Any device a modern app will be running on these days will support multitasking.

Bluetooth LE and ANCS in iOS

Can I develop a service on iOS to register with ANCS so that when iPhone gets a notification the service go through my device BT LE protocol to notify the band?
And I read at http://blog.punchthrough.com/post/63658238857/the-apple-notification-center-service-or-wtf-is. I see "ANCS is managed automatically by the iOS device, or “Notification Provider” as its known in ANCS parlance. What this means for you as a developer is that you won’t need to write code to manage ANCS on the iOS side." It means i don't need write code in iOS side that have to implement in my device BT LE ? Thanks for any answer.
Correct. As the link mentions, you use "service solicitation" to get the iOS device's attention while it is passively scanning.
You don't need to have an app running on the iOS device, you don't need to submit anything to the App Store--you don't even need to pay to become a developer.
Also, I should mention, your hardware design does not need to be submitted to the Apple MFi program.

Resources