سؤال

I need a solution for one of my problem.I want to send a notification when device is not having internet.In this case we can use local notifications.(app is running or background)

But my actual doubt is that i want to send a notification when application is closed (not running in background(killed))and not having internet.Is this possible to achieve ?.

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

المحلول

You may still use UILocalNotification, even when the app is killed. From the docs:

... the application does not have to be running for this to happen. ... and do not require connection with remote servers.

If you do not care about the time the user receives the notification, you can still go with APNS, as the push notification will be delivered once the device connects to the internet again.

نصائح أخرى

For remote notification, obviously your application needs to be accessed by Apple Push Notification Servers.

Though not mentioned clearly, but if you want to notify the user that the internet connection is not available through the notification, then you clearly have no way. Through local notification you can schedule some pre decided things to be notified.

Only Apple apps are able to handle events without the need for local or push notifications.

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