Push Notification service is not working, When device is switch off - objective-c

I have implement Apple Push Notification in my application.
It's working fine when my iPhone is on.
Now, when I switch off my iPhone and fire notification from the server, it's successfully sent.
but, When I switch on my iPhone, I am not getting any notification.
So, what is the problem ?

Apple Push Notification service includes a default Quality of Service
(QoS) component that performs a store-and-forward function.
If APNs attempts to deliver a notification but the device is offline,
the notification is stored for a limited period of time, and delivered
to the device when it becomes available.
Only one recent notification for a particular application is stored.
If multiple notifications are sent while the device is offline, each
new notification causes the prior notification to be discarded. This
behavior of keeping only the newest notification is referred to as
coalescing notifications.
If the device remains offline for a long time, any notifications that
were being stored for it are discarded.

Related

Prevent device notification client side with React Native Firebase when a FCM notification arrives (based on user preferences)

I'd like to know if there any a way to prevent the device display a notification when a FCM message with a notification arrives, in case the user has decided to mute notifications and only have them arrive silently (making them act as data only messages, but being notification messages). I imagine like, in the handler/callback call a method to prevent the device notification and do extra processing afterwards.
I know I can use data only messages, but that approach would be harder since I must use multiple topics or token lists and somewhat more backend logic to achieve that.
Thanks
If the message contains a notification property, it is automatically handled by the OS when the app is not active. There is nothing you can do to prevent that.
As you said: if the message only contains a data property, it is always passed to your code for handling, and you can decide what to do with it. So that's the way to go if you want full client-side control over whether a notification is displayed for a message.

CoreBluetooth on Mac ( OS X Yosemite) : Huge data receving delay after first time connection

I've got a strange problem using CoreBluetooth on Mac mini. By design, my code should receive a data update notification after discovering a characteristics service once it's connected. The problem is no data will be updated if a event is triggered by hardware within very first 20 seconds.
I've test the same code in the iOS,but it all works fine without any dealy. So the question is:
Does Apple delay the -[didUpdateValueForCharacteristic:] notification after first BLE connection?
In addition, I am using a custom profile ( A self defined UUID).
Thanks.
According to documentation:
This method is invoked when your app calls the
readValueForCharacteristic: method, or when the peripheral notifies
your app that the value of the characteristic for which notifications
and indications are enabled (via a successful call to
setNotifyValue:forCharacteristic:) has changed.
So no, it's not guaranteed that this method will be called after discovering a characteristic. You either have to call readValueForCharacteristic or subscribe to notifications and wait until peripheral sends a notification.
However, after discovering a characteristic, you can get its value in peripheral:didDiscoverCharacteristicsForService:error: method.

Sending Push notification from client - Worklight

I know that push notifications are being sent from a backend server. Is it possible to send notification from client itself? My application goes like this: It acquires its position using Location services API. once it enters a specific circle, the trigger calls a callback function. What i want to do is to use the callback function to push a notification to the device. Is there any way to do this?
Thank you very much in advance!
If you just want a notification when the app is active in the background, you can use local notifications: https://github.com/katzer/cordova-plugin-local-notifications. The plug-in Javascript has to be modified somewhat to work with a Worklight app, but with some simple modifications it works great, and allows your app running in the background to raise a notification without going through the server side round trip involved when using push.
That said, I implemented an app that did exactly what you are looking for (in my case, I needed some server side processing to figure out what the text of the push message should be) The geo-fence callback called an adapter, providing it with event details and the device ID. The adapter determined what message to send, and used unicast push to send it back to the device.
You can invoke a procedure in the client side. I tried to invoke in the client side with httpAdapter and its working.
If the notification doesn't need to come from the server, you can also create a service that will run in the background and show a dialogbox once it enters the geofence.

Want to listen a notification when a connected Bluetooth device leave the range

I want to listen a notification when a connected bluetooth device gets out of range. I want that notification in both cases [either the app is running or the app is in suspended state].
As per Developer Documentation: Core Location Documentation
https://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLLocationManager_Class/index.html#//apple_ref/occ/instm/CLLocationManager/startMonitoringSignificantLocationChanges.
Apps can expect a notification as soon as the device moves 500 meters or more from its previous notification. It should not expect notifications more frequently than once every five minutes. If the device is able to retrieve data from the network, the location manager is much more likely to deliver notifications in a timely manner.
For detailed info on how to get location services follow this link
http://mobileoop.com/getting-location-updates-for-ios-7-and-8-when-the-app-is-killedterminatedsuspended

Send notification when bluetooth connection has been made like an iBeacon

Hi I am looking to see if I can send a notification when my iPhone connects to a bluetooth device with my app running in the background. This is similar to what happens with an iBeacon in iOS 7 I am just wondering if this can be done with any bluetooth device. I am ok with using private API's if necessary. If I understand bluetooth correctly, any bluetooth device has to at least communicate its identifier and wait and receive pairing codes so I am hoping i can be able to determine that if a bluetooth device broadcasts an identifier and my phone connects to it then send a notification like an iBeacon.
I have used an Estimote and it can broadcast the proximity and send notifications accordingly, I just want to be able to send a notification when a bluetooth connection has been made from any bluetooth device.
Thank you
On Apple's documentation you can find that you can act as a Bluetooth Central in the background. You should get callbacks if you are scanning for the correct UUID.
I haven't tested this but check that you have the correct UIBackgroundMode key in the info.plist file.
Also your CBCentralManagerDelegate should call the selector centralManager:didDiscoverPeripheral:advertisementData:RSSI: while your app is in the background.